JBoss Tools SVN: r11943 - in trunk/smooks/plugins: org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/analyzer and 4 other directories.
by jbosstools-commits@lists.jboss.org
Author: DartPeng
Date: 2008-11-21 04:11:19 -0500 (Fri, 21 Nov 2008)
New Revision: 11943
Modified:
trunk/smooks/plugins/org.jboss.tools.smooks.core/src/org/jboss/tools/smooks/model/util/SmooksModelConstants.java
trunk/smooks/plugins/org.jboss.tools.smooks.core/src/org/jboss/tools/smooks/model/util/SmooksModelUtils.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/analyzer/NormalSmooksModelBuilder.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/analyzer/SmooksFileBuilder.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/javabean/analyzer/JavaBeanAnalyzer.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/editors/DateTypeDetailPage.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/editors/DecoraterSelectionDialog.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/editors/ResourceConfigWarrperFactory.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/editors/SmooksFormEditor.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/editors/SmooksNormalContentEditFormPage.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/editors/SmooksResourceConfigFormBlock.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/editors/messages.properties
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/xml/AbstractFileSelectionWizardPage.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/xml2java/analyzer/XML2JavaAnalyzer.java
Log:
JBIDE-3246
Add new GUI to edit/add/remove "import" type.
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.core/src/org/jboss/tools/smooks/model/util/SmooksModelConstants.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.core/src/org/jboss/tools/smooks/model/util/SmooksModelConstants.java 2008-11-21 07:05:45 UTC (rev 11942)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.core/src/org/jboss/tools/smooks/model/util/SmooksModelConstants.java 2008-11-21 09:11:19 UTC (rev 11943)
@@ -21,6 +21,13 @@
public static final String DOM = "DOM";
public static final String SAX_DOM = "SAX/DOM";
public static final String BEAN_POPULATOR = "org.milyn.javabean.BeanPopulator";
+
+ public static final String[] DECODER_CLASSES = new String[] {
+ "org.milyn.javabean.decoders.DateDecoder",
+ "org.milyn.javabean.decoders.CalendarDecoder" };
+ /**
+ * @deprecated
+ */
public static final String DATE_DECODER = "org.milyn.javabean.decoders.DateDecoder";
public static final String AT_DOCUMENT = "@document";
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.core/src/org/jboss/tools/smooks/model/util/SmooksModelUtils.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.core/src/org/jboss/tools/smooks/model/util/SmooksModelUtils.java 2008-11-21 07:05:45 UTC (rev 11942)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.core/src/org/jboss/tools/smooks/model/util/SmooksModelUtils.java 2008-11-21 09:11:19 UTC (rev 11943)
@@ -81,8 +81,9 @@
List paramList = resourceConfig.getParam();
for (Iterator iterator = paramList.iterator(); iterator.hasNext();) {
ParamType param = (ParamType) iterator.next();
- if (SmooksModelConstants.STREAM_FILTER_TYPE.equals(param
- .getName())) {
+ String name = param.getName();
+ if(name != null) name = name.trim();
+ if (SmooksModelConstants.STREAM_FILTER_TYPE.equals(name)) {
typeParam = param;
break;
}
@@ -131,6 +132,7 @@
public static boolean isTransformTypeResourceConfig(
ResourceConfigType resourceConfig) {
String selector = resourceConfig.getSelector();
+ if(selector != null) selector = selector.trim();
if (!SmooksModelConstants.GLOBAL_PARAMETERS.equals(selector)) {
return false;
}
@@ -141,7 +143,9 @@
List paramList = resourceConfig.getParam();
for (Iterator iterator = paramList.iterator(); iterator.hasNext();) {
ParamType p = (ParamType) iterator.next();
- if (SmooksModelConstants.STREAM_FILTER_TYPE.equals(p.getName())) {
+ String paramName = p.getName();
+ if(paramName != null) paramName = paramName.trim();
+ if (SmooksModelConstants.STREAM_FILTER_TYPE.equals(paramName)) {
return true;
}
}
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/analyzer/NormalSmooksModelBuilder.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/analyzer/NormalSmooksModelBuilder.java 2008-11-21 07:05:45 UTC (rev 11942)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/analyzer/NormalSmooksModelBuilder.java 2008-11-21 09:11:19 UTC (rev 11943)
@@ -32,17 +32,19 @@
public NormalSmooksModelPackage buildNormalSmooksModelPackage(
SmooksResourceListType list) {
- NormalSmooksModelPackage modelPackage = new NormalSmooksModelPackage(list);
+ NormalSmooksModelPackage modelPackage = new NormalSmooksModelPackage(
+ list);
if (list != null) {
List resourceConfigList = list.getAbstractResourceConfig();
for (Iterator iterator = resourceConfigList.iterator(); iterator
.hasNext();) {
- ResourceConfigType resourceConfig = (ResourceConfigType) iterator
- .next();
- this.processResouceConfig(resourceConfig, modelPackage);
+ Object resourceConfig = iterator.next();
+ if (resourceConfig instanceof ResourceConfigType) {
+ this.processResouceConfig((ResourceConfigType)resourceConfig, modelPackage);
+ }
}
- if(resourceConfigList.isEmpty()){
-
+ if (resourceConfigList.isEmpty()) {
+
}
}
return modelPackage;
@@ -50,15 +52,15 @@
protected void processResouceConfig(ResourceConfigType config,
NormalSmooksModelPackage modelPackage) {
-// if (isBeanPopulator(config)) {
-// modelPackage.getBeanPopulatorResourceConfigList().add(config);
-// }
-// if (isDateConfig(config)) {
-// modelPackage.getDateResourceConfigList().add(config);
-// }
-// if (isSmooksTransformType(config)) {
-// modelPackage.setSmooksTransformTypeResourceConfig(config);
-// }
+ // if (isBeanPopulator(config)) {
+ // modelPackage.getBeanPopulatorResourceConfigList().add(config);
+ // }
+ // if (isDateConfig(config)) {
+ // modelPackage.getDateResourceConfigList().add(config);
+ // }
+ // if (isSmooksTransformType(config)) {
+ // modelPackage.setSmooksTransformTypeResourceConfig(config);
+ // }
}
public static boolean isSmooksTransformType(ResourceConfigType config) {
@@ -78,8 +80,14 @@
ResourceType resource = config.getResource();
if (resource != null) {
String r = resource.getValue();
- if (r != null)
- return SmooksModelConstants.DATE_DECODER.equals(r.trim());
+ if (r != null) {
+ for (int i = 0; i < SmooksModelConstants.DECODER_CLASSES.length; i++) {
+ String decoder = SmooksModelConstants.DECODER_CLASSES[i];
+ if (r.trim().equals(decoder)) {
+ return true;
+ }
+ }
+ }
}
return false;
}
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/analyzer/SmooksFileBuilder.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/analyzer/SmooksFileBuilder.java 2008-11-21 07:05:45 UTC (rev 11942)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/analyzer/SmooksFileBuilder.java 2008-11-21 09:11:19 UTC (rev 11943)
@@ -58,15 +58,9 @@
IMappingAnalyzer analyzer = factory.getMappingAnalyzer(context
.getSourceDataTypeID(), context.getTargetDataTypeID());
- if (analyzer == null) {
- throw new SmooksAnalyzerException(
- Messages.getString("SmooksFileBuilder.NullAnalyzer1") //$NON-NLS-1$
- + context.getSourceDataTypeID()
- + Messages.getString("SmooksFileBuilder.NullAnalyzer2") //$NON-NLS-1$
- + context.getTargetDataTypeID());
- }
if (smooksResource == null) {
- throw new SmooksAnalyzerException(Messages.getString("SmooksFileBuilder.ResourceIsNull")); //$NON-NLS-1$
+ throw new SmooksAnalyzerException(Messages
+ .getString("SmooksFileBuilder.ResourceIsNull")); //$NON-NLS-1$
}
DocumentRoot documentRoot = (DocumentRoot) smooksResource.getContents()
.get(0);
@@ -86,9 +80,9 @@
context.setGeneratorResourceList(new ArrayList());
context.setSmooksResourceListModel(listType);
context.setDomain(domain);
+ if (analyzer != null)
+ analyzer.analyzeMappingGraphModel(context);
- analyzer.analyzeMappingGraphModel(context);
-
insertResoureConfig(listType, context.getGeneratorResourceList());
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
@@ -182,54 +176,58 @@
protected void initSmooksParseStyle(
SmooksConfigurationFileGenerateContext context,
SmooksResourceListType resourceList) {
-// String type = context.getSmooksType();
-// if (type == null)
-// return;
-// ResourceConfigType config = null;
-// if (resourceList.getAbstractResourceConfig().size() < 1) {
-// } else {
-// config = (ResourceConfigType) resourceList
-// .getAbstractResourceConfig().get(0);
-// String selector = config.getSelector();
-// if (!SmooksModelConstants.GLOBAL_PARAMETERS.equals(selector)) {
-// config = null;
-// } else {
-// if (config.getParam().isEmpty()) {
-// config = null;
-// } else {
-// ParamType param = config.getParam().get(0);
-// if (!SmooksModelConstants.STREAM_FILTER_TYPE.equals(param
-// .getName())) {
-// config = null;
-// }
-// }
-// }
-// }
-// ParamType param = null;
-// if (config == null) {
-// config = SmooksFactory.eINSTANCE.createResourceConfigType();
-// AddCommand.create(domain, resourceList, SmooksPackage.eINSTANCE.getSmooksResourceListType_AbstractResourceConfig(), config).execute();
-// MoveCommand.create(domain, resourceList, SmooksPackage.eINSTANCE.getSmooksResourceListType_AbstractResourceConfig(), config, 0);
-// config.setSelector(SmooksModelConstants.GLOBAL_PARAMETERS);
-// param = SmooksFactory.eINSTANCE.createParamType();
-// param.setName(SmooksModelConstants.STREAM_FILTER_TYPE);
-// config.getParam().add(param);
-// }else{
-// List paramList = config.getParam();
-// for (Iterator iterator = paramList.iterator(); iterator.hasNext();) {
-// ParamType p = (ParamType) iterator.next();
-// if(SmooksModelConstants.STREAM_FILTER_TYPE.equals(p.getName())){
-// param = p;
-// break;
-// }
-// }
-// if(param == null){
-// param = SmooksFactory.eINSTANCE.createParamType();
-// param.setName(SmooksModelConstants.STREAM_FILTER_TYPE);
-// config.getParam().add(param);
-// }
-// }
-// SmooksModelUtils.cleanTextToSmooksType(param);
-// SmooksModelUtils.appendTextToSmooksType(param, context.getSmooksType());
+ // String type = context.getSmooksType();
+ // if (type == null)
+ // return;
+ // ResourceConfigType config = null;
+ // if (resourceList.getAbstractResourceConfig().size() < 1) {
+ // } else {
+ // config = (ResourceConfigType) resourceList
+ // .getAbstractResourceConfig().get(0);
+ // String selector = config.getSelector();
+ // if (!SmooksModelConstants.GLOBAL_PARAMETERS.equals(selector)) {
+ // config = null;
+ // } else {
+ // if (config.getParam().isEmpty()) {
+ // config = null;
+ // } else {
+ // ParamType param = config.getParam().get(0);
+ // if (!SmooksModelConstants.STREAM_FILTER_TYPE.equals(param
+ // .getName())) {
+ // config = null;
+ // }
+ // }
+ // }
+ // }
+ // ParamType param = null;
+ // if (config == null) {
+ // config = SmooksFactory.eINSTANCE.createResourceConfigType();
+ // AddCommand.create(domain, resourceList, SmooksPackage.eINSTANCE.
+ // getSmooksResourceListType_AbstractResourceConfig(),
+ // config).execute();
+ // MoveCommand.create(domain, resourceList, SmooksPackage.eINSTANCE.
+ // getSmooksResourceListType_AbstractResourceConfig(), config, 0);
+ // config.setSelector(SmooksModelConstants.GLOBAL_PARAMETERS);
+ // param = SmooksFactory.eINSTANCE.createParamType();
+ // param.setName(SmooksModelConstants.STREAM_FILTER_TYPE);
+ // config.getParam().add(param);
+ // }else{
+ // List paramList = config.getParam();
+ // for (Iterator iterator = paramList.iterator(); iterator.hasNext();) {
+ // ParamType p = (ParamType) iterator.next();
+ // if(SmooksModelConstants.STREAM_FILTER_TYPE.equals(p.getName())){
+ // param = p;
+ // break;
+ // }
+ // }
+ // if(param == null){
+ // param = SmooksFactory.eINSTANCE.createParamType();
+ // param.setName(SmooksModelConstants.STREAM_FILTER_TYPE);
+ // config.getParam().add(param);
+ // }
+ // }
+ // SmooksModelUtils.cleanTextToSmooksType(param);
+ // SmooksModelUtils.appendTextToSmooksType(param,
+ // context.getSmooksType());
}
}
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/javabean/analyzer/JavaBeanAnalyzer.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/javabean/analyzer/JavaBeanAnalyzer.java 2008-11-21 07:05:45 UTC (rev 11942)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/javabean/analyzer/JavaBeanAnalyzer.java 2008-11-21 09:11:19 UTC (rev 11943)
@@ -863,7 +863,7 @@
if (resourceConfig != null) {
rootModel.setBeanClassString(SmooksModelUtils.getParmaText(
SmooksModelUtils.BEAN_CLASS, resourceConfig));
- setSelectorIsUsed(selector);
+// setSelectorIsUsed(selector);
buildChildrenOfTargetInputModel(listType, rootModel, false,
rootIsError, resourceConfig, loader);
list.add(rootModel);
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/editors/DateTypeDetailPage.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/editors/DateTypeDetailPage.java 2008-11-21 07:05:45 UTC (rev 11942)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/editors/DateTypeDetailPage.java 2008-11-21 09:11:19 UTC (rev 11943)
@@ -19,6 +19,9 @@
import org.eclipse.swt.widgets.Combo;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Text;
+import org.jboss.tools.smooks.model.ResourceType;
+import org.jboss.tools.smooks.model.SmooksFactory;
+import org.jboss.tools.smooks.model.util.SmooksModelConstants;
import org.jboss.tools.smooks.model.util.SmooksModelUtils;
/**
@@ -32,6 +35,7 @@
private Combo localeLangaugeCombo;
private Combo localeContryCombo;
private Text selectorText;
+ private Combo decoderCombo;
public DateTypeDetailPage(SmooksFormEditor parentEditor,
EditingDomain domain) {
@@ -55,6 +59,11 @@
selectorText = this.formToolKit.createText(parent, ""); //$NON-NLS-1$
selectorText.setLayoutData(gd);
+ this.formToolKit.createLabel(parent, "Decoder Class :");
+ gd = new GridData(GridData.FILL_HORIZONTAL);
+ decoderCombo = new Combo(parent, SWT.FLAT);
+ decoderCombo.setLayoutData(gd);
+
this.formToolKit.createLabel(parent, Messages.getString("DateTypeDetailPage.DateTypeFormatText")); //$NON-NLS-1$
gd = new GridData(GridData.FILL_HORIZONTAL);
formatText = this.formToolKit.createText(parent, ""); //$NON-NLS-1$
@@ -72,10 +81,26 @@
formToolKit.paintBordersFor(parent);
+ initComboBox();
hookControls();
}
+ private void initComboBox() {
+ for (int i = 0; i < SmooksModelConstants.DECODER_CLASSES.length; i++) {
+ decoderCombo.add(SmooksModelConstants.DECODER_CLASSES[i]);
+ }
+ }
+
private void hookControls() {
+
+ decoderCombo.addModifyListener(new ModifyListener(){
+
+ public void modifyText(ModifyEvent e) {
+ setDecoderClass();
+ }
+
+ });
+
selectorText.addModifyListener(new ModifyListener(){
public void modifyText(ModifyEvent e) {
setSelector();
@@ -107,6 +132,24 @@
});
}
+ protected void setDecoderClass() {
+ String text = decoderCombo.getText();
+ if(text == null) text = "";
+ if(this.resourceConfigList != null){
+ ResourceType resource = resourceConfigList.getResource();
+ if(resource == null){
+ resource = SmooksFactory.eINSTANCE.createResourceType();
+ resourceConfigList.setResource(resource);
+ }
+ if(text.trim().equals(resource.getValue())){
+ return;
+ }
+ resource.setValue(text);
+ this.parentEditor.fireEditorDirty(true);
+ }
+
+ }
+
protected void setFormat() {
String format = formatText.getText();
if(format == null) format = "";
@@ -156,6 +199,12 @@
String formate = SmooksModelUtils.getParmaText("format", resourceConfigList); //$NON-NLS-1$
String locallang = SmooksModelUtils.getParmaText("locale-language", resourceConfigList); //$NON-NLS-1$
String localcontry = SmooksModelUtils.getParmaText("locale-country", resourceConfigList); //$NON-NLS-1$
+ String decoderClass = "";
+ ResourceType resource = resourceConfigList.getResource();
+ if(resource != null){
+ decoderClass = resource.getValue();
+ if(decoderClass != null) decoderClass = decoderClass.trim();
+ }
if(formate == null) formate = ""; //$NON-NLS-1$
if(locallang == null) locallang = ""; //$NON-NLS-1$
if(localcontry == null) localcontry = ""; //$NON-NLS-1$
@@ -166,6 +215,7 @@
formatText.setText(formate);
localeContryCombo.setText(localcontry);
localeLangaugeCombo.setText(locallang);
+ decoderCombo.setText(decoderClass);
}
}
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/editors/DecoraterSelectionDialog.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/editors/DecoraterSelectionDialog.java 2008-11-21 07:05:45 UTC (rev 11942)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/editors/DecoraterSelectionDialog.java 2008-11-21 09:11:19 UTC (rev 11943)
@@ -23,9 +23,11 @@
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Shell;
+import org.jboss.tools.smooks.model.AbstractResourceConfig;
import org.jboss.tools.smooks.model.ResourceConfigType;
import org.jboss.tools.smooks.model.ResourceType;
import org.jboss.tools.smooks.model.SmooksResourceListType;
+import org.jboss.tools.smooks.model.util.SmooksModelConstants;
/**
* @author Dart
@@ -73,12 +75,13 @@
viewer.addDoubleClickListener(new IDoubleClickListener() {
public void doubleClick(DoubleClickEvent event) {
- IStructuredSelection selection = (IStructuredSelection) event.getSelection();
+ IStructuredSelection selection = (IStructuredSelection) event
+ .getSelection();
Object obj = selection.getFirstElement();
if (obj == null) {
return;
}
- if(obj instanceof Decorater){
+ if (obj instanceof Decorater) {
okPressed();
}
}
@@ -89,11 +92,13 @@
private void initViewer(TreeViewer viewer) {
if (resourceList != null) {
- List allList = new ArrayList();
- List dateDecoraterList = new ArrayList();
+ List<Object> allList = new ArrayList<Object>();
+ List<Decorater> dateDecoraterList = new ArrayList<Decorater>();
allList.add(dateDecoraterList);
- List list = resourceList.getAbstractResourceConfig();
- for (Iterator iterator = list.iterator(); iterator.hasNext();) {
+ List<AbstractResourceConfig> list = resourceList
+ .getAbstractResourceConfig();
+ for (Iterator<AbstractResourceConfig> iterator = list.iterator(); iterator
+ .hasNext();) {
ResourceConfigType config = (ResourceConfigType) iterator
.next();
String selector = config.getSelector();
@@ -102,18 +107,21 @@
String selector1 = selector.substring(0, selector
.indexOf(":"));
selector1 = selector1.trim();
- String selector2 = selector.substring(selector
- .indexOf(":") + 1 , selector.length());
+ String selector2 = selector.substring(
+ selector.indexOf(":") + 1, selector.length());
selector2 = selector2.trim();
- if (selector1.equals("decorat")) {
+ if (selector1.equals("decoder")) {
ResourceType resource = config.getResource();
if (resource != null) {
String value = resource.getValue();
- if(value != null) value = value.trim();
- if ("org.milyn.javabean.decoders.DateDecoder"
- .equals(value)) {
- dateDecoraterList.add(new DateDecorater(
- selector2));
+ if (value != null)
+ value = value.trim();
+ for (int i = 0; i < SmooksModelConstants.DECODER_CLASSES.length; i++) {
+ String decoderClass = SmooksModelConstants.DECODER_CLASSES[i];
+ if (decoderClass.equals(value)) {
+ dateDecoraterList.add(new DateDecorater(
+ selector2));
+ }
}
}
}
@@ -154,7 +162,7 @@
} else {
if (obj instanceof Decorater) {
this.setSelectedDecorater((Decorater) obj);
- }else{
+ } else {
setSelectedDecorater(null);
}
}
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/editors/ResourceConfigWarrperFactory.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/editors/ResourceConfigWarrperFactory.java 2008-11-21 07:05:45 UTC (rev 11942)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/editors/ResourceConfigWarrperFactory.java 2008-11-21 09:11:19 UTC (rev 11943)
@@ -62,8 +62,11 @@
return false;
String value = resource.getValue();
if(value != null) value = value.trim();
- if (SmooksModelConstants.DATE_DECODER.equals(value)) {
- return true;
+ for (int i = 0; i < SmooksModelConstants.DECODER_CLASSES.length; i++) {
+ String decoderClass = SmooksModelConstants.DECODER_CLASSES[i];
+ if(decoderClass.equals(value)){
+ return true;
+ }
}
return false;
}
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/editors/SmooksFormEditor.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/editors/SmooksFormEditor.java 2008-11-21 07:05:45 UTC (rev 11942)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/editors/SmooksFormEditor.java 2008-11-21 09:11:19 UTC (rev 11943)
@@ -112,6 +112,8 @@
if (mappingResourceConfig != null) {
refreshNormalPage(mappingResourceConfig
.getRelationgResourceConfigList());
+ }else{
+ refreshNormalPage(Collections.EMPTY_LIST);
}
}
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/editors/SmooksNormalContentEditFormPage.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/editors/SmooksNormalContentEditFormPage.java 2008-11-21 07:05:45 UTC (rev 11942)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/editors/SmooksNormalContentEditFormPage.java 2008-11-21 09:11:19 UTC (rev 11943)
@@ -10,26 +10,51 @@
******************************************************************************/
package org.jboss.tools.smooks.ui.editors;
+import java.util.Collections;
+import java.util.Iterator;
import java.util.List;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.emf.common.command.Command;
+import org.eclipse.emf.common.ui.dialogs.WorkspaceResourceDialog;
import org.eclipse.emf.edit.command.AddCommand;
import org.eclipse.emf.edit.command.MoveCommand;
import org.eclipse.emf.edit.domain.EditingDomain;
+import org.eclipse.jface.viewers.DoubleClickEvent;
+import org.eclipse.jface.viewers.IDoubleClickListener;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredContentProvider;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.LabelProvider;
+import org.eclipse.jface.viewers.TableViewer;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.jface.viewers.ViewerFilter;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.ui.IFileEditorInput;
+import org.eclipse.ui.PartInitException;
import org.eclipse.ui.forms.IManagedForm;
import org.eclipse.ui.forms.editor.FormEditor;
import org.eclipse.ui.forms.editor.FormPage;
import org.eclipse.ui.forms.widgets.FormToolkit;
import org.eclipse.ui.forms.widgets.ScrolledForm;
import org.eclipse.ui.forms.widgets.Section;
+import org.eclipse.ui.ide.IDE;
import org.jboss.tools.smooks.analyzer.MappingResourceConfigList;
import org.jboss.tools.smooks.analyzer.NormalSmooksModelPackage;
+import org.jboss.tools.smooks.model.ImportType;
import org.jboss.tools.smooks.model.ParamType;
import org.jboss.tools.smooks.model.ResourceConfigType;
import org.jboss.tools.smooks.model.SmooksFactory;
@@ -38,6 +63,9 @@
import org.jboss.tools.smooks.model.util.SmooksModelUtils;
import org.jboss.tools.smooks.ui.AnalyzeResult;
import org.jboss.tools.smooks.ui.IAnalyzeListener;
+import org.jboss.tools.smooks.ui.SmooksUIActivator;
+import org.jboss.tools.smooks.ui.gef.util.GraphicsConstants;
+import org.jboss.tools.smooks.utils.SmooksGraphConstants;
import org.jboss.tools.smooks.utils.UIUtils;
/**
@@ -75,6 +103,14 @@
private Section parseTypeSection;
+ private Button addFileButton;
+
+ private Button removeFileButton;
+
+ private Button editFileButton;
+
+ private TableViewer fileViewer;
+
public SmooksNormalContentEditFormPage(FormEditor editor, String id,
String title, NormalSmooksModelPackage modelPacakge) {
super(editor, id, title);
@@ -108,17 +144,17 @@
GridLayout gridLayout = UIUtils.createGeneralFormEditorLayout(1);
resourceBlock.createContent(managedForm);
Composite rootMainControl = form.getBody();
- form.setText(Messages.getString("SmooksNormalContentEditFormPage.ConfigurationPageText")); //$NON-NLS-1$
+ form
+ .setText(Messages
+ .getString("SmooksNormalContentEditFormPage.ConfigurationPageText")); //$NON-NLS-1$
createSmooksTypeGUI(rootMainControl, tool);
form.getBody().setLayout(gridLayout);
form.pack();
- this.initTransformTypeResourceConfig();
+ this.initOtherConfigurationsGUI();
resourceBlock.initViewers(transformType);
setGUIStates();
}
-
-
@Override
public boolean isDirty() {
@@ -156,7 +192,7 @@
return transformType;
}
- protected void initTransformTypeResourceConfig() {
+ protected void initOtherConfigurationsGUI() {
if (saxButton != null)
saxButton.setSelection(false);
if (domButton != null)
@@ -166,10 +202,14 @@
if (this.getModelPackage() != null) {
List list = modelPackage.getSmooksResourceList()
.getAbstractResourceConfig();
- if (list != null && !list.isEmpty()) {
- ResourceConfigType first = (ResourceConfigType) list.get(0);
- if (SmooksModelUtils.isTransformTypeResourceConfig(first)) {
- this.transformType = first;
+ for (Iterator iterator = list.iterator(); iterator.hasNext();) {
+ Object sr = iterator.next();
+ if (sr instanceof ResourceConfigType) {
+ if (SmooksModelUtils
+ .isTransformTypeResourceConfig((ResourceConfigType) sr)) {
+ this.transformType = (ResourceConfigType) sr;
+ break;
+ }
}
}
if (transformType == null) {
@@ -196,30 +236,157 @@
protected void createSmooksTypeGUI(Composite mainComposite, FormToolkit tool) {
GridData gd = new GridData(GridData.FILL_HORIZONTAL);
parseTypeSection = tool.createSection(mainComposite, Section.TITLE_BAR
- | Section.DESCRIPTION | Section.TWISTIE);
+ | Section.TWISTIE);
parseTypeSection.setLayoutData(gd);
- Composite typeSelectComposite = tool.createComposite(parseTypeSection);
- parseTypeSection.setClient(typeSelectComposite);
- parseTypeSection.setText(Messages.getString("SmooksNormalContentEditFormPage.SmooksParseType")); //$NON-NLS-1$
+ Composite otherConfigurationComposite = tool
+ .createComposite(parseTypeSection);
+ parseTypeSection.setClient(otherConfigurationComposite);
+ parseTypeSection.setText(Messages
+ .getString("SmooksNormalContentEditFormPage.SmooksParseType")); //$NON-NLS-1$
GridLayout layout1 = new GridLayout();
- typeSelectComposite.setLayout(layout1);
+ otherConfigurationComposite.setLayout(layout1);
gd = new GridData(GridData.FILL_HORIZONTAL);
gd.horizontalSpan = 2;
- typeSelectComposite.setLayoutData(gd);
+ otherConfigurationComposite.setLayoutData(gd);
GridLayout layout = new GridLayout();
- layout.numColumns = 3;
- typeSelectComposite.setLayout(layout);
+ otherConfigurationComposite.setLayout(layout);
- saxButton = createTypeSelectRadioButton(typeSelectComposite, tool,
+ Composite buttonComposite = tool
+ .createComposite(otherConfigurationComposite);
+ GridLayout buttonAreaLayout = new GridLayout();
+ buttonAreaLayout.numColumns = 4;
+ buttonComposite.setLayout(buttonAreaLayout);
+
+ gd = new GridData(GridData.FILL_HORIZONTAL);
+ buttonComposite.setLayoutData(gd);
+
+ tool.createLabel(buttonComposite, "Parse Type : ");
+ saxButton = createTypeSelectRadioButton(buttonComposite, tool,
SmooksModelConstants.SAX);
- domButton = createTypeSelectRadioButton(typeSelectComposite, tool,
+ domButton = createTypeSelectRadioButton(buttonComposite, tool,
SmooksModelConstants.DOM);
- saxdomButton = createTypeSelectRadioButton(typeSelectComposite, tool,
+ saxdomButton = createTypeSelectRadioButton(buttonComposite, tool,
SmooksModelConstants.SAX_DOM);
+
+ gd = new GridData(GridData.FILL_HORIZONTAL);
+ gd.horizontalSpan = 2;
+ tool.createSeparator(otherConfigurationComposite, SWT.HORIZONTAL)
+ .setLayoutData(gd);
+
+ Composite importFileComposite = tool
+ .createComposite(otherConfigurationComposite);
+ gd = new GridData(GridData.FILL_HORIZONTAL);
+ GridLayout fileLayout = new GridLayout();
+ fileLayout.numColumns = 2;
+ importFileComposite.setLayoutData(gd);
+ importFileComposite.setLayout(fileLayout);
+ // importFileComposite.setBackground(ColorConstants.black);
+
+ Label fileListLabel = tool.createLabel(importFileComposite,
+ "Import Files :");
+ gd = new GridData(GridData.FILL_HORIZONTAL);
+ gd.horizontalSpan = 2;
+ fileListLabel.setLayoutData(gd);
+
+ Composite viewerComposite = tool.createComposite(importFileComposite);
+ FillLayout viewerLayout = new FillLayout();
+ viewerLayout.marginHeight = 1;
+ viewerLayout.marginWidth = 1;
+ viewerComposite.setLayout(viewerLayout);
+ fileViewer = new TableViewer(viewerComposite, SWT.NONE);
+ fileViewer.setContentProvider(new FileImportContentProvider());
+ fileViewer.setLabelProvider(new FileImportLabelProvider());
+ fileViewer.setInput(getModelPackage().getSmooksResourceList()
+ .getAbstractResourceConfig());
+ fileViewer.addDoubleClickListener(new IDoubleClickListener() {
+ public void doubleClick(DoubleClickEvent event) {
+ openFile(fileViewer.getSelection());
+ }
+ });
+ fileViewer.addFilter(new ViewerFilter() {
+
+ @Override
+ public boolean select(Viewer viewer, Object parentElement,
+ Object element) {
+ if (element instanceof ImportType)
+ return true;
+ return false;
+ }
+
+ });
+ gd = new GridData(GridData.FILL_BOTH);
+ viewerComposite.setLayoutData(gd);
+ viewerComposite.setBackground(GraphicsConstants.groupBorderColor);
+ tool.paintBordersFor(viewerComposite);
+
+ Composite fileActionComposite = tool
+ .createComposite(importFileComposite);
+ gd = new GridData(GridData.FILL_VERTICAL);
+ fileActionComposite.setLayoutData(gd);
+
+ GridLayout fileActionLayout = new GridLayout();
+ fileActionComposite.setLayout(fileActionLayout);
+
+ addFileButton = createFileActionButton(fileActionComposite, tool, "Add");
+ removeFileButton = createFileActionButton(fileActionComposite, tool,
+ "Remove");
+ editFileButton = createFileActionButton(fileActionComposite, tool,
+ "Edit");
+
+ tool.paintBordersFor(fileActionComposite);
+
hookButtons();
}
+ protected void openFile(ISelection selection) {
+ Object obj = ((IStructuredSelection) selection).getFirstElement();
+ if (obj != null && obj instanceof ImportType) {
+ String filePath = ((ImportType) obj).getFile();
+ IFile input = createEditorInput(filePath);
+ if (input != null) {
+ try {
+ IDE.openEditor(SmooksUIActivator.getDefault()
+ .getWorkbench().getActiveWorkbenchWindow()
+ .getActivePage(), input);
+ } catch (PartInitException e) {
+ UIUtils.showErrorDialog(getSite().getShell(), UIUtils
+ .createErrorStatus(e));
+ }
+ }
+ }
+ }
+
+ private IProject getCurrentProject() {
+ IFile file = ((IFileEditorInput) getEditor().getEditorInput())
+ .getFile();
+ if (file != null) {
+ IProject project = file.getProject();
+ return project;
+ }
+ return null;
+ }
+
+ protected IFile createEditorInput(String filePath) {
+ String workspacePath = this.getWorkspaceFilePath(filePath);
+ IProject project = getCurrentProject();
+ if (project != null) {
+ IResource resource = project.findMember(new Path(workspacePath));
+ if (resource instanceof IFile) {
+ return (IFile) resource;
+ }
+ }
+ return null;
+ }
+
+ private Button createFileActionButton(Composite parent, FormToolkit tool,
+ String text) {
+ Button button = tool.createButton(parent, text, SWT.NONE);
+ GridData gd = new GridData(GridData.FILL_HORIZONTAL);
+ button.setLayoutData(gd);
+ return button;
+ }
+
private void setTransformType(String type) {
if (this.transformType != null) {
SmooksModelUtils.setTransformType(transformType, type);
@@ -237,11 +404,9 @@
});
domButton.addSelectionListener(new SelectionAdapter() {
-
public void widgetSelected(SelectionEvent e) {
setTransformType(SmooksModelConstants.DOM);
}
-
});
saxdomButton.addSelectionListener(new SelectionAdapter() {
@@ -251,14 +416,124 @@
}
});
+
+ addFileButton.addSelectionListener(new SelectionAdapter() {
+
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ addFileImport();
+ }
+
+ });
+
+ removeFileButton.addSelectionListener(new SelectionAdapter() {
+
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ removeFileImport();
+ }
+
+ });
+
+ editFileButton.addSelectionListener(new SelectionAdapter() {
+
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ editFileImport();
+ }
+
+ });
}
+ protected void editFileImport() {
+ IStructuredSelection selection = (IStructuredSelection) fileViewer
+ .getSelection();
+ Object obj = selection.getFirstElement();
+ if (obj instanceof ImportType) {
+ String filePath = getWorkspaceFilePath(((ImportType) obj).getFile());
+ IProject project = getCurrentProject();
+ if (project != null) {
+ IResource resource = project.findMember(new Path(filePath));
+ IFile[] files = WorkspaceResourceDialog.openFileSelection(
+ getSite().getShell(), "Select Files", "", false,
+ new Object[] { resource }, Collections.EMPTY_LIST);
+ if (files != null) {
+ IPath path1 = files[0].getFullPath().removeFirstSegments(1);
+ String s = path1.toString();
+ if(s.startsWith("/") || s.startsWith("\\")){
+
+ }else{
+ s = "/" + s;
+ }
+ ((ImportType) obj).setFile("classpath:" + s);
+ fileViewer.refresh();
+ ((SmooksFormEditor) getEditor()).fireEditorDirty(true);
+ }
+ }
+
+ }
+ }
+
+ protected void removeFileImport() {
+ IStructuredSelection selection = (IStructuredSelection) fileViewer
+ .getSelection();
+ NormalSmooksModelPackage modelPackage = getModelPackage();
+ if (modelPackage != null) {
+ modelPackage.getSmooksResourceList().getAbstractResourceConfig()
+ .removeAll(selection.toList());
+ fileViewer.refresh();
+ ((SmooksFormEditor) getEditor()).fireEditorDirty(true);
+ }
+ }
+
+ protected void addFileImport() {
+ IFile[] files = WorkspaceResourceDialog.openFileSelection(getSite()
+ .getShell(), "Select Files", "", false, null,
+ Collections.EMPTY_LIST);
+ if (files != null) {
+ ImportType fileImport = SmooksFactory.eINSTANCE.createImportType();
+ IPath path1 = files[0].getFullPath().removeFirstSegments(1);
+ String s = path1.toString();
+ if(s.startsWith("/") || s.startsWith("\\")){
+
+ }else{
+ s = "/" + s;
+ }
+ fileImport.setFile("classpath:" + s);
+ NormalSmooksModelPackage modelPackage = getModelPackage();
+ if (modelPackage != null) {
+ Command command = AddCommand
+ .create(
+ ((SmooksFormEditor) getEditor())
+ .getEditingDomain(),
+ modelPackage.getSmooksResourceList(),
+ SmooksPackage.eINSTANCE
+ .getSmooksResourceListType_AbstractResourceConfig(),
+ fileImport);
+ ((SmooksFormEditor) getEditor()).getEditingDomain()
+ .getCommandStack().execute(command);
+ fileViewer.refresh();
+ ((SmooksFormEditor) getEditor()).fireEditorDirty(true);
+ }
+ }
+ }
+
private Button createTypeSelectRadioButton(Composite parent,
FormToolkit tool, String labelName) {
Button button = tool.createButton(parent, labelName, SWT.RADIO);
return button;
}
+ private String getWorkspaceFilePath(String filePath) {
+ if (filePath == null)
+ return "";
+ if (filePath.indexOf(":") != -1) {
+ int index = filePath.indexOf(":");
+ return filePath.substring(index + 1, filePath.length());
+ }
+ return filePath;
+ }
+
/**
* @return the modelPackage
*/
@@ -297,9 +572,53 @@
setModelPackage(null);
disableGUI = true;
}
- initTransformTypeResourceConfig();
+ initOtherConfigurationsGUI();
if (resourceBlock != null)
this.resourceBlock.initViewers(transformType);
setGUIStates();
}
+
+ private class FileImportContentProvider implements
+ IStructuredContentProvider {
+
+ public Object[] getElements(Object inputElement) {
+ if (inputElement instanceof List) {
+ return ((List) inputElement).toArray();
+ }
+ return new Object[] {};
+ }
+
+ public void dispose() {
+ }
+
+ public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
+ }
+
+ }
+
+ private class FileImportLabelProvider extends LabelProvider {
+
+ @Override
+ public Image getImage(Object element) {
+ if (element instanceof ImportType) {
+ String path = getWorkspaceFilePath(((ImportType) element)
+ .getFile());
+ IProject project = getCurrentProject();
+ IResource resource = project.findMember(new Path(path));
+ if (resource == null || !resource.exists())
+ return SmooksUIActivator.getDefault().getImageRegistry()
+ .get(SmooksGraphConstants.IMAGE_ERROR);
+ }
+ return super.getImage(element);
+ }
+
+ @Override
+ public String getText(Object element) {
+ if (element instanceof ImportType) {
+ return getWorkspaceFilePath(((ImportType) element).getFile());
+ }
+ return super.getText(element);
+ }
+
+ }
}
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/editors/SmooksResourceConfigFormBlock.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/editors/SmooksResourceConfigFormBlock.java 2008-11-21 07:05:45 UTC (rev 11942)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/editors/SmooksResourceConfigFormBlock.java 2008-11-21 09:11:19 UTC (rev 11943)
@@ -213,6 +213,9 @@
Object element) {
if (element == transformType)
return false;
+ if(!(element instanceof ResourceConfigType)){
+ return false;
+ }
if (modelPackage != null) {
List hidenList = modelPackage.getHidenSmooksElements();
if(hidenList == null) return false;
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/editors/messages.properties
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/editors/messages.properties 2008-11-21 07:05:45 UTC (rev 11942)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/editors/messages.properties 2008-11-21 09:11:19 UTC (rev 11943)
@@ -20,7 +20,7 @@
SmooksGraphicalFormPage.SourceSelectLinkText=Source Select
SmooksGraphicalFormPage.TargetSelectLinkText=Target Select
SmooksNormalContentEditFormPage.ConfigurationPageText=Configuration Page
-SmooksNormalContentEditFormPage.SmooksParseType=Smooks Parse Type
+SmooksNormalContentEditFormPage.SmooksParseType=Other Configurations
SmooksResourceConfigFormBlock.BeanPopulator=BeanPopulator \:
SmooksResourceConfigFormBlock.DateType=Date Type
SmooksResourceConfigFormBlock.DeleteButton=Delete
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/xml/AbstractFileSelectionWizardPage.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/xml/AbstractFileSelectionWizardPage.java 2008-11-21 07:05:45 UTC (rev 11942)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/xml/AbstractFileSelectionWizardPage.java 2008-11-21 09:11:19 UTC (rev 11943)
@@ -154,7 +154,7 @@
protected void openWorkSpaceSelection(Text relationT) {
IFile[] files = WorkspaceResourceDialog.openFileSelection(getShell(),
- "", "", false, null, Collections.EMPTY_LIST); //$NON-NLS-1$ //$NON-NLS-2$
+ "Select Files", "", false, null, Collections.EMPTY_LIST); //$NON-NLS-1$ //$NON-NLS-2$
// dialog.setInitialSelections(selectedResources);
if (files.length > 0) {
IFile file = files[0];
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/xml2java/analyzer/XML2JavaAnalyzer.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/xml2java/analyzer/XML2JavaAnalyzer.java 2008-11-21 07:05:45 UTC (rev 11942)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/xml2java/analyzer/XML2JavaAnalyzer.java 2008-11-21 09:11:19 UTC (rev 11943)
@@ -412,16 +412,8 @@
np.setValue(namespace);
mapping.getProperties().add(np);
}
- // String targetProfile = config.getTargetProfile();
- // if(targetProfile != null){
- // PropertyModel np = new PropertyModel();
- // np.setName("targetProfile");
- // np.setValue(targetProfile);
- // mapping.getProperties().add(np);
- // }
configList.addResourceConfig(config);
- this.setSelectorIsUsed(config.getSelector());
List<ParamType> paramList = config.getParam();
ParamType bindingParam = null;
@@ -449,7 +441,6 @@
SmooksModelUtils.ATTRIBUTE_SELECTOR);
JavaBeanModel childBean = JavaBeanAnalyzer
.findTheChildJavaBeanModel(property, targetJavaBean);
- // PENGXUE
processXMLSelector(configList, config, sourceRoot,
childBean, list, selectorStr, binding);
}
@@ -476,6 +467,7 @@
Messages
.getString("XML2JavaAnalyzer.CantFindNodeErrorMessage1") + newSelector + Messages.getString("XML2JavaAnalyzer.CantFindNodeErrorMessage2")); //$NON-NLS-1$ //$NON-NLS-2$
}
+ this.setSelectorIsUsed(resourceConfig1.getSelector());
createMappingResourceConfigList(configList, listType,
resourceConfig1, newRoot, targetBean);
} else {
17 years, 5 months
JBoss Tools SVN: r11942 - in trunk/esb/plugins: org.jboss.tools.esb.project.ui/icons/wizards and 3 other directories.
by jbosstools-commits@lists.jboss.org
Author: dennyxu
Date: 2008-11-21 02:05:45 -0500 (Fri, 21 Nov 2008)
New Revision: 11942
Added:
trunk/esb/plugins/org.jboss.tools.esb.project.ui/icons/wizards/esb_runtime.gif
Modified:
trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/runtime/JBossRuntimeClassPathInitializer.java
trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/ESBProjectPlugin.java
trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/messages/JBossESBUI.properties
trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/messages/JBossESBUIMessages.java
trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/wizards/pages/JBossESBRuntimeContainerPage.java
Log:
JBIDE-3194: Add ESB runtime classpath container page
Modified: trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/runtime/JBossRuntimeClassPathInitializer.java
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/runtime/JBossRuntimeClassPathInitializer.java 2008-11-21 05:20:39 UTC (rev 11941)
+++ trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/runtime/JBossRuntimeClassPathInitializer.java 2008-11-21 07:05:45 UTC (rev 11942)
@@ -113,6 +113,7 @@
IStatus status = StatusUtils
.errorStatus("Can not find the runtime: " + segment);
ESBProjectCorePlugin.getDefault().getLog().log(status);
+ return new IClasspathEntry[0];
}
String runtimeLocation = serverRuntime.getLocation()
.toOSString();
Added: trunk/esb/plugins/org.jboss.tools.esb.project.ui/icons/wizards/esb_runtime.gif
===================================================================
(Binary files differ)
Property changes on: trunk/esb/plugins/org.jboss.tools.esb.project.ui/icons/wizards/esb_runtime.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Modified: trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/ESBProjectPlugin.java
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/ESBProjectPlugin.java 2008-11-21 05:20:39 UTC (rev 11941)
+++ trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/ESBProjectPlugin.java 2008-11-21 07:05:45 UTC (rev 11942)
@@ -1,5 +1,6 @@
package org.jboss.tools.esb.project.ui;
+import org.eclipse.swt.graphics.Image;
import org.eclipse.ui.plugin.AbstractUIPlugin;
import org.osgi.framework.BundleContext;
@@ -27,6 +28,8 @@
public void start(BundleContext context) throws Exception {
super.start(context);
plugin = this;
+ Image img = imageDescriptorFromPlugin(PLUGIN_ID, "icons/wizards/esb_runtime.gif").createImage();
+ getImageRegistry().put("esb_runtime", img);
}
/*
Modified: trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/messages/JBossESBUI.properties
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/messages/JBossESBUI.properties 2008-11-21 05:20:39 UTC (rev 11941)
+++ trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/messages/JBossESBUI.properties 2008-11-21 07:05:45 UTC (rev 11942)
@@ -24,6 +24,13 @@
JBoss_Runtime_List_Field_Editor_Home_Folder=Home Folder:
JBoss_Composite_Editor_This_Method_Can_Be_Invoked=This method can be invoked after getEditorControls(parent) only
JBoss_Button_Field_Editor_Browse=Browse...
+JBoss_ESBRuntime_Classpath_Container_5=esb_runtime
+JBoss_ESBRuntime_Classpath_Container_Description=Select a ESB runtime to add to the project classpath
+JBoss_ESBRuntime_Classpath_Container_Name=Name
+JBoss_ESBRuntime_Classpath_Container_RuntimeType=Runtime Type
+JBoss_ESBRuntime_Classpath_Container_RuntimeType_ESBLibrariesOnly=ESB Libraries Only
+JBoss_ESBRuntime_Classpath_Container_RuntimeType_ServerContained=Server Contained
+JBoss_ESBRuntime_Classpath_Container_Title=JBoss ESB Library
Error_JBoss_Button_Field_Editor_Not_Implemented_Yet=Not implemented yet. Please setup real acion for editor.
JBoss_SWT_Field_Editor_Factory_Browse=Browse...
JBoss_SWT_Field_Editor_Factory_Select_Home_Folder=Select JBoss ESB runtime Home Folder
Modified: trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/messages/JBossESBUIMessages.java
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/messages/JBossESBUIMessages.java 2008-11-21 05:20:39 UTC (rev 11941)
+++ trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/messages/JBossESBUIMessages.java 2008-11-21 07:05:45 UTC (rev 11942)
@@ -51,6 +51,20 @@
public static String JBoss_Runtime_List_Field_Editor_Home_Folder;
public static String JBoss_Composite_Editor_This_Method_Can_Be_Invoked;
public static String JBoss_Button_Field_Editor_Browse;
+ public static String JBoss_ESBRuntime_Classpath_Container_5;
+
+ public static String JBoss_ESBRuntime_Classpath_Container_Description;
+
+ public static String JBoss_ESBRuntime_Classpath_Container_Name;
+
+ public static String JBoss_ESBRuntime_Classpath_Container_RuntimeType;
+
+ public static String JBoss_ESBRuntime_Classpath_Container_RuntimeType_ESBLibrariesOnly;
+
+ public static String JBoss_ESBRuntime_Classpath_Container_RuntimeType_ServerContained;
+
+ public static String JBoss_ESBRuntime_Classpath_Container_Title;
+
public static String Error_JBoss_Button_Field_Editor_Not_Implemented_Yet;
public static String JBoss_SWT_Field_Editor_Factory_Browse;
public static String JBoss_SWT_Field_Editor_Factory_Select_Home_Folder;
Modified: trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/wizards/pages/JBossESBRuntimeContainerPage.java
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/wizards/pages/JBossESBRuntimeContainerPage.java 2008-11-21 05:20:39 UTC (rev 11941)
+++ trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/wizards/pages/JBossESBRuntimeContainerPage.java 2008-11-21 07:05:45 UTC (rev 11942)
@@ -3,7 +3,6 @@
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
-import java.util.Set;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Path;
@@ -12,7 +11,6 @@
import org.eclipse.jdt.ui.wizards.IClasspathContainerPage;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.viewers.ArrayContentProvider;
-import org.eclipse.jface.viewers.ColumnLayoutData;
import org.eclipse.jface.viewers.ColumnWeightData;
import org.eclipse.jface.viewers.ILabelProvider;
import org.eclipse.jface.viewers.ILabelProviderListener;
@@ -23,9 +21,10 @@
import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.jface.viewers.TableLayout;
import org.eclipse.jface.viewers.TableViewer;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.jface.viewers.ViewerFilter;
import org.eclipse.jface.wizard.WizardPage;
import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
@@ -38,6 +37,8 @@
import org.jboss.tools.esb.core.runtime.JBossRuntime;
import org.jboss.tools.esb.core.runtime.JBossRuntimeClassPathInitializer;
import org.jboss.tools.esb.core.runtime.JBossRuntimeManager;
+import org.jboss.tools.esb.project.ui.ESBProjectPlugin;
+import org.jboss.tools.esb.project.ui.messages.JBossESBUIMessages;
public class JBossESBRuntimeContainerPage extends WizardPage implements
IClasspathContainerPage {
@@ -47,9 +48,9 @@
private Object selectedRuntime;
public JBossESBRuntimeContainerPage(){
- super("JBoss ESB Runtime Library");
- setTitle("JBoss ESB Library");
- setDescription("Select a ESB runtime to add to the project classpath");
+ super(JBossESBUIMessages.JBoss_ESBRuntime_Classpath_Container_Title);
+ setTitle(JBossESBUIMessages.JBoss_ESBRuntime_Classpath_Container_Title);
+ setDescription(JBossESBUIMessages.JBoss_ESBRuntime_Classpath_Container_Description);
}
public JBossESBRuntimeContainerPage(String pageName) {
@@ -78,16 +79,17 @@
setPageComplete(isPageComplete());
}});
+ runtimeViewer.addFilter(new ESBRuntimeFilter());
TableLayout tablelayout = new TableLayout();
table.setLayout(tablelayout);
tablelayout.addColumnData(new ColumnWeightData(60));
TableColumn tc1 = new TableColumn(table, SWT.NONE);
- tc1.setText("Name");
+ tc1.setText(JBossESBUIMessages.JBoss_ESBRuntime_Classpath_Container_Name);
tablelayout.addColumnData(new ColumnWeightData(40));
TableColumn tc2 = new TableColumn(table, SWT.NONE);
- tc2.setText("Runtime Type");
+ tc2.setText(JBossESBUIMessages.JBoss_ESBRuntime_Classpath_Container_RuntimeType);
tc1.pack();
tc2.pack();
@@ -123,7 +125,6 @@
public void setSelection(IClasspathEntry containerEntry) {
entry = containerEntry;
- System.out.print(containerEntry);
}
private List getAllAvailableESBRuntimes(){
@@ -147,7 +148,19 @@
return selectedRuntime != null;
}
+ class ESBRuntimeFilter extends ViewerFilter{
+ @Override
+ public boolean select(Viewer viewer, Object parentElement,
+ Object element) {
+ if(element instanceof IRuntime){
+ IPath location = ((IRuntime)element).getLocation();
+ return JBossRuntimeManager.isValidESBServer(location.toOSString());
+ }
+ return true;
+ }
+
+ }
class RuntimeLabelProvider implements ITableLabelProvider{
@@ -157,6 +170,8 @@
if(columnIndex == 0){
if(element instanceof IRuntime){
return serverLabel.getImage(element);
+ }else{
+ return ESBProjectPlugin.getDefault().getImageRegistry().get(JBossESBUIMessages.JBoss_ESBRuntime_Classpath_Container_5);
}
}
return null;
@@ -173,9 +188,9 @@
break;
case 1:
if(element instanceof IRuntime){
- return "Server contained";
+ return JBossESBUIMessages.JBoss_ESBRuntime_Classpath_Container_RuntimeType_ServerContained;
}else if(element instanceof JBossRuntime){
- return "ESB Runtime Only";
+ return JBossESBUIMessages.JBoss_ESBRuntime_Classpath_Container_RuntimeType_ESBLibrariesOnly;
}
break;
}
17 years, 5 months
JBoss Tools SVN: r11941 - trunk/i18n.
by jbosstools-commits@lists.jboss.org
Author: sflanigan
Date: 2008-11-21 00:20:39 -0500 (Fri, 21 Nov 2008)
New Revision: 11941
Modified:
trunk/i18n/build.xml
Log:
Fixed property expansions in feature.xml
Modified: trunk/i18n/build.xml
===================================================================
--- trunk/i18n/build.xml 2008-11-21 04:40:50 UTC (rev 11940)
+++ trunk/i18n/build.xml 2008-11-21 05:20:39 UTC (rev 11941)
@@ -266,6 +266,18 @@
<!-- TODO avoid property override if possible -->
<propertycopy override="true" property="localename" from="NAME_@{locale}"/>
+ <echo append="true" file="${temp.file.sitefeatures}"
+ message="<feature url="features/${feature}.nl-(a){locale}_${PLUGIN_VERSION}.jar"
+ id="${feature}.nl-@{locale}" version="${PLUGIN_VERSION}">
+ <category name="JBoss Tools Localization (${localename})"/>
+ </feature>" />
+ <!-- demunged, that looks like:
+ <feature url="features/${feature}.nl-(a){locale}_${PLUGIN_VERSION}.jar"
+ id="${feature}.nl-@{locale}" version="${PLUGIN_VERSION}">
+ <category name="JBoss Tools Localization (${localename})"/>
+ </feature>
+ -->
+
<!-- TODO remove third-party dependency -->
<xpath
file="@{featurexml}"
@@ -309,20 +321,10 @@
<loadfile property="plugins" srcFile="${temp.file.featureplugins}"/>
<delete file="${temp.file.featureplugins}"/>
-
- <echo append="true" file="${temp.file.sitefeatures}"
- message="<feature url="features/${feature}.nl-(a){locale}_${PLUGIN_VERSION}.jar"
- id="${feature}.nl-@{locale}" version="${PLUGIN_VERSION}">
- <category name="JBoss Tools Localization (${localename})"/>
- </feature>" />
- <!-- demunged, that looks like:
- <feature url="features/${feature}.nl-(a){locale}_${PLUGIN_VERSION}.jar"
- id="${feature}.nl-@{locale}" version="${PLUGIN_VERSION}">
- <category name="JBoss Tools Localization (${localename})"/>
- </feature>
- -->
-
<!-- TODO add download-size="${jarsize}" install-size="${jarsize}" -->
+ <!-- TODO avoid these vars if possible -->
+ <var name="featurename" value="${feature}" />
+ <var name="locale" value="@{locale}" />
<copy overwrite="true"
todir="${propdir}/features/${feature}.nl-@{locale}_${PLUGIN_VERSION}">
<fileset dir="feature-template/FEATURE.nl-LOCALE_VERSION" />
17 years, 5 months
JBoss Tools SVN: r11940 - trunk/i18n.
by jbosstools-commits@lists.jboss.org
Author: sflanigan
Date: 2008-11-20 23:40:50 -0500 (Thu, 20 Nov 2008)
New Revision: 11940
Modified:
trunk/i18n/build.xml
Log:
Downgraded several fixmes to todos; inlined the -jar task.
Modified: trunk/i18n/build.xml
===================================================================
--- trunk/i18n/build.xml 2008-11-21 03:46:24 UTC (rev 11939)
+++ trunk/i18n/build.xml 2008-11-21 04:40:50 UTC (rev 11940)
@@ -165,7 +165,7 @@
<attribute name="propname" />
<sequential>
<if>
- <!-- FIXME fail on empty value -->
+ <!-- TODO fail on empty value -->
<not>
<isset property="@{propname}"/>
</not>
@@ -179,7 +179,6 @@
<!-- Processes the generated props directory, one plugin at a time,
generating manifests and jars -->
<target name="plugins" depends="init" description="Generate fragment manifests and jars for langpack plugins">
- <delete dir="target/manifests" />
<delete dir="${jardir}/plugins" />
<mkdir dir="${jardir}/plugins" />
<for param="plugindir">
@@ -188,55 +187,50 @@
</path>
<sequential>
<echo message="@{plugindir}" />
- <!-- FIXME -->
+ <!-- TODO avoid property override if possible -->
<propertyregex override="true" property="plugin"
input="@{plugindir}"
regexp="^${propdir}[/\\][^/\\]+[/\\]([^/\\]+).*"
select="\1" />
<checkprop propname="plugin"/>
<echo level="verbose" message="@{plugindir} contains props for plugin ${plugin}"/>
- <antcall target="-jar">
- <param name="plugin" value="${plugin}"/>
- <param name="plugindir" value="@{plugindir}"/>
- </antcall>
- </sequential>
- </for>
- </target>
+ <checkprop propname="PLUGIN_VERSION"/>
+ <checkprop propname="PLUGIN_VENDOR"/>
+
+ <for param="locale" list="${locales}">
+ <sequential>
+ <!-- TODO avoid property override if possible -->
+ <propertycopy override="true" property="localename" from="NAME_@{locale}"/>
+ <checkprop propname="localename"/>
- <!-- Jars up one fragment plugin. -->
- <target name="-jar">
- <!-- NB don't depend on initTaskDefs here, or ant loads the
- classes over and over until it exhausts memory -->
- <checkprop propname="plugindir"/>
- <checkprop propname="plugin"/>
- <checkprop propname="PLUGIN_VERSION"/>
- <checkprop propname="PLUGIN_VENDOR"/>
-
- <for param="locale" list="${locales}">
- <sequential>
- <!-- FIXME -->
- <propertycopy override="true" property="localename" from="NAME_@{locale}"/>
- <checkprop propname="localename"/>
-
- <jar
- destfile="${jardir}/plugins/${plugin}.nl-(a){locale}_${PLUGIN_VERSION}.jar"
- update="no"
- basedir="${plugindir}"
- duplicate="fail"
- includes="**/*_(a){locale}.properties">
- <manifest>
- <attribute name="Manifest-Version" value="1.0"/>
- <attribute name="Created-By" value="JBoss Tools i18n (build.xml)"/>
- <attribute name="Bundle-Name" value="${plugin} ${localename} NLS Support"/>
- <attribute name="Bundle-SymbolicName" value="${plugin}.nl_@{locale} ;singleton=true"/>
- <attribute name="Bundle-Version" value="${PLUGIN_VERSION}"/>
- <attribute name="Bundle-Vendor" value="${PLUGIN_VENDOR}"/>
- <attribute name="Fragment-Host" value="${plugin};bundle-version="[0.0.0,9.9.9)""/>
- </manifest>
- </jar>
+ <!-- Jars up one fragment plugin. -->
+ <jar
+ destfile="${jardir}/plugins/${plugin}.nl-(a){locale}_${PLUGIN_VERSION}.jar"
+ update="no"
+ basedir="@{plugindir}"
+ duplicate="fail"
+ includes="**/*_(a){locale}.properties">
+ <manifest>
+ <attribute name="Manifest-Version"
+ value="1.0"/>
+ <attribute name="Created-By"
+ value="JBoss Tools i18n (build.xml)"/>
+ <attribute name="Bundle-Name"
+ value="${plugin} ${localename} NLS Support"/>
+ <attribute name="Bundle-SymbolicName"
+ value="${plugin}.nl_@{locale} ;singleton=true"/>
+ <attribute name="Bundle-Version"
+ value="${PLUGIN_VERSION}"/>
+ <attribute name="Bundle-Vendor"
+ value="${PLUGIN_VENDOR}"/>
+ <attribute name="Fragment-Host"
+ value="${plugin};bundle-version="[0.0.0,9.9.9)""/>
+ </manifest>
+ </jar>
+ </sequential>
+ </for>
</sequential>
</for>
-
</target>
<target name="features" depends="init"
@@ -258,7 +252,7 @@
<fileset dir="${jbt.srcdir}" includes="*/features/*/feature.xml"/>
</path>
<sequential>
- <!-- FIXME -->
+ <!-- TODO avoid property override if possible -->
<propertyregex
override="true"
property="feature"
@@ -266,27 +260,25 @@
regexp="^${jbt.srcdir}[/\\][^/\\]+[/\\]features[/\\]([^/\\]+)[/\\]feature.xml"
select="\1" />
<checkprop propname="feature"/>
- <!-- FIXME -->
- <var name="jarsize" value="0" />
<echo level="verbose" message="Processing feature ${feature}"/>
<for param="locale" list="${locales}">
<sequential>
- <!-- FIXME -->
- <var name="locale" value="@{locale}" />
+ <!-- TODO avoid property override if possible -->
<propertycopy override="true" property="localename" from="NAME_@{locale}"/>
+ <!-- TODO remove third-party dependency -->
<xpath
file="@{featurexml}"
expression="/feature/plugin/@id"
delimiter=" "
outputproperty="feature.${feature}.plugins"/>
+ <!-- TODO avoid property override if possible -->
<propertycopy
override="true"
property="plugins"
from="feature.${feature}.plugins"/>
-
- <!-- FIXME -->
+ <!-- FIXME var temp.file.featureplugins (list of plugins in feature-locale) -->
<var name="temp.file.featureplugins" unset="true" />
<tempfile
property="temp.file.featureplugins"
@@ -299,20 +291,20 @@
<sequential>
<if>
<available
- file="${jardir}/plugins/(a){plugin}.nl-${locale}_${PLUGIN_VERSION}.jar" />
+ file="${jardir}/plugins/@{plugin}.nl-(a){locale}_${PLUGIN_VERSION}.jar" />
<then>
<echo
append="true"
file="${temp.file.featureplugins}"
message="<plugin
- id="(a){plugin}.nl-${locale}"
+ id="@{plugin}.nl-(a){locale}"
fragment="true" unpack="false"
version="${PLUGIN_VERSION}" />" />
</then>
</if>
</sequential>
</for>
- <!-- FIXME -->
+ <!-- FIXME var plugins (loading list of plugins in feature-locale) -->
<var name="plugins" unset="true" />
<loadfile property="plugins" srcFile="${temp.file.featureplugins}"/>
<delete file="${temp.file.featureplugins}"/>
@@ -326,11 +318,11 @@
<!-- demunged, that looks like:
<feature url="features/${feature}.nl-(a){locale}_${PLUGIN_VERSION}.jar"
id="${feature}.nl-@{locale}" version="${PLUGIN_VERSION}">
- <category name="JBoss Tools Localization"/>
+ <category name="JBoss Tools Localization (${localename})"/>
</feature>
-->
- <!-- FIXME download-size="${jarsize}" install-size="${jarsize}" -->
+ <!-- TODO add download-size="${jarsize}" install-size="${jarsize}" -->
<copy overwrite="true"
todir="${propdir}/features/${feature}.nl-@{locale}_${PLUGIN_VERSION}">
<fileset dir="feature-template/FEATURE.nl-LOCALE_VERSION" />
@@ -353,6 +345,7 @@
-->
<for param="locale" list="${locales}">
<sequential>
+ <!-- TODO avoid property override if possible -->
<propertycopy override="true" property="localename" from="NAME_@{locale}"/>
<echo append="true" file="${temp.file.sitefeatures}"
message="<category-def name="JBoss Tools Localization (${localename})" label="JBoss Tools Localization (${localename})"/>" />
@@ -366,7 +359,7 @@
<!-- Read in the above list of features -->
- <!-- FIXME -->
+ <!-- FIXME var features (loading list of features) -->
<var name="features" unset="true" />
<loadfile property="features" srcFile="${temp.file.sitefeatures}"/>
<delete file="${temp.file.sitefeatures}"/>
17 years, 5 months
JBoss Tools SVN: r11939 - trunk/i18n.
by jbosstools-commits@lists.jboss.org
Author: sflanigan
Date: 2008-11-20 22:46:24 -0500 (Thu, 20 Nov 2008)
New Revision: 11939
Modified:
trunk/i18n/build.xml
Log:
Tidied up some fixmes and formatting
Modified: trunk/i18n/build.xml
===================================================================
--- trunk/i18n/build.xml 2008-11-21 03:30:58 UTC (rev 11938)
+++ trunk/i18n/build.xml 2008-11-21 03:46:24 UTC (rev 11939)
@@ -218,18 +218,15 @@
<propertycopy override="true" property="localename" from="NAME_@{locale}"/>
<checkprop propname="localename"/>
- <!-- FIXME -->
- <var name="jar" value="${jardir}/plugins/${plugin}.nl-(a){locale}_${PLUGIN_VERSION}.jar" />
- <echo level="verbose" message="Jarring up ${jar} from directory ${plugindir}"/>
<jar
- destfile="${jar}"
+ destfile="${jardir}/plugins/${plugin}.nl-(a){locale}_${PLUGIN_VERSION}.jar"
update="no"
basedir="${plugindir}"
duplicate="fail"
includes="**/*_(a){locale}.properties">
<manifest>
<attribute name="Manifest-Version" value="1.0"/>
- <attribute name="Created-By" value="JBoss Tools i18n build.xml"/>
+ <attribute name="Created-By" value="JBoss Tools i18n (build.xml)"/>
<attribute name="Bundle-Name" value="${plugin} ${localename} NLS Support"/>
<attribute name="Bundle-SymbolicName" value="${plugin}.nl_@{locale} ;singleton=true"/>
<attribute name="Bundle-Version" value="${PLUGIN_VERSION}"/>
@@ -248,9 +245,13 @@
<mkdir dir="${propdir}/features" />
<delete dir="${jardir}/features" />
<mkdir dir="${jardir}/features" />
- <!-- FIXME -->
- <var name="temp.file.sitefeatures" unset="true" />
- <tempfile property="temp.file.sitefeatures" destdir="${target.dir}" prefix="site" suffix=".tmp" createfile="true" deleteonexit="false" />
+ <tempfile
+ property="temp.file.sitefeatures"
+ destdir="${target.dir}"
+ prefix="site"
+ suffix=".tmp"
+ createfile="true"
+ deleteonexit="false" />
<sequential>
<for param="featurexml">
<path>
@@ -258,78 +259,91 @@
</path>
<sequential>
<!-- FIXME -->
- <propertyregex override="true" property="feature"
+ <propertyregex
+ override="true"
+ property="feature"
input="@{featurexml}"
- regexp="^${jbt.srcdir}${file.separator}[^/\\]+${file.separator}features${file.separator}([^/\\]+)${file.separator}feature.xml"
+ regexp="^${jbt.srcdir}[/\\][^/\\]+[/\\]features[/\\]([^/\\]+)[/\\]feature.xml"
select="\1" />
<checkprop propname="feature"/>
<!-- FIXME -->
- <var name="featurename" value="${feature}" />
<var name="jarsize" value="0" />
<echo level="verbose" message="Processing feature ${feature}"/>
- <for param="locale" list="${locales}">
- <sequential>
- <!-- FIXME -->
- <var name="locale" value="@{locale}" />
- <propertycopy override="true" property="localename" from="NAME_@{locale}"/>
-
- <xpath
- file="@{featurexml}"
- expression="/feature/plugin/@id"
- delimiter=" "
- outputproperty="feature.${feature}.plugins"/>
- <propertycopy override="true" property="plugins" from="feature.${feature}.plugins"/>
-
-
- <!-- FIXME -->
- <var name="temp.file.featureplugins" unset="true" />
- <tempfile property="temp.file.featureplugins" destdir="${target.dir}" prefix="plugins" suffix=".tmp" createfile="true" deleteonexit="true" />
- <for param="plugin" list="${plugins}" delimiter=" ">
- <sequential>
- <if>
- <available file="${jardir}/plugins/(a){plugin}.nl-${locale}_${PLUGIN_VERSION}.jar" />
- <then>
- <echo append="true" file="${temp.file.featureplugins}"
- message="<plugin
- id="(a){plugin}.nl-${locale}"
- fragment="true" unpack="false"
- version="${PLUGIN_VERSION}" />" />
- </then>
- </if>
- </sequential>
- </for>
- <!-- FIXME -->
- <var name="plugins" unset="true" />
- <loadfile property="plugins" srcFile="${temp.file.featureplugins}"/>
- <delete file="${temp.file.featureplugins}"/>
+ <for param="locale" list="${locales}">
+ <sequential>
+ <!-- FIXME -->
+ <var name="locale" value="@{locale}" />
+ <propertycopy override="true" property="localename" from="NAME_@{locale}"/>
+
+ <xpath
+ file="@{featurexml}"
+ expression="/feature/plugin/@id"
+ delimiter=" "
+ outputproperty="feature.${feature}.plugins"/>
+ <propertycopy
+ override="true"
+ property="plugins"
+ from="feature.${feature}.plugins"/>
+
+
+ <!-- FIXME -->
+ <var name="temp.file.featureplugins" unset="true" />
+ <tempfile
+ property="temp.file.featureplugins"
+ destdir="${target.dir}"
+ prefix="plugins"
+ suffix=".tmp"
+ createfile="true"
+ deleteonexit="true" />
+ <for param="plugin" list="${plugins}" delimiter=" ">
+ <sequential>
+ <if>
+ <available
+ file="${jardir}/plugins/(a){plugin}.nl-${locale}_${PLUGIN_VERSION}.jar" />
+ <then>
+ <echo
+ append="true"
+ file="${temp.file.featureplugins}"
+ message="<plugin
+ id="(a){plugin}.nl-${locale}"
+ fragment="true" unpack="false"
+ version="${PLUGIN_VERSION}" />" />
+ </then>
+ </if>
+ </sequential>
+ </for>
+ <!-- FIXME -->
+ <var name="plugins" unset="true" />
+ <loadfile property="plugins" srcFile="${temp.file.featureplugins}"/>
+ <delete file="${temp.file.featureplugins}"/>
-
- <echo append="true" file="${temp.file.sitefeatures}"
- message="<feature url="features/${feature}.nl-(a){locale}_${PLUGIN_VERSION}.jar"
- id="${feature}.nl-@{locale}" version="${PLUGIN_VERSION}">
- <category name="JBoss Tools Localization (${localename})"/>
- </feature>" />
- <!-- demunged, that looks like:
- <feature url="features/${feature}.nl-(a){locale}_${PLUGIN_VERSION}.jar"
- id="${feature}.nl-@{locale}" version="${PLUGIN_VERSION}">
- <category name="JBoss Tools Localization"/>
- </feature>
- -->
-
- <!-- FIXME download-size="${jarsize}" install-size="${jarsize}" -->
- <copy overwrite="true"
- todir="${propdir}/features/${feature}.nl-@{locale}_${PLUGIN_VERSION}">
- <fileset dir="feature-template/FEATURE.nl-LOCALE_VERSION" />
- <filterchain>
- <expandproperties/>
- </filterchain>
- </copy>
- <jar destfile="${jardir}/features/${feature}.nl-(a){locale}_${PLUGIN_VERSION}.jar"
- basedir="${propdir}/features/${feature}.nl-@{locale}_${PLUGIN_VERSION}" />
- <!-- might want to keep around for debugging: -->
- <delete dir="${propdir}/features/${feature}.nl-@{locale}_${PLUGIN_VERSION}" />
- </sequential>
- </for>
+
+ <echo append="true" file="${temp.file.sitefeatures}"
+ message="<feature url="features/${feature}.nl-(a){locale}_${PLUGIN_VERSION}.jar"
+ id="${feature}.nl-@{locale}" version="${PLUGIN_VERSION}">
+ <category name="JBoss Tools Localization (${localename})"/>
+ </feature>" />
+ <!-- demunged, that looks like:
+ <feature url="features/${feature}.nl-(a){locale}_${PLUGIN_VERSION}.jar"
+ id="${feature}.nl-@{locale}" version="${PLUGIN_VERSION}">
+ <category name="JBoss Tools Localization"/>
+ </feature>
+ -->
+
+ <!-- FIXME download-size="${jarsize}" install-size="${jarsize}" -->
+ <copy overwrite="true"
+ todir="${propdir}/features/${feature}.nl-@{locale}_${PLUGIN_VERSION}">
+ <fileset dir="feature-template/FEATURE.nl-LOCALE_VERSION" />
+ <filterchain>
+ <expandproperties/>
+ </filterchain>
+ </copy>
+ <jar destfile="${jardir}/features/${feature}.nl-(a){locale}_${PLUGIN_VERSION}.jar"
+ basedir="${propdir}/features/${feature}.nl-@{locale}_${PLUGIN_VERSION}" />
+ <!-- might want to keep around for debugging: -->
+ <delete dir="${propdir}/features/${feature}.nl-@{locale}_${PLUGIN_VERSION}" />
+ </sequential>
+ </for>
</sequential>
</for>
</sequential>
17 years, 5 months
JBoss Tools SVN: r11938 - trunk/i18n.
by jbosstools-commits@lists.jboss.org
Author: sflanigan
Date: 2008-11-20 22:30:58 -0500 (Thu, 20 Nov 2008)
New Revision: 11938
Removed:
trunk/i18n/plugin-template.mf
Modified:
trunk/i18n/build.xml
Log:
Refactored plugin generation to use one pass; inlined manifest to be part of the jar task; removed generation of zip files.
Modified: trunk/i18n/build.xml
===================================================================
--- trunk/i18n/build.xml 2008-11-21 02:11:55 UTC (rev 11937)
+++ trunk/i18n/build.xml 2008-11-21 03:30:58 UTC (rev 11938)
@@ -81,6 +81,10 @@
<echo message="| |__ ${echo.dependency.classpath}" />
</target>
+ <target name="cleanpot" description="Remove all pot files">
+ <delete dir="po" includes="**/*.pot" />
+ </target>
+
<target name="clean" description="Remove generated files">
<!-- obsolete dirs -->
<delete dir="target/pot" />
@@ -98,48 +102,37 @@
<target name="prop2pot" depends="init"
description="Extract translation templates (POT) from the JBoss Tools English properties files">
- <for param="moduledir" >
- <path>
- <dirset dir="${jbt.srcdir}" includes="*" excludes="i18n,.*" />
- </path>
- <sequential>
- <!-- FIXME create BundleNameMapper -->
- <propertyregex override="true" property="module"
- input="@{moduledir}"
- regexp="^${jbt.srcdir}${file.separator}([^/\\]+).*"
- select="\1" />
- <checkprop propname="module"/>
- <echo message="module=${module}" />
-
- <!-- paths under jbt.srcdir look like: ${module}/plugins/${plugin}/{src,main,...} -->
- <!-- FIXME includes should be just plugins/*/src/**/*.properties.
- See https://jira.jboss.org/jira/browse/JBIDE-2972 includes="plugins/*/*/**/*.properties" -->
- <prop2pot srcDir="@{moduledir}" dstDir="po/${module}" includes="plugins/*/src/**/*.properties" >
- <!-- next two are Maven style, not currently used in JBT: -->
+ <!-- paths under jbt.srcdir look like: ${module}/plugins/${plugin}/{src,main,...} -->
+ <!-- TODO includes should be just plugins/*/src/**/*.properties.
+ See https://jira.jboss.org/jira/browse/JBIDE-2972 includes="plugins/*/*/**/*.properties" -->
+ <prop2pot srcDir="${jbt.srcdir}" dstDir="po" includes="*/plugins/*/src/**/*.properties" >
+ <!-- next two are Maven style, not currently used in JBT: -->
<!--
- <fileset erroronmissingdir="false" dir="${plugindir}/src/main/java"/>
- <fileset erroronmissingdir="false" dir="${plugindir}/src/main/resources"/>
-
- <fileset erroronmissingdir="false" dir="${plugindir}/src/main" excludes="java,resources"/>
- <fileset erroronmissingdir="false" dir="${plugindir}/src" excludes="main"/>
- <fileset erroronmissingdir="false" dir="${plugindir}/jbosscore"/>
- <fileset erroronmissingdir="false" dir="${plugindir}/jbossui"/>
- <fileset erroronmissingdir="false" dir="${plugindir}/resources"/>
- <fileset erroronmissingdir="false" dir="${plugindir}/template-src"/>
- //<fileset dir="${plugindir}/templates"/>
+ <fileset erroronmissingdir="false" dir="${plugindir}/src/main/java"/>
+ <fileset erroronmissingdir="false" dir="${plugindir}/src/main/resources"/>
+
+ <fileset erroronmissingdir="false" dir="${plugindir}/src/main" excludes="java,resources"/>
+ <fileset erroronmissingdir="false" dir="${plugindir}/src" excludes="main"/>
+ <fileset erroronmissingdir="false" dir="${plugindir}/jbosscore"/>
+ <fileset erroronmissingdir="false" dir="${plugindir}/jbossui"/>
+ <fileset erroronmissingdir="false" dir="${plugindir}/resources"/>
+ <fileset erroronmissingdir="false" dir="${plugindir}/template-src"/>
+ //<fileset dir="${plugindir}/templates"/>
-->
- <!-- rename to pluginID-org.jboss.ide.*/org.jboss.ide.*.pot -->
- <chainedmapper>
- <regexpmapper handledirsep="true" from="^plugins/([^/]+)/[^/]+/(.*)[.]properties$$" to="\1-\2~\2.pot" />
- <filtermapper>
- <!-- org/jboss/ide/* -> org.jboss.ide.* -->
- <replacestring from="${file.separator}" to="."/>
- <replacestring from="~" to="/"/>
- </filtermapper>
- </chainedmapper>
- </prop2pot>
- </sequential>
- </for>
+ <chainedmapper>
+ <!-- rename to module~pluginID-org.jboss.ide.*~org.jboss.ide.*.pot -->
+ <regexpmapper
+ handledirsep="true"
+ from="^([^/]+)/plugins/([^/]+)/[^/]+/(.*)[.]properties$$"
+ to="\1~\2-\3~\3.pot" />
+ <filtermapper>
+ <!-- org/jboss/ide/* -> org.jboss.ide.* -->
+ <replacestring from="${file.separator}" to="."/>
+ <!-- rename to module/pluginID-org.jboss.ide.*/org.jboss.ide.*.pot -->
+ <replacestring from="~" to="/"/>
+ </filtermapper>
+ </chainedmapper>
+ </prop2pot>
</target>
<!-- autogenerated "translations" -->
@@ -182,79 +175,36 @@
</if>
</sequential>
</macrodef>
-
- <!-- = = = = = = = = = = = = = = = = =
- macrodef: processlocaleplugins
- = = = = = = = = = = = = = = = = = -->
- <macrodef name="processlocaleplugins">
- <attribute name="rootdir" />
- <attribute name="task" />
- <sequential>
- <for param="plugindir">
- <path>
- <dirset dir="@{rootdir}" includes="*/*" />
- </path>
- <sequential>
- <!-- FIXME -->
- <propertyregex override="true" property="plugin"
- input="@{plugindir}"
- regexp="^(a){rootdir}[/\\][^/\\]+[/\\]([^/\\]+).*"
- select="\1" />
- <checkprop propname="plugin"/>
- <echo level="verbose" message="@{plugindir} contains props for plugin ${plugin}"/>
- <antcall target="@{task}">
- <param name="plugin" value="${plugin}"/>
- <param name="plugindir" value="@{plugindir}"/>
- </antcall>
- </sequential>
- </for>
- </sequential>
- </macrodef>
-
+
<!-- Processes the generated props directory, one plugin at a time,
- generating manifests -->
- <target name="manifests" depends="init" description="Generate fragment plugin manifests for langpack plugins">
+ generating manifests and jars -->
+ <target name="plugins" depends="init" description="Generate fragment manifests and jars for langpack plugins">
<delete dir="target/manifests" />
- <processlocaleplugins rootdir="${propdir}" task="-manifest" />
- </target>
-
-
- <!-- Generates the manifests (one per locale) for one plugin. Called by processlocaleplugins. -->
- <target name="-manifest">
- <!-- NB don't depend on initTaskDefs here, or ant loads the
- classes over and over until it exhausts memory -->
- <checkprop propname="plugindir"/>
- <checkprop propname="plugin"/>
- <checkprop propname="PLUGIN_VERSION"/>
- <checkprop propname="PLUGIN_VENDOR"/>
- <for param="locale" list="${locales}">
+ <delete dir="${jardir}/plugins" />
+ <mkdir dir="${jardir}/plugins" />
+ <for param="plugindir">
+ <path>
+ <dirset dir="${propdir}" includes="*/*" />
+ </path>
<sequential>
+ <echo message="@{plugindir}" />
<!-- FIXME -->
- <var name="locale" value="@{locale}" />
- <propertycopy override="true" property="localename" from="NAME_${locale}"/>
- <checkprop propname="localename"/>
- <copy overwrite="true" file="plugin-template.mf" tofile="target/manifests/${plugin}/${locale}">
- <filterchain>
- <expandproperties/>
- </filterchain>
- </copy>
-<!-- for debug output:
- <concat><filelist files="target/manifests/${plugin}/${locale}"></filelist></concat>
--->
+ <propertyregex override="true" property="plugin"
+ input="@{plugindir}"
+ regexp="^${propdir}[/\\][^/\\]+[/\\]([^/\\]+).*"
+ select="\1" />
+ <checkprop propname="plugin"/>
+ <echo level="verbose" message="@{plugindir} contains props for plugin ${plugin}"/>
+ <antcall target="-jar">
+ <param name="plugin" value="${plugin}"/>
+ <param name="plugindir" value="@{plugindir}"/>
+ </antcall>
</sequential>
</for>
</target>
- <!-- Processes the generated props directory, one plugin at a time,
- generating plugin jars from the props and manifest -->
- <target name="fragments" depends="init" description="Generate fragment plugin jars to contain translations" >
- <delete dir="${jardir}" />
- <mkdir dir="${jardir}/plugins" />
- <processlocaleplugins rootdir="${propdir}" task="-fragment" />
- </target>
-
- <!-- Jars up one fragment plugin. Called by processlocaleplugins. -->
- <target name="-fragment">
+ <!-- Jars up one fragment plugin. -->
+ <target name="-jar">
<!-- NB don't depend on initTaskDefs here, or ant loads the
classes over and over until it exhausts memory -->
<checkprop propname="plugindir"/>
@@ -265,7 +215,6 @@
<for param="locale" list="${locales}">
<sequential>
<!-- FIXME -->
- <var name="__locale" value="@{locale}" />
<propertycopy override="true" property="localename" from="NAME_@{locale}"/>
<checkprop propname="localename"/>
@@ -277,8 +226,16 @@
update="no"
basedir="${plugindir}"
duplicate="fail"
- includes="**/*_(a){locale}.properties"
- manifest="target/manifests/${plugin}/@{locale}">
+ includes="**/*_(a){locale}.properties">
+ <manifest>
+ <attribute name="Manifest-Version" value="1.0"/>
+ <attribute name="Created-By" value="JBoss Tools i18n build.xml"/>
+ <attribute name="Bundle-Name" value="${plugin} ${localename} NLS Support"/>
+ <attribute name="Bundle-SymbolicName" value="${plugin}.nl_@{locale} ;singleton=true"/>
+ <attribute name="Bundle-Version" value="${PLUGIN_VERSION}"/>
+ <attribute name="Bundle-Vendor" value="${PLUGIN_VENDOR}"/>
+ <attribute name="Fragment-Host" value="${plugin};bundle-version="[0.0.0,9.9.9)""/>
+ </manifest>
</jar>
</sequential>
</for>
@@ -301,11 +258,6 @@
</path>
<sequential>
<!-- FIXME -->
- <propertyregex override="true" property="module"
- input="@{featurexml}"
- regexp="^${jbt.srcdir}${file.separator}([^/\\]+).*"
- select="\1" />
- <checkprop propname="module"/>
<propertyregex override="true" property="feature"
input="@{featurexml}"
regexp="^${jbt.srcdir}${file.separator}[^/\\]+${file.separator}features${file.separator}([^/\\]+)${file.separator}feature.xml"
@@ -314,7 +266,7 @@
<!-- FIXME -->
<var name="featurename" value="${feature}" />
<var name="jarsize" value="0" />
- <echo level="verbose" message="Processing feature ${feature} in module ${module}"/>
+ <echo level="verbose" message="Processing feature ${feature}"/>
<for param="locale" list="${locales}">
<sequential>
<!-- FIXME -->
@@ -445,27 +397,10 @@
</exec>
</target>
- <target name="zips" depends="init" description="Generate zip files containing langpacks, one zip per locale">
- <delete dir="${zipdir}" />
- <mkdir dir="${zipdir}" />
- <for param="locale" list="${locales}">
- <sequential>
- <zip
- destfile="${zipdir}/jbosstools-nls-(a){locale}_${LANGPACK_VERSION}.zip"
- compress="false"
- whenempty="fail"
- basedir="${jardir}" >
- <include name="plugins/*.nl-(a){locale}_${PLUGIN_VERSION}.jar" />
- <include name="features/*.nl-(a){locale}_${PLUGIN_VERSION}.jar/" />
- </zip>
- </sequential>
- </for>
- </target>
-
- <target name="most" depends="clean, prop2pot, en, qps, en_AA, po2prop, manifests, fragments, features"
+ <target name="most" depends="clean, prop2pot, en, qps, en_AA, po2prop, plugins, features"
description="Generates langpacks and metadata" />
- <target name="all" depends="clean, prop2pot, en, qps, en_AA, po2prop, manifests, fragments, features, p2, zips"
+ <target name="all" depends="clean, prop2pot, en, qps, en_AA, po2prop, plugins, features, p2"
description="Runs all targets in an appropriate order"/>
Deleted: trunk/i18n/plugin-template.mf
===================================================================
--- trunk/i18n/plugin-template.mf 2008-11-21 02:11:55 UTC (rev 11937)
+++ trunk/i18n/plugin-template.mf 2008-11-21 03:30:58 UTC (rev 11938)
@@ -1,7 +0,0 @@
-Manifest-Version: 1.0
-Created-By: JBoss Tools localization build.xml
-Bundle-Name: ${plugin} ${localename} NLS Support
-Bundle-SymbolicName: ${plugin}.nl_${locale} ;singleton=true
-Bundle-Version: ${PLUGIN_VERSION}
-Bundle-Vendor: ${PLUGIN_VENDOR}
-Fragment-Host: ${plugin};bundle-version="[0.0.0,9.9.9)"
17 years, 5 months
JBoss Tools SVN: r11937 - trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/javabean/ui.
by jbosstools-commits@lists.jboss.org
Author: DartPeng
Date: 2008-11-20 21:11:55 -0500 (Thu, 20 Nov 2008)
New Revision: 11937
Added:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/javabean/ui/IJavaBeanSelectionListener.java
Modified:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/javabean/ui/JavaBeanConfigWizardPage.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/javabean/ui/JavaBeanModelLoadComposite.java
Log:
JBIDE-3237
Add a listener to handle the exceptions that occur when added the JavaBean model.
Added: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/javabean/ui/IJavaBeanSelectionListener.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/javabean/ui/IJavaBeanSelectionListener.java (rev 0)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/javabean/ui/IJavaBeanSelectionListener.java 2008-11-21 02:11:55 UTC (rev 11937)
@@ -0,0 +1,12 @@
+/**
+ *
+ */
+package org.jboss.tools.smooks.javabean.ui;
+
+/**
+ * @author Dart
+ *
+ */
+public interface IJavaBeanSelectionListener {
+ public void exceptionOccur(Exception e);
+}
Property changes on: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/javabean/ui/IJavaBeanSelectionListener.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/javabean/ui/JavaBeanConfigWizardPage.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/javabean/ui/JavaBeanConfigWizardPage.java 2008-11-21 01:50:50 UTC (rev 11936)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/javabean/ui/JavaBeanConfigWizardPage.java 2008-11-21 02:11:55 UTC (rev 11937)
@@ -30,7 +30,7 @@
* @CreateTime Jul 21, 2008
*/
public class JavaBeanConfigWizardPage extends WizardPage implements
- SelectionListener {
+ SelectionListener ,IJavaBeanSelectionListener {
TreeViewer treeViewer;
@@ -73,7 +73,7 @@
try {
javaPropertySelectComposite = new JavaBeanModelLoadComposite(
parent, SWT.NONE, getContainer(), project);
-
+ javaPropertySelectComposite.addJavaBeanSelectionListener(this);
// Button button = new Button(cc, SWT.BORDER);
//
// final TreeViewer vi = new TreeViewer(cc, SWT.NONE);
@@ -137,4 +137,8 @@
}
+ public void exceptionOccur(Exception e) {
+ this.setErrorMessage(e.toString());
+ }
+
}
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/javabean/ui/JavaBeanModelLoadComposite.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/javabean/ui/JavaBeanModelLoadComposite.java 2008-11-21 01:50:50 UTC (rev 11936)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/javabean/ui/JavaBeanModelLoadComposite.java 2008-11-21 02:11:55 UTC (rev 11937)
@@ -11,10 +11,12 @@
package org.jboss.tools.smooks.javabean.ui;
import java.util.ArrayList;
+import java.util.Iterator;
import java.util.List;
import org.eclipse.jdt.core.IJavaProject;
import org.eclipse.jdt.core.IType;
+import org.eclipse.jdt.core.JavaModelException;
import org.eclipse.jdt.core.search.IJavaSearchScope;
import org.eclipse.jdt.internal.corext.util.JavaModelUtil;
import org.eclipse.jdt.internal.ui.search.JavaSearchScopeFactory;
@@ -65,6 +67,8 @@
protected JavaBeanModel currentRootJavaBeanModel = null;
protected JavaBeanModel returnJavaBeanModel = null;
+ private List<IJavaBeanSelectionListener> selectionListenerList = new ArrayList<IJavaBeanSelectionListener>();
+
protected ProjectClassLoader loader = null;
private TableViewer listViewer;
@@ -103,6 +107,15 @@
return javabeanList;
}
+ public void addJavaBeanSelectionListener(IJavaBeanSelectionListener listener) {
+ this.selectionListenerList.add(listener);
+ }
+
+ public void removeJavaBeanSelectionListener(
+ IJavaBeanSelectionListener listener) {
+ this.selectionListenerList.remove(listener);
+ }
+
public void setJavabeanList(List<JavaBeanModel> javabeanList) {
this.javabeanList = javabeanList;
}
@@ -181,8 +194,8 @@
@Override
public Image getImage(Object element) {
if (element instanceof JavaBeanModel) {
- return SmooksUIActivator.getDefault().getImageRegistry().get(
- JavaImageConstants.IMAGE_JAVA_OBJECT);
+ return SmooksUIActivator.getDefault().getImageRegistry()
+ .get(JavaImageConstants.IMAGE_JAVA_OBJECT);
}
return super.getImage(element);
}
@@ -205,13 +218,13 @@
GridLayout buttonAreaLayout = new GridLayout();
buttonArea.setLayout(buttonAreaLayout);
- Button addButton = new Button(buttonArea, SWT.BORDER);
+ Button addButton = new Button(buttonArea, SWT.NONE);
addButton.setText("Add");
gd = new GridData(GridData.FILL_HORIZONTAL);
addButton.setLayoutData(gd);
addButton.addSelectionListener(this);
- Button removeButton = new Button(buttonArea, SWT.BORDER);
+ Button removeButton = new Button(buttonArea, SWT.NONE);
removeButton.setText("Remove");
gd = new GridData(GridData.FILL_HORIZONTAL);
removeButton.setLayoutData(gd);
@@ -250,6 +263,7 @@
IJavaSearchScope scope = JavaSearchScopeFactory.getInstance()
.createJavaProjectSearchScope(javaProject, true);
SelectionDialog dialog;
+ Exception exception = null;
try {
dialog = JavaUI.createTypeDialog(this.getShell(), runnableContext,
scope, IJavaElementSearchConstants.CONSIDER_CLASSES, false);
@@ -287,10 +301,17 @@
}
}
}
- } catch (Exception e) {
- // this.setErrorMessage("Error occurs!please see log file");
- e.printStackTrace();
+ } catch (Exception e){
+ exception = e;
}
+ if (exception != null) {
+ for (Iterator<IJavaBeanSelectionListener> iterator = this.selectionListenerList
+ .iterator(); iterator.hasNext();) {
+ IJavaBeanSelectionListener l = (IJavaBeanSelectionListener) iterator
+ .next();
+ l.exceptionOccur(exception);
+ }
+ }
}
17 years, 5 months
JBoss Tools SVN: r11936 - trunk/i18n.
by jbosstools-commits@lists.jboss.org
Author: sflanigan
Date: 2008-11-20 20:50:50 -0500 (Thu, 20 Nov 2008)
New Revision: 11936
Modified:
trunk/i18n/build.xml
Log:
Cosmetics
Modified: trunk/i18n/build.xml
===================================================================
--- trunk/i18n/build.xml 2008-11-21 01:32:53 UTC (rev 11935)
+++ trunk/i18n/build.xml 2008-11-21 01:50:50 UTC (rev 11936)
@@ -68,7 +68,7 @@
</target>
- <target name="init" depends="checkver,initTaskDefs">
+ <target name="init" depends="-checkver,initTaskDefs">
</target>
<target name="debug" depends="init">
@@ -196,17 +196,12 @@
</path>
<sequential>
<!-- FIXME -->
- <propertyregex override="true" property="module"
- input="@{plugindir}"
- regexp="^(a){rootdir}[/\\]([^/\\]+).*"
- select="\1" />
- <checkprop propname="module"/>
<propertyregex override="true" property="plugin"
input="@{plugindir}"
regexp="^(a){rootdir}[/\\][^/\\]+[/\\]([^/\\]+).*"
select="\1" />
<checkprop propname="plugin"/>
- <echo level="verbose" message="@{plugindir} contains props for plugin ${plugin} in module ${module}"/>
+ <echo level="verbose" message="@{plugindir} contains props for plugin ${plugin}"/>
<antcall target="@{task}">
<param name="plugin" value="${plugin}"/>
<param name="plugindir" value="@{plugindir}"/>
@@ -467,17 +462,18 @@
</for>
</target>
- <target name="most" depends="clean, prop2pot, en, qps, en_AA, po2prop, manifests, fragments, features" />
+ <target name="most" depends="clean, prop2pot, en, qps, en_AA, po2prop, manifests, fragments, features"
+ description="Generates langpacks and metadata" />
<target name="all" depends="clean, prop2pot, en, qps, en_AA, po2prop, manifests, fragments, features, p2, zips"
- description="Runs all targets in an appropriate order"/>
+ description="Runs all targets in an appropriate order"/>
<!-- Test for a class from Ant 1.7.1 (needed for the jar task's erroronmissingdir feature -->
<available property="Ant-1.7.1-or-later"
classname="org.apache.tools.ant.input.SecureInputHandler"/>
- <target name="checkver" unless="Ant-1.7.1-or-later">
+ <target name="-checkver" unless="Ant-1.7.1-or-later">
<fail message="Incorrect version of ant: ${ant.version} but required: 1.7.1"/>
</target>
17 years, 5 months
JBoss Tools SVN: r11934 - trunk/birt/features/org.jboss.tools.birt.feature.
by jbosstools-commits@lists.jboss.org
Author: snjeza
Date: 2008-11-20 19:31:51 -0500 (Thu, 20 Nov 2008)
New Revision: 11934
Modified:
trunk/birt/features/org.jboss.tools.birt.feature/feature.properties
trunk/birt/features/org.jboss.tools.birt.feature/feature.xml
Log:
JBIDE-3239 cannot install JBoss Tools from Nightly Update Site - missing org.eclipse.birt.integration.wtp.ui
Modified: trunk/birt/features/org.jboss.tools.birt.feature/feature.properties
===================================================================
--- trunk/birt/features/org.jboss.tools.birt.feature/feature.properties 2008-11-20 22:56:52 UTC (rev 11933)
+++ trunk/birt/features/org.jboss.tools.birt.feature/feature.properties 2008-11-21 00:31:51 UTC (rev 11934)
@@ -22,6 +22,7 @@
# "updateSiteName" property - label for the update site
updateSiteName=JBossTools Update Site
+birtUpdateSiteName=Business Intellegence and Reporting Tool (BIRT) Updates
# "description" property - description of the feature
description=JBoss BIRT Integration
Modified: trunk/birt/features/org.jboss.tools.birt.feature/feature.xml
===================================================================
--- trunk/birt/features/org.jboss.tools.birt.feature/feature.xml 2008-11-20 22:56:52 UTC (rev 11933)
+++ trunk/birt/features/org.jboss.tools.birt.feature/feature.xml 2008-11-21 00:31:51 UTC (rev 11934)
@@ -20,8 +20,14 @@
<url>
<update label="%updateSiteName" url="http://download.jboss.org/jbosstools/updates/stable"/>
+ <discovery label="%birtUpdateSiteName" url="http://download.eclipse.org/birt/update-site/2.3"/>
</url>
-
+
+ <requires>
+ <import feature="org.eclipse.birt" version="2.3.1.v20080630-7N7Y7AAYdlIXLgz-SLsyMQ21x2fI"/>
+ <import feature="org.eclipse.birt.integration.wtp" version="2.3.1.v20080630-4518s733I3J5E"/>
+ </requires>
+
<plugin
id="org.jboss.tools.birt.oda"
download-size="0"
17 years, 5 months