IDEMPIERE-4274 Move example projects to idempiere-examples repository (#37)

Remove org.adempiere.report.jasper.fonts and org.adempiere.ui.zk.example
project.
This commit is contained in:
hengsin 2020-05-08 19:36:51 +08:00 committed by GitHub
parent df6b9c8c22
commit a6e19374d8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
49 changed files with 0 additions and 595 deletions

View File

@ -1,7 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="output" path="bin"/>
</classpath>

View File

@ -1,28 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>org.adempiere.report.jasper.fonts</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.ManifestBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.SchemaBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.pde.PluginNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>

View File

@ -1,4 +0,0 @@
#Tue Jun 19 21:29:53 MYT 2012
eclipse.preferences.version=1
pluginProject.extensions=false
resolve.requirebundle=false

View File

@ -1,10 +0,0 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: JasperReport Font Demo
Bundle-SymbolicName: org.adempiere.report.jasper.fonts
Bundle-Version: 1.0.0.qualifier
Bundle-RequiredExecutionEnvironment: JavaSE-1.8,
JavaSE-1.7
Export-Package: org.adempiere.report.jasper.fonts
Fragment-Host: net.sf.jasperreports.engine;bundle-version="6.3.1"

View File

@ -1,6 +0,0 @@
source.. = src/
output.. = bin/
bin.includes = META-INF/,\
.,\
src/jasperreports_extension.properties
jars.compile.order = .

View File

@ -1,2 +0,0 @@
net.sf.jasperreports.extension.registry.factory.fonts=net.sf.jasperreports.engine.fonts.SimpleFontExtensionsRegistryFactory
net.sf.jasperreports.extension.simple.font.families.fontfamily=org/adempiere/report/jasper/fonts/fontfamily.xml

View File

@ -1,51 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<fontfamilies>
<fontFamily name="Arial">
<normal>org/adempiere/report/jasper/fonts/Arial.ttf</normal>
<bold>org/adempiere/report/jasper/fonts/Arial_Bold.ttf</bold>
<italic>org/adempiere/report/jasper/fonts/Arial_Italic.ttf</italic>
<bolditalic>org/adempiere/report/jasper/fonts/Arial_Bold_Italic.ttf</bolditalic>
<pdfembedded>true</pdfembedded>
</fontFamily>
<fontFamily name="Comic Sans Test">
<normal>org/adempiere/report/jasper/fonts/Comic_Sans_MS.ttf</normal>
<bold>org/adempiere/report/jasper/fonts/Comic_Sans_MS_Bold.ttf</bold>
<pdfembedded>true</pdfembedded>
</fontFamily>
<fontFamily name="Courier New">
<normal>org/adempiere/report/jasper/fonts/Courier_New.ttf</normal>
<bold>org/adempiere/report/jasper/fonts/Courier_New_Bold.ttf</bold>
<italic>org/adempiere/report/jasper/fonts/Courier_New_Italic.ttf</italic>
<bolditalic>org/adempiere/report/jasper/fonts/Courier_New_Bold_Italic.ttf</bolditalic>
<pdfembedded>true</pdfembedded>
</fontFamily>
<fontFamily name="Georgia">
<normal>org/adempiere/report/jasper/fonts/Georgia.ttf</normal>
<bold>org/adempiere/report/jasper/fonts/Georgia_Bold.ttf</bold>
<italic>org/adempiere/report/jasper/fonts/Georgia_Italic.ttf</italic>
<bolditalic>org/adempiere/report/jasper/fonts/Georgia_Bold_Italic.ttf</bolditalic>
<pdfembedded>true</pdfembedded>
</fontFamily>
<fontFamily name="Monospaced">
<normal>org/adempiere/report/jasper/fonts/LiberationMono-Regular.ttf</normal>
<bold>org/adempiere/report/jasper/fonts/LiberationMono-Bold.ttf</bold>
<italic>org/adempiere/report/jasper/fonts/LiberationMono-Italic.ttf</italic>
<bolditalic>org/adempiere/report/jasper/fonts/LiberationMono-BoldItalic.ttf</bolditalic>
<pdfembedded>true</pdfembedded>
</fontFamily>
<fontFamily name="Times New Roman">
<normal>org/adempiere/report/jasper/fonts/Times_New_Roman.ttf</normal>
<bold>org/adempiere/report/jasper/fonts/Times_New_Roman_Bold.ttf</bold>
<italic>org/adempiere/report/jasper/fonts/Times_New_Roman_Italic.ttf</italic>
<bolditalic>org/adempiere/report/jasper/fonts/Times_New_Roman_Bold_Italic.ttf</bolditalic>
<pdfembedded>true</pdfembedded>
</fontFamily>
<fontFamily name="Verdana">
<normal>org/adempiere/report/jasper/fonts/Verdana.ttf</normal>
<bold>org/adempiere/report/jasper/fonts/Verdana_Bold.ttf</bold>
<italic>org/adempiere/report/jasper/fonts/Verdana_Italic.ttf</italic>
<bolditalic>org/adempiere/report/jasper/fonts/Verdana_Bold_Italic.ttf</bolditalic>
<pdfembedded>true</pdfembedded>
</fontFamily>
</fontfamilies>

View File

@ -1,7 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="output" path="bin"/>
</classpath>

View File

@ -1,33 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>org.adempiere.ui.zk.example</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.ManifestBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.SchemaBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.ds.core.builder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.pde.PluginNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>

View File

@ -1,7 +0,0 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
org.eclipse.jdt.core.compiler.compliance=1.7
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.source=1.7

View File

@ -1,3 +0,0 @@
eclipse.preferences.version=1
pluginProject.extensions=false
resolve.requirebundle=false

View File

@ -1,43 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<idempiere Name="ExportAction" Version="1.0" idempiereVersion="" DataBaseVersion="" Description="" Author="" AuthorEmail="" CreatedDate="2012-10-27 01:01:27.282" UpdatedDate="2012-10-27 01:01:27.282" PackOutVersion="100" Client="0-SYSTEM-System">
<AD_ToolBarButton type="table">
<AD_Client_ID>0</AD_Client_ID>
<AD_Org_ID>0</AD_Org_ID>
<Action>W</Action>
<AD_Tab_ID reference="id"/>
<SeqNo/>
<AD_Process_ID reference="id"/>
<DisplayLogic/>
<IsActive>true</IsActive>
<IsCustomization>true</IsCustomization>
<Name>Export</Name>
<KeyStroke_KeyCode>0</KeyStroke_KeyCode>
<KeyStroke_Modifiers>0</KeyStroke_Modifiers>
<AD_ToolBarButton_UU>09c20701-b692-44a1-9480-72a1cf8a0bf3</AD_ToolBarButton_UU>
<ComponentName>ExportExample</ComponentName>
<ActionName/>
<ActionClassName>org.adempiere.ui.zk.example.action.export</ActionClassName>
</AD_ToolBarButton>
<AD_Message type="table">
<AD_Client_ID>0</AD_Client_ID>
<AD_Org_ID>0</AD_Org_ID>
<MsgType>I</MsgType>
<MsgText>Export Example</MsgText>
<MsgTip/>
<EntityType>U</EntityType>
<AD_Message_UU>b9d8b3d7-34d7-4f18-aed9-c19f9ed8f28a</AD_Message_UU>
<Value>org.adempiere.ui.zk.example.action.export.tooltip</Value>
<IsActive>true</IsActive>
</AD_Message>
<AD_Message type="table">
<AD_Client_ID>0</AD_Client_ID>
<AD_Org_ID>0</AD_Org_ID>
<MsgType>I</MsgType>
<MsgText>Export Example</MsgText>
<MsgTip/>
<EntityType>U</EntityType>
<AD_Message_UU>9099992f-776f-4efb-bcc6-dbffd65a8f19</AD_Message_UU>
<Value>org.adempiere.ui.zk.example.action.export.label</Value>
<IsActive>true</IsActive>
</AD_Message>
</idempiere>

View File

@ -1,26 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/css" href="idempiereDocument.css"?>
<idempiereDocument>
<header>ExportAction Package Description</header>
<H1>Package Name:</H1>
<packagename>ExportAction</packagename>
<H1>Author:</H1>
<Name:/>
<H1>Email Address:</H1>
<Email/>
<H1>Created:</H1>
<Date>2012-10-27 01:01:27.282</Date>
<H1>Updated:</H1>
<Date>2012-10-27 01:01:27.282</Date>
<H1>Description:</H1>
<description/>
<H1>Instructions:</H1>
<instructions/>
<H1>Files in Package:</H1>
<file>File: PackOut.xml</file>
<filedirectory>Directory: \dict\</filedirectory>
<filenotes>Notes: Contains all application/object settings for package</filenotes>
<H1>Client:</H1>
<Client>0-SYSTEM-System</Client>
</idempiereDocument>

View File

@ -1,34 +0,0 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Example
Bundle-SymbolicName: org.adempiere.ui.zk.example
Bundle-Version: 1.0.0.qualifier
Bundle-Activator: org.adempiere.ui.zk.example.Activator
Bundle-ActivationPolicy: lazy
Comment: Bundle-RequiredExecutionEnvironment: JavaSE-11
Require-Capability: osgi.ee;filter:="(&(osgi.ee=JavaSE)(version>=1.11))"
Import-Package: org.adempiere.base,
org.adempiere.base.equinox,
org.adempiere.exceptions,
org.adempiere.plugin.utils,
org.adempiere.util,
org.adempiere.webui.action,
org.adempiere.webui.adwindow,
org.adempiere.webui.adwindow.validator,
org.adempiere.webui.apps,
org.adempiere.webui.component,
org.adempiere.webui.window,
org.compiere.model,
org.compiere.util,
org.osgi.framework;version="1.3.0"
Require-Bundle: zcommon;bundle-version="0.0.0",
zel;bundle-version="0.0.0",
zhtml;bundle-version="0.0.0",
zk;bundle-version="0.0.0",
zkbind;bundle-version="0.0.0",
zkplus;bundle-version="0.0.0",
zul;bundle-version="0.0.0",
zweb;bundle-version="0.0.0"
Service-Component: OSGI-INF/export.xml,
OSGI-INF/paymentwindowvalidator.xml
Export-Package: action.images

View File

@ -1,7 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" name="org.adempiere.ui.zk.example.action.export">
<implementation class="org.adempiere.ui.zk.example.action.ExportAction"/>
<service>
<provide interface="org.adempiere.webui.action.IAction"/>
</service>
</scr:component>

View File

@ -1,8 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" name="org.adempiere.window.payment.validator.PaymentWindowValidator">
<implementation class="org.adempiere.window.payment.validator.PaymentWindowValidator"/>
<service>
<provide interface="org.adempiere.webui.adwindow.validator.WindowValidator"/>
</service>
<property name="AD_Window_UU" type="String" value="ba895dc4-73df-4cf6-bc29-6dde6e011487"/>
</scr:component>

View File

@ -1,7 +0,0 @@
output.. = bin/
bin.includes = META-INF/,\
.,\
OSGI-INF/export.xml,\
OSGI-INF/paymentwindowvalidator.xml,\
OSGI-INF/
source.. = src/

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

View File

@ -1,42 +0,0 @@
/******************************************************************************
* Copyright (C) 2012 Heng Sin Low *
* Copyright (C) 2012 Trek Global *
* This program is free software; you can redistribute it and/or modify it *
* under the terms version 2 of the GNU General Public License as published *
* by the Free Software Foundation. This program is distributed in the hope *
* that it will be useful, but WITHOUT ANY WARRANTY; without even the implied *
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *
* See the GNU General Public License for more details. *
* You should have received a copy of the GNU General Public License along *
* with this program; if not, write to the Free Software Foundation, Inc., *
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*****************************************************************************/
package org.adempiere.ui.zk.example;
import org.adempiere.plugin.utils.AdempiereActivator;
import org.osgi.framework.BundleContext;
/**
*
* @author hengsin
*
*/
public class Activator extends AdempiereActivator {
/*
* (non-Javadoc)
* @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext)
*/
public void start(BundleContext bundleContext) throws Exception {
super.start(bundleContext);
}
/*
* (non-Javadoc)
* @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext)
*/
public void stop(BundleContext bundleContext) throws Exception {
super.stop(bundleContext);
}
}

View File

@ -1,57 +0,0 @@
/******************************************************************************
* Copyright (C) 2012 Heng Sin Low *
* Copyright (C) 2012 Trek Global *
* This program is free software; you can redistribute it and/or modify it *
* under the terms version 2 of the GNU General Public License as published *
* by the Free Software Foundation. This program is distributed in the hope *
* that it will be useful, but WITHOUT ANY WARRANTY; without even the implied *
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *
* See the GNU General Public License for more details. *
* You should have received a copy of the GNU General Public License along *
* with this program; if not, write to the Free Software Foundation, Inc., *
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*****************************************************************************/
package org.adempiere.ui.zk.example.action;
import org.adempiere.webui.action.IAction;
import org.adempiere.webui.adwindow.ADWindow;
import org.adempiere.webui.adwindow.ADWindowContent;
import org.adempiere.webui.apps.AEnv;
import org.adempiere.webui.window.FDialog;
import org.compiere.model.MRole;
/**
* @author hengsin
*
*/
public class ExportAction implements IAction {
/**
* default constructor
*/
public ExportAction() {
}
/* (non-Javadoc)
* @see org.adempiere.webui.action.IAction#execute(java.lang.Object)
*/
@Override
public void execute(Object target) {
ADWindow adwindow = (ADWindow) target;
ADWindowContent panel = adwindow.getADWindowContent();
if (!MRole.getDefault().isCanExport()) {
FDialog.error(panel.getWindowNo(), "AccessTableNoView");
return;
}
doExport(panel);
}
private void doExport(ADWindowContent panel) {
ExportWindow window = new ExportWindow();
window.init(panel);
AEnv.showWindow(window);
}
}

View File

@ -1,192 +0,0 @@
/**
*
*/
package org.adempiere.ui.zk.example.action;
import java.io.File;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import org.adempiere.base.IGridTabExporter;
import org.adempiere.base.equinox.EquinoxExtensionLocator;
import org.adempiere.exceptions.AdempiereException;
import org.adempiere.webui.adwindow.ADWindowContent;
import org.adempiere.webui.adwindow.IADTabbox;
import org.adempiere.webui.adwindow.IADTabpanel;
import org.adempiere.webui.component.Checkbox;
import org.adempiere.webui.component.ConfirmPanel;
import org.adempiere.webui.component.Label;
import org.adempiere.webui.component.ListItem;
import org.adempiere.webui.component.Listbox;
import org.adempiere.webui.component.Window;
import org.adempiere.webui.window.FDialog;
import org.compiere.model.GridTab;
import org.compiere.util.Env;
import org.compiere.util.Msg;
import org.zkoss.util.media.AMedia;
import org.zkoss.zk.ui.event.Event;
import org.zkoss.zk.ui.event.EventListener;
import org.zkoss.zul.Div;
import org.zkoss.zul.Filedownload;
import org.zkoss.zul.Hbox;
import org.zkoss.zul.Vbox;
/**
* @author hengsin
*
*/
public class ExportWindow extends Window implements EventListener<Event> {
/**
* generated serial id
*/
private static final long serialVersionUID = -4465587396361021680L;
private Map<String, IGridTabExporter> exporterMap = null;
private Map<String, String> extensionMap = null;
private ConfirmPanel confirmPanel = new ConfirmPanel(true);
private Listbox cboType = new Listbox();
private Checkbox chkCurrentRow = new Checkbox();
private ADWindowContent panel;
/**
*
*/
public ExportWindow() {
}
public void init(ADWindowContent panel) {
this.panel = panel;
exporterMap = new HashMap<String, IGridTabExporter>();
extensionMap = new HashMap<String, String>();
List<IGridTabExporter> exporterList = EquinoxExtensionLocator.instance().list(IGridTabExporter.class).getExtensions();
for(IGridTabExporter exporter : exporterList)
{
String extension = exporter.getFileExtension();
if (!extensionMap.containsKey(extension))
{
extensionMap.put(extension, exporter.getFileExtensionLabel());
exporterMap.put(extension, exporter);
}
}
setTitle(Msg.getMsg(Env.getCtx(), "Export") + ": " + panel.getActiveGridTab().getName());
setWidth("450px");
setClosable(true);
setBorder("normal");
setStyle("position:absolute");
cboType.setMold("select");
cboType.getItems().clear();
for(Map.Entry<String, String> entry : extensionMap.entrySet())
{
cboType.appendItem(entry.getKey() + " - " + entry.getValue(), entry.getKey());
}
cboType.setSelectedIndex(0);
Vbox vb = new Vbox();
vb.setWidth("100%");
appendChild(vb);
Hbox hb = new Hbox();
Div div = new Div();
div.setStyle("float: right");
div.appendChild(new Label("Files of Type: "));
hb.appendChild(div);
hb.appendChild(cboType);
cboType.setWidth("100%");
vb.appendChild(hb);
hb = new Hbox();
chkCurrentRow.setLabel(Msg.getMsg(Env.getCtx(), "ExportCurrentRowOnly"));
chkCurrentRow.setSelected(true);
hb.appendChild(chkCurrentRow);
vb.appendChild(hb);
vb.appendChild(confirmPanel);
confirmPanel.addActionListener(this);
setAttribute(Window.MODE_KEY, Window.MODE_HIGHLIGHTED);
}
@Override
public void onEvent(Event event) throws Exception {
if(event.getTarget().getId().equals(ConfirmPanel.A_CANCEL))
onClose();
else if(event.getTarget().getId().equals(ConfirmPanel.A_OK))
exportFile();
}
private void exportFile() {
try {
ListItem li = cboType.getSelectedItem();
if(li == null || li.getValue() == null)
{
FDialog.error(0, this, "FileInvalidExtension");
return;
}
String ext = li.getValue().toString();
IGridTabExporter exporter = exporterMap.get(ext);
if (exporter == null)
{
FDialog.error(0, this, "FileInvalidExtension");
return;
}
boolean currentRowOnly = chkCurrentRow.isSelected();
File file = File.createTempFile("Export", "."+ext);
IADTabbox adTab = panel.getADTab();
int selected = adTab.getSelectedIndex();
int tabLevel = panel.getActiveGridTab().getTabLevel();
Set<String> tables = new HashSet<String>();
List<GridTab> childs = new ArrayList<GridTab>();
List<GridTab> includedList = panel.getActiveGridTab().getIncludedTabs();
for(GridTab included : includedList)
{
String tableName = included.getTableName();
if (tables.contains(tableName))
continue;
tables.add(tableName);
childs.add(included);
}
for(int i = selected+1; i < adTab.getTabCount(); i++)
{
IADTabpanel adTabPanel = adTab.getADTabpanel(i);
if (adTabPanel.getGridTab().isSortTab())
continue;
if (adTabPanel.getGridTab().getTabLevel() <= tabLevel)
break;
String tableName = adTabPanel.getGridTab().getTableName();
if (tables.contains(tableName))
continue;
tables.add(tableName);
childs.add(adTabPanel.getGridTab());
}
int indxDetailSelected = 0;
if( adTab.getSelectedDetailADTabpanel()!=null )
indxDetailSelected = adTab.getSelectedDetailADTabpanel().getGridTab().getTabNo();
exporter.export(panel.getActiveGridTab(), childs, currentRowOnly,file,indxDetailSelected);
onClose();
AMedia media = null;
media = new AMedia(panel.getActiveGridTab().getName() + "." + ext, null, exporter.getContentType(), file, true);
Filedownload.save(media, panel.getActiveGridTab().getName() + "." + ext);
} catch (Exception e) {
throw new AdempiereException(e);
} finally {
onClose();
}
}
}

View File

@ -1,21 +0,0 @@
package org.adempiere.window.payment.validator;
import org.adempiere.util.Callback;
import org.adempiere.webui.adwindow.validator.WindowValidator;
import org.adempiere.webui.adwindow.validator.WindowValidatorEvent;
import org.adempiere.webui.adwindow.validator.WindowValidatorEventType;
import org.adempiere.webui.window.FDialog;
public class PaymentWindowValidator implements WindowValidator {
@Override
public void onWindowEvent(WindowValidatorEvent event,
Callback<Boolean> callback) {
if (event.getName().equals(WindowValidatorEventType.BEFORE_PRINT.getName())) {
FDialog.ask(event.getWindow().getADWindowContent().getWindowNo(),
event.getWindow().getComponent(), "Print ?", callback);
} else {
callback.onCallback(Boolean.TRUE);
}
}
}