JBoss Tools SVN: r18914 - in trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks: editor/propertySections and 3 other directories.
by jbosstools-commits@lists.jboss.org
Author: DartPeng
Date: 2009-11-29 08:31:29 -0500 (Sun, 29 Nov 2009)
New Revision: 18914
Added:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/wizards/Messages.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/wizards/messages.properties
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/editor/propertySections/Messages.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/editor/propertySections/messages.properties
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/wizard/freemarker/Messages.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/wizard/freemarker/messages.properties
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/wizards/Messages.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/wizards/messages.properties
Modified:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/wizards/SmooksConfigurationFileNewWizard.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/editor/propertySections/ValueDecodeParamSection.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/gef/model/AbstractSmooksGraphicalModel.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/wizard/freemarker/FreemarkerCSVCreationWizardPage.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/wizards/JavaBeanCreationWizardPage.java
Log:
JBIDE-5155
Externalize strings in Smooks Config Editor Code
Added: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/wizards/Messages.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/wizards/Messages.java (rev 0)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/wizards/Messages.java 2009-11-29 13:31:29 UTC (rev 18914)
@@ -0,0 +1,18 @@
+package org.jboss.tools.smooks.configuration.wizards;
+
+import org.eclipse.osgi.util.NLS;
+
+public class Messages extends NLS {
+ private static final String BUNDLE_NAME = "org.jboss.tools.smooks.configuration.wizards.messages"; //$NON-NLS-1$
+ public static String SmooksConfigurationFileNewWizard_0;
+ public static String SmooksConfigurationFileNewWizard_ErrorDialogTitle;
+ public static String SmooksConfigurationFileNewWizard_PageName;
+ public static String SmooksConfigurationFileNewWizard_VersionPageName;
+ static {
+ // initialize resource bundle
+ NLS.initializeMessages(BUNDLE_NAME, Messages.class);
+ }
+
+ private Messages() {
+ }
+}
Property changes on: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/wizards/Messages.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/wizards/SmooksConfigurationFileNewWizard.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/wizards/SmooksConfigurationFileNewWizard.java 2009-11-29 13:18:14 UTC (rev 18913)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/wizards/SmooksConfigurationFileNewWizard.java 2009-11-29 13:31:29 UTC (rev 18914)
@@ -48,7 +48,7 @@
public SmooksConfigurationFileNewWizard() {
super();
setNeedsProgressMonitor(true);
- setDefaultPageImageDescriptor(SmooksConfigurationActivator.getImageDescriptor("icons/smooks-wiz.gif"));
+ setDefaultPageImageDescriptor(SmooksConfigurationActivator.getImageDescriptor(Messages.SmooksConfigurationFileNewWizard_0));
}
/**
@@ -56,11 +56,11 @@
*/
public void addPages() {
- containerSelectionPage = new SmooksFileContainerSelectionPage("Smooks Configuration File",
+ containerSelectionPage = new SmooksFileContainerSelectionPage(Messages.SmooksConfigurationFileNewWizard_PageName,
(IStructuredSelection) selection);
addPage(containerSelectionPage);
- versionSelectionPage = new SmooksVersionSelectionPage("Smooks Version Selection");
+ versionSelectionPage = new SmooksVersionSelectionPage(Messages.SmooksConfigurationFileNewWizard_VersionPageName);
addPage(versionSelectionPage);
}
@@ -89,7 +89,7 @@
return false;
} catch (InvocationTargetException e) {
Throwable realException = e.getTargetException();
- MessageDialog.openError(getShell(), "Error", realException.getMessage());
+ MessageDialog.openError(getShell(), Messages.SmooksConfigurationFileNewWizard_ErrorDialogTitle, realException.getMessage());
return false;
}
return true;
@@ -104,7 +104,7 @@
private void doFinish(IPath containerPath, String fileName, IProgressMonitor monitor, String version)
throws CoreException {
// create a sample file
- monitor.beginTask("Creating " + fileName, 2);
+ monitor.beginTask("Creating " + fileName, 2); //$NON-NLS-1$
IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
IResource resource = root.findMember(containerPath);
IContainer container = null;
@@ -112,7 +112,7 @@
container = (IContainer) resource;
}
if (container == null)
- throwCoreException("Container \"" + containerPath.toPortableString() + "\" does not exist.");
+ throwCoreException("Container \"" + containerPath.toPortableString() + "\" does not exist."); //$NON-NLS-1$ //$NON-NLS-2$
final IFile configFile = container.getFile(new Path(fileName));
// String extFileName = fileName + ".ext";
// final IFile extFile = container.getFile(new Path(extFileName));
@@ -131,7 +131,7 @@
SmooksConfigurationActivator.getDefault().log(e);
}
monitor.worked(1);
- monitor.setTaskName("Opening file with Smooks Editor.");
+ monitor.setTaskName("Opening file with Smooks Editor."); //$NON-NLS-1$
final String fversion = version;
getShell().getDisplay().asyncExec(new Runnable() {
public void run() {
@@ -166,14 +166,14 @@
public static InputStream createExtContentStream(String version, String inputType) {
String typeContents = null;
if (inputType != null) {
- typeContents = "inputType = \"" + inputType + "\"";
+ typeContents = "inputType = \"" + inputType + "\""; //$NON-NLS-1$ //$NON-NLS-2$
}
- String contents = "";
+ String contents = ""; //$NON-NLS-1$
if (typeContents == null) {
- contents = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"; // + " <smooks-graphics-ext platformVersion = \""
+ contents = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"; // + " <smooks-graphics-ext platformVersion = \"" //$NON-NLS-1$
// + version + "\" xmlns=\"http://www.jboss.org/jbosstools/smooks/smooks-graphics-ext.xsd\"/>";
} else {
- contents = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";// + " <smooks-graphics-ext platformVersion = \""
+ contents = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";// + " <smooks-graphics-ext platformVersion = \"" //$NON-NLS-1$
// + version + "\" " + typeContents
// + " xmlns=\"http://www.jboss.org/jbosstools/smooks/smooks-graphics-ext.xsd\"/>";
}
@@ -186,7 +186,7 @@
*/
private InputStream openContentStream(String version) {
- String contents = "";
+ String contents = ""; //$NON-NLS-1$
if (SmooksConstants.VERSION_1_1.equals(version)) {
contents = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" //$NON-NLS-1$
+ "<smooks-resource-list xmlns=\"http://www.milyn.org/xsd/smooks-1.1.xsd\">\n"// xmlns:graph = \"http://www.jboss.org/jbosstools/smooks/smooks-graphics-ext.xsd\">\n"//$NON-NLS-1$
Added: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/wizards/messages.properties
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/wizards/messages.properties (rev 0)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/wizards/messages.properties 2009-11-29 13:31:29 UTC (rev 18914)
@@ -0,0 +1,4 @@
+SmooksConfigurationFileNewWizard_0=icons/smooks-wiz.gif
+SmooksConfigurationFileNewWizard_ErrorDialogTitle=Error
+SmooksConfigurationFileNewWizard_PageName=Smooks Configuration File
+SmooksConfigurationFileNewWizard_VersionPageName=Smooks Version Selection
Property changes on: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/wizards/messages.properties
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/editor/propertySections/Messages.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/editor/propertySections/Messages.java (rev 0)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/editor/propertySections/Messages.java 2009-11-29 13:31:29 UTC (rev 18914)
@@ -0,0 +1,20 @@
+package org.jboss.tools.smooks.editor.propertySections;
+
+import org.eclipse.osgi.util.NLS;
+
+public class Messages extends NLS {
+ private static final String BUNDLE_NAME = "org.jboss.tools.smooks.editor.propertySections.messages"; //$NON-NLS-1$
+ public static String ValueDecodeParamSection_DeleteButtonText;
+ public static String ValueDecodeParamSection_NewParamButtonText;
+ public static String ValueDecodeParamSection_NullText;
+ public static String ValueDecodeParamSection_ParamNameColumnText;
+ public static String ValueDecodeParamSection_ParamValueColumnText;
+ public static String ValueDecodeParamSection_SectionTitle;
+ static {
+ // initialize resource bundle
+ NLS.initializeMessages(BUNDLE_NAME, Messages.class);
+ }
+
+ private Messages() {
+ }
+}
Property changes on: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/editor/propertySections/Messages.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/editor/propertySections/ValueDecodeParamSection.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/editor/propertySections/ValueDecodeParamSection.java 2009-11-29 13:18:14 UTC (rev 18913)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/editor/propertySections/ValueDecodeParamSection.java 2009-11-29 13:31:29 UTC (rev 18914)
@@ -82,7 +82,7 @@
TabbedPropertySheetWidgetFactory factory = aTabbedPropertySheetPage.getWidgetFactory();
Section section = createRootSection(factory, parent);
- section.setText("Decode Parameters");
+ section.setText(Messages.ValueDecodeParamSection_SectionTitle);
controlComposite = factory.createComposite(section, SWT.NONE);
@@ -153,13 +153,13 @@
if (obj instanceof DecodeParamType) {
String name = ((DecodeParamType) obj).getName();
if (name == null)
- name = "";
+ name = ""; //$NON-NLS-1$
return name;
}
if (obj instanceof org.jboss.tools.smooks.model.javabean12.DecodeParamType) {
String name = ((org.jboss.tools.smooks.model.javabean12.DecodeParamType) obj).getName();
if (name == null)
- name = "";
+ name = ""; //$NON-NLS-1$
return name;
}
}
@@ -168,13 +168,13 @@
if (obj instanceof DecodeParamType) {
String value = ((DecodeParamType) obj).getValue();
if (value == null)
- value = "";
+ value = ""; //$NON-NLS-1$
return value;
}
if (obj instanceof org.jboss.tools.smooks.model.javabean12.DecodeParamType) {
String name = ((org.jboss.tools.smooks.model.javabean12.DecodeParamType) obj).getValue();
if (name == null)
- name = "";
+ name = ""; //$NON-NLS-1$
return name;
}
}
@@ -188,14 +188,14 @@
TableColumn nameColumn = new TableColumn(paramterViewer.getTable(), SWT.NONE);
nameColumn.setWidth(150);
- nameColumn.setText("Name");
+ nameColumn.setText(Messages.ValueDecodeParamSection_ParamNameColumnText);
TableColumn valueColumn = new TableColumn(paramterViewer.getTable(), SWT.NONE);
valueColumn.setWidth(150);
- valueColumn.setText("Value");
+ valueColumn.setText(Messages.ValueDecodeParamSection_ParamValueColumnText);
paramterViewer.setCellEditors(new CellEditor[] { new TextCellEditor(paramterViewer.getTable()),
new TextCellEditor(paramterViewer.getTable()) });
- paramterViewer.setColumnProperties(new String[] { "name", "value" });
+ paramterViewer.setColumnProperties(new String[] { "name", "value" }); //$NON-NLS-1$ //$NON-NLS-2$
paramterViewer.setCellModifier(new ICellModifier() {
@@ -206,7 +206,7 @@
if (element == null)
return;
EStructuralFeature feature = null;
- if (property.equals("name")) {
+ if (property.equals("name")) { //$NON-NLS-1$
if (element instanceof DecodeParamType) {
feature = JavabeanPackage.Literals.DECODE_PARAM_TYPE__NAME;
}
@@ -214,7 +214,7 @@
feature = Javabean12Package.Literals.DECODE_PARAM_TYPE__NAME;
}
}
- if (property.equals("value")) {
+ if (property.equals("value")) { //$NON-NLS-1$
if (element instanceof DecodeParamType) {
feature = JavabeanPackage.Literals.DECODE_PARAM_TYPE__VALUE;
}
@@ -233,31 +233,31 @@
public Object getValue(Object element, String property) {
element = AdapterFactoryEditingDomain.unwrap(element);
- if (property.equals("name")) {
+ if (property.equals("name")) { //$NON-NLS-1$
if (element instanceof DecodeParamType) {
String name = ((DecodeParamType) element).getName();
if (name == null)
- name = "";
+ name = ""; //$NON-NLS-1$
return name;
}
if (element instanceof org.jboss.tools.smooks.model.javabean12.DecodeParamType) {
String name = ((org.jboss.tools.smooks.model.javabean12.DecodeParamType) element).getName();
if (name == null)
- name = "";
+ name = ""; //$NON-NLS-1$
return name;
}
}
- if (property.equals("value")) {
+ if (property.equals("value")) { //$NON-NLS-1$
if (element instanceof DecodeParamType) {
String value = ((DecodeParamType) element).getValue();
if (value == null)
- value = "";
+ value = ""; //$NON-NLS-1$
return value;
}
if (element instanceof org.jboss.tools.smooks.model.javabean12.DecodeParamType) {
String value = ((org.jboss.tools.smooks.model.javabean12.DecodeParamType) element).getValue();
if (value == null)
- value = "";
+ value = ""; //$NON-NLS-1$
return value;
}
}
@@ -279,7 +279,7 @@
GridLayout gl2 = new GridLayout();
buttonComposite.setLayout(gl2);
- Button newRuleButton = factory.createButton(buttonComposite, "New Parameter", SWT.NONE);
+ Button newRuleButton = factory.createButton(buttonComposite, Messages.ValueDecodeParamSection_NewParamButtonText, SWT.NONE);
newRuleButton.addSelectionListener(new SelectionAdapter() {
/*
@@ -299,14 +299,14 @@
return;
if (element instanceof ValueType) {
model = JavabeanFactory.eINSTANCE.createDecodeParamType();
- ((DecodeParamType) model).setName("<null>");
- ((DecodeParamType) model).setValue("<null>");
+ ((DecodeParamType) model).setName(Messages.ValueDecodeParamSection_NullText);
+ ((DecodeParamType) model).setValue(Messages.ValueDecodeParamSection_NullText);
feature = JavabeanPackage.Literals.VALUE_TYPE__DECODE_PARAM;
}
if (element instanceof org.jboss.tools.smooks.model.javabean12.ValueType) {
model = Javabean12Factory.eINSTANCE.createDecodeParamType();
- ((org.jboss.tools.smooks.model.javabean12.DecodeParamType) model).setName("<null>");
- ((org.jboss.tools.smooks.model.javabean12.DecodeParamType) model).setValue("<null>");
+ ((org.jboss.tools.smooks.model.javabean12.DecodeParamType) model).setName(Messages.ValueDecodeParamSection_NullText);
+ ((org.jboss.tools.smooks.model.javabean12.DecodeParamType) model).setValue(Messages.ValueDecodeParamSection_NullText);
feature = Javabean12Package.Literals.VALUE_TYPE__DECODE_PARAM;
}
if (model != null && feature != null && element != null) {
@@ -320,7 +320,7 @@
}
});
- Button deleteRuleButton = factory.createButton(buttonComposite, "Delete", SWT.NONE);
+ Button deleteRuleButton = factory.createButton(buttonComposite, Messages.ValueDecodeParamSection_DeleteButtonText, SWT.NONE);
deleteRuleButton.addSelectionListener(new SelectionAdapter() {
/*
@@ -425,13 +425,13 @@
if (obj instanceof DecodeParamType) {
String name = ((DecodeParamType) obj).getName();
if (name == null)
- name = "";
+ name = ""; //$NON-NLS-1$
return name;
}
if (obj instanceof org.jboss.tools.smooks.model.javabean12.DecodeParamType) {
String name = ((org.jboss.tools.smooks.model.javabean12.DecodeParamType) obj).getName();
if (name == null)
- name = "";
+ name = ""; //$NON-NLS-1$
return name;
}
}
@@ -440,17 +440,17 @@
if (obj instanceof DecodeParamType) {
String value = ((DecodeParamType) obj).getValue();
if (value == null)
- value = "";
+ value = ""; //$NON-NLS-1$
return value;
}
if (obj instanceof org.jboss.tools.smooks.model.javabean12.DecodeParamType) {
String name = ((org.jboss.tools.smooks.model.javabean12.DecodeParamType) obj).getValue();
if (name == null)
- name = "";
+ name = ""; //$NON-NLS-1$
return name;
}
}
- return "";
+ return ""; //$NON-NLS-1$
}
}
Added: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/editor/propertySections/messages.properties
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/editor/propertySections/messages.properties (rev 0)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/editor/propertySections/messages.properties 2009-11-29 13:31:29 UTC (rev 18914)
@@ -0,0 +1,6 @@
+ValueDecodeParamSection_DeleteButtonText=Delete
+ValueDecodeParamSection_NewParamButtonText=New Parameter
+ValueDecodeParamSection_NullText=<null>
+ValueDecodeParamSection_ParamNameColumnText=Name
+ValueDecodeParamSection_ParamValueColumnText=Value
+ValueDecodeParamSection_SectionTitle=Decode Parameters
Property changes on: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/editor/propertySections/messages.properties
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/gef/model/AbstractSmooksGraphicalModel.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/gef/model/AbstractSmooksGraphicalModel.java 2009-11-29 13:18:14 UTC (rev 18913)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/gef/model/AbstractSmooksGraphicalModel.java 2009-11-29 13:31:29 UTC (rev 18914)
@@ -33,29 +33,29 @@
private List<String> messages = null;
- public static final String PRO_ADD_CHILD = "_pro_add_child";
+ public static final String PRO_ADD_CHILD = "_pro_add_child"; //$NON-NLS-1$
- public static final String PRO_MOVE_CHILD = "_pro_move_child";
+ public static final String PRO_MOVE_CHILD = "_pro_move_child"; //$NON-NLS-1$
- public static final String PRO_REMOVE_CHILD = "_pro_remove_child";
+ public static final String PRO_REMOVE_CHILD = "_pro_remove_child"; //$NON-NLS-1$
- public static final String PRO_ADD_SOURCE_CONNECTION = "_pro_add_source_connected";
+ public static final String PRO_ADD_SOURCE_CONNECTION = "_pro_add_source_connected"; //$NON-NLS-1$
- public static final String PRO_SEVERITY_CHANGED = "_pro_severity_changed";
+ public static final String PRO_SEVERITY_CHANGED = "_pro_severity_changed"; //$NON-NLS-1$
- public static final String PRO_ADD_TARGET_CONNECTION = "_pro_add_target_connected";
+ public static final String PRO_ADD_TARGET_CONNECTION = "_pro_add_target_connected"; //$NON-NLS-1$
- public static final String PRO_REMOVE_SOURCE_CONNECTION = "_pro_remove_source_connected";
+ public static final String PRO_REMOVE_SOURCE_CONNECTION = "_pro_remove_source_connected"; //$NON-NLS-1$
- public static final String PRO_REMOVE_TARGET_CONNECTION = "_pro_remove_target_connected";
+ public static final String PRO_REMOVE_TARGET_CONNECTION = "_pro_remove_target_connected"; //$NON-NLS-1$
- public static final String PRO_TEXT_CHANGED = "_pro_text_changed";
+ public static final String PRO_TEXT_CHANGED = "_pro_text_changed"; //$NON-NLS-1$
- public static final String PRO_FORCE_VISUAL_CHANGED = "_pro_force_text_changed";
+ public static final String PRO_FORCE_VISUAL_CHANGED = "_pro_force_text_changed"; //$NON-NLS-1$
- public static final String PRO_FORCE_CHIDLREN_CHANGED = "_pro_force_children_changed";
+ public static final String PRO_FORCE_CHIDLREN_CHANGED = "_pro_force_children_changed"; //$NON-NLS-1$
- public static final String PRO_FORCE_CONNECTION_CHANGED = "_pro_force_connection_changed";
+ public static final String PRO_FORCE_CONNECTION_CHANGED = "_pro_force_connection_changed"; //$NON-NLS-1$
protected Object data = null;
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/wizard/freemarker/FreemarkerCSVCreationWizardPage.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/wizard/freemarker/FreemarkerCSVCreationWizardPage.java 2009-11-29 13:18:14 UTC (rev 18913)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/wizard/freemarker/FreemarkerCSVCreationWizardPage.java 2009-11-29 13:31:29 UTC (rev 18914)
@@ -53,8 +53,8 @@
public FreemarkerCSVCreationWizardPage(String pageName) {
super(pageName);
- this.setTitle("CSV Template Configuration");
- this.setDescription("Configurate CSV Template");
+ this.setTitle(Messages.FreemarkerCSVCreationWizardPage_WizardTitle);
+ this.setDescription(Messages.FreemarkerCSVCreationWizardPage_WizardDes);
}
/**
@@ -96,14 +96,14 @@
mainComposite.setLayout(layout);
Label seperatorLabel = new Label(mainComposite, SWT.NONE);
- seperatorLabel.setText("Seperator Character : ");
+ seperatorLabel.setText(Messages.FreemarkerCSVCreationWizardPage_SeperatorCharLabel);
seperatorText = new Text(mainComposite, SWT.BORDER);
gd = new GridData(GridData.FILL_HORIZONTAL);
seperatorText.setLayoutData(gd);
seperatorText.setTextLimit(1);
Label quoteLabel = new Label(mainComposite, SWT.NONE);
- quoteLabel.setText("Quote Character : ");
+ quoteLabel.setText(Messages.FreemarkerCSVCreationWizardPage_QuoteCharLabel);
quoteText = new Text(mainComposite, SWT.BORDER);
gd = new GridData(GridData.FILL_HORIZONTAL);
quoteText.setLayoutData(gd);
@@ -115,7 +115,7 @@
gd.heightHint = 200;
gd.horizontalSpan = 2;
Group fieldsComposite = new Group(mainComposite, SWT.NONE);
- fieldsComposite.setText("Fields");
+ fieldsComposite.setText(Messages.FreemarkerCSVCreationWizardPage_FieldsGroupText);
fieldsComposite.setLayoutData(gd);
GridLayout gl = new GridLayout();
gl.numColumns = 2;
@@ -137,7 +137,7 @@
fieldsViewer.setCellEditors(new CellEditor[] { fieldCellEditor });
- fieldsViewer.setColumnProperties(new String[] { "field" });
+ fieldsViewer.setColumnProperties(new String[] { "field" }); //$NON-NLS-1$
fieldsViewer.setCellModifier(new ICellModifier() {
@@ -149,7 +149,7 @@
if (el == null)
return;
if (el instanceof FieldText && value instanceof String) {
- if (property.equals("field")) {
+ if (property.equals("field")) { //$NON-NLS-1$
if (value.toString().equals(((FieldText) el).getText())) {
return;
}
@@ -162,7 +162,7 @@
public Object getValue(Object element, String property) {
if (element instanceof FieldText) {
- if (property.equals("field")) {
+ if (property.equals("field")) { //$NON-NLS-1$
return ((FieldText) element).getText();
}
}
@@ -172,7 +172,7 @@
public boolean canModify(Object element, String property) {
if (element instanceof FieldText) {
- if (property.equals("field")) {
+ if (property.equals("field")) { //$NON-NLS-1$
return true;
}
}
@@ -180,7 +180,7 @@
}
});
if (fields == null) {
- fields = "";
+ fields = ""; //$NON-NLS-1$
}
fillFieldsList(fields);
fieldsViewer.setInput(fieldsList);
@@ -197,18 +197,18 @@
final Button addButton = new Button(buttonComposite, SWT.NONE);
addButton.setLayoutData(gd);
- addButton.setText("Add Field");
+ addButton.setText(Messages.FreemarkerCSVCreationWizardPage_AddFieldButtonText);
final Button removeButton = new Button(buttonComposite, SWT.NONE);
removeButton.setLayoutData(gd);
- removeButton.setText("Remove");
+ removeButton.setText(Messages.FreemarkerCSVCreationWizardPage_RemoveFieldButtonLabel);
addButton.addSelectionListener(new SelectionListener() {
public void widgetSelected(SelectionEvent e) {
addButton.setEnabled(false);
try {
- FieldText field = new FieldText("field");
+ FieldText field = new FieldText("field"); //$NON-NLS-1$
fieldsList.add(field);
fieldsViewer.refresh();
updatePage();
@@ -241,8 +241,8 @@
this.setControl(mainComposite);
- seperatorText.setText(",");
- quoteText.setText("\"");
+ seperatorText.setText(","); //$NON-NLS-1$
+ quoteText.setText("\""); //$NON-NLS-1$
seperatorText.addModifyListener(new ModifyListener() {
@@ -265,8 +265,8 @@
return;
String input = fieldsString.toString();
input = input.trim();
- if (input.indexOf(",") != -1) {
- String[] fields = input.split(",");
+ if (input.indexOf(",") != -1) { //$NON-NLS-1$
+ String[] fields = input.split(","); //$NON-NLS-1$
if (fields != null && fields.length > 0) {
for (int i = 0; i < fields.length; i++) {
String field = fields[i];
@@ -286,20 +286,20 @@
String seperator = seperatorText.getText();
String quote = quoteText.getText();
if (seperator == null || seperator.length() == 0) {
- error = "Seperator can't be null";
+ error = Messages.FreemarkerCSVCreationWizardPage_SeperatorEmptyErrorMessage;
}
if (quote == null || quote.length() == 0) {
- error = "Quote can't be null";
+ error = Messages.FreemarkerCSVCreationWizardPage_QuoteEmptyErrorMessage;
}
if (seperator != null && seperator.length() > 1) {
- error = "Seperator must be only one character";
+ error = "Seperator must be only one character"; //$NON-NLS-1$
}
if (quote != null && quote.length() > 1) {
- error = "Quote must be only one character";
+ error = "Quote must be only one character"; //$NON-NLS-1$
}
if (fieldsList.isEmpty()) {
- error = "Fields can't be null";
+ error = Messages.FreemarkerCSVCreationWizardPage_FieldEmptyErrorMessage;
}
this.setErrorMessage(error);
this.setPageComplete(error == null);
Added: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/wizard/freemarker/Messages.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/wizard/freemarker/Messages.java (rev 0)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/wizard/freemarker/Messages.java 2009-11-29 13:31:29 UTC (rev 18914)
@@ -0,0 +1,24 @@
+package org.jboss.tools.smooks.graphical.wizard.freemarker;
+
+import org.eclipse.osgi.util.NLS;
+
+public class Messages extends NLS {
+ private static final String BUNDLE_NAME = "org.jboss.tools.smooks.graphical.wizard.freemarker.messages"; //$NON-NLS-1$
+ public static String FreemarkerCSVCreationWizardPage_AddFieldButtonText;
+ public static String FreemarkerCSVCreationWizardPage_FieldEmptyErrorMessage;
+ public static String FreemarkerCSVCreationWizardPage_FieldsGroupText;
+ public static String FreemarkerCSVCreationWizardPage_QuoteCharLabel;
+ public static String FreemarkerCSVCreationWizardPage_QuoteEmptyErrorMessage;
+ public static String FreemarkerCSVCreationWizardPage_RemoveFieldButtonLabel;
+ public static String FreemarkerCSVCreationWizardPage_SeperatorCharLabel;
+ public static String FreemarkerCSVCreationWizardPage_SeperatorEmptyErrorMessage;
+ public static String FreemarkerCSVCreationWizardPage_WizardDes;
+ public static String FreemarkerCSVCreationWizardPage_WizardTitle;
+ static {
+ // initialize resource bundle
+ NLS.initializeMessages(BUNDLE_NAME, Messages.class);
+ }
+
+ private Messages() {
+ }
+}
Property changes on: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/wizard/freemarker/Messages.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/wizard/freemarker/messages.properties
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/wizard/freemarker/messages.properties (rev 0)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/wizard/freemarker/messages.properties 2009-11-29 13:31:29 UTC (rev 18914)
@@ -0,0 +1,10 @@
+FreemarkerCSVCreationWizardPage_AddFieldButtonText=Add Field
+FreemarkerCSVCreationWizardPage_FieldEmptyErrorMessage=Fields can't be null
+FreemarkerCSVCreationWizardPage_FieldsGroupText=Fields
+FreemarkerCSVCreationWizardPage_QuoteCharLabel=Quote Character :
+FreemarkerCSVCreationWizardPage_QuoteEmptyErrorMessage=Quote can't be null
+FreemarkerCSVCreationWizardPage_RemoveFieldButtonLabel=Remove
+FreemarkerCSVCreationWizardPage_SeperatorCharLabel=Seperator Character :
+FreemarkerCSVCreationWizardPage_SeperatorEmptyErrorMessage=Seperator can't be null
+FreemarkerCSVCreationWizardPage_WizardDes=Configurate CSV Template
+FreemarkerCSVCreationWizardPage_WizardTitle=CSV Template Configuration
Property changes on: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/wizard/freemarker/messages.properties
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/wizards/JavaBeanCreationWizardPage.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/wizards/JavaBeanCreationWizardPage.java 2009-11-29 13:18:14 UTC (rev 18913)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/wizards/JavaBeanCreationWizardPage.java 2009-11-29 13:31:29 UTC (rev 18914)
@@ -81,16 +81,16 @@
super(pageName, title, titleImage);
this.project = project;
this.exsitingBeanIDs = exsitingBeanIDs;
- this.setTitle("Java Bean Creation");
- this.setDescription("Create a Java Bean model");
+ this.setTitle(Messages.JavaBeanCreationWizardPage_WizardTitle);
+ this.setDescription(Messages.JavaBeanCreationWizardPage_WizardDes);
}
public JavaBeanCreationWizardPage(String pageName, IJavaProject project, List<String> exsitingBeanIDs) {
super(pageName);
this.project = project;
this.exsitingBeanIDs = exsitingBeanIDs;
- this.setTitle("Java Bean Creation");
- this.setDescription("Create a Java Bean model");
+ this.setTitle(Messages.JavaBeanCreationWizardPage_WizardTitle);
+ this.setDescription(Messages.JavaBeanCreationWizardPage_WizardDes);
}
/**
@@ -248,7 +248,7 @@
GridData gd = new GridData(GridData.FILL_HORIZONTAL);
Label beanTypeLabel = new Label(mainComposite, SWT.NONE);
- beanTypeLabel.setText("Bean Type :");
+ beanTypeLabel.setText(Messages.JavaBeanCreationWizardPage_BeanTypeLabel);
Composite composite = new Composite(mainComposite, SWT.NONE);
gd = new GridData(GridData.FILL_HORIZONTAL);
@@ -262,13 +262,13 @@
composite.setLayout(gl);
arrayButton = new Button(composite, SWT.CHECK);
- arrayButton.setText("Array");
+ arrayButton.setText(Messages.JavaBeanCreationWizardPage_ArrayButtonText);
final Button collectionButton = new Button(composite, SWT.CHECK);
- collectionButton.setText("Collection");
+ collectionButton.setText(Messages.JavaBeanCreationWizardPage_CollectionButtonLabel);
Label beanClassLabel = new Label(mainComposite, SWT.NONE);
- beanClassLabel.setText("Collection Class :");
+ beanClassLabel.setText(Messages.JavaBeanCreationWizardPage_CollectionClassLabel);
Composite beanClassComposite = new Composite(mainComposite, SWT.NONE);
GridLayout gl1 = new GridLayout();
@@ -300,7 +300,7 @@
beanClassComposite.setLayoutData(gd);
collectionClassBrowseButton = new Button(beanClassComposite, SWT.NONE);
- collectionClassBrowseButton.setText("Browse...");
+ collectionClassBrowseButton.setText(Messages.JavaBeanCreationWizardPage_BrowseButtonLabel);
collectionClassBrowseButton.addSelectionListener(new SelectionAdapter() {
/*
@@ -368,7 +368,7 @@
colllectionClassText.setEnabled(false);
}
updateWizardPageStatus();
- viewer.setInput("");
+ viewer.setInput(""); //$NON-NLS-1$
}
});
@@ -378,8 +378,8 @@
}
protected void refreshJavaBeanModel() {
- if (beanClass == null || "".equals(beanClass.trim())) {
- viewer.setInput("");
+ if (beanClass == null || "".equals(beanClass.trim())) { //$NON-NLS-1$
+ viewer.setInput(""); //$NON-NLS-1$
} else {
try {
ProjectClassLoader loader = new ProjectClassLoader(project);
@@ -392,7 +392,7 @@
javaBeanModel = JavaBeanModelFactory.getJavaBeanModelWithLazyLoad(clazz);
javaBeanModel.setComponentClass(cclazz);
} else {
- viewer.setInput("");
+ viewer.setInput(""); //$NON-NLS-1$
}
} else {
Class<?> clazz = loader.loadClass(beanClass);
@@ -409,19 +409,19 @@
viewer.setInput(javaBeanModel.getChildren());
viewer.setCheckedElements(javaBeanModel.getChildren().toArray());
} else {
- viewer.setInput("");
+ viewer.setInput(""); //$NON-NLS-1$
}
} catch (JavaModelException e1) {
- viewer.setInput("");
+ viewer.setInput(""); //$NON-NLS-1$
} catch (ClassNotFoundException e1) {
- viewer.setInput("");
+ viewer.setInput(""); //$NON-NLS-1$
}
}
}
private void createBeanClassControls(Composite mainComposite) {
Label beanClassLabel = new Label(mainComposite, SWT.NONE);
- beanClassLabel.setText("Bean Class :");
+ beanClassLabel.setText(Messages.JavaBeanCreationWizardPage_BeanClassLabel);
Composite beanClassComposite = new Composite(mainComposite, SWT.NONE);
GridLayout gl = new GridLayout();
@@ -453,7 +453,7 @@
} else {
collectionClassBrowseButton.setEnabled(false);
colllectionClassText.setEnabled(false);
- colllectionClassText.setText("");
+ colllectionClassText.setText(""); //$NON-NLS-1$
}
refreshJavaBeanModel();
updateWizardPageStatus();
@@ -463,7 +463,7 @@
beanClassComposite.setLayoutData(gd);
Button javaTypeBrowseButton = new Button(beanClassComposite, SWT.NONE);
- javaTypeBrowseButton.setText("Browse...");
+ javaTypeBrowseButton.setText(Messages.JavaBeanCreationWizardPage_BrowseButtonLabel);
javaTypeBrowseButton.addSelectionListener(new SelectionAdapter() {
/*
@@ -499,7 +499,7 @@
private void createBeanIDControls(Composite mainComposite) {
Label beanIDLabel = new Label(mainComposite, SWT.NONE);
- beanIDLabel.setText("Bean ID :");
+ beanIDLabel.setText(Messages.JavaBeanCreationWizardPage_BeanIDLabel);
Text beanIDText = new Text(mainComposite, SWT.BORDER);
GridData gd = new GridData(GridData.FILL_HORIZONTAL);
@@ -517,21 +517,21 @@
protected void updateWizardPageStatus() {
String error = null;
- if (beanID == null || "".equals(beanID.trim())) {
- error = "Bean ID is empty";
+ if (beanID == null || "".equals(beanID.trim())) { //$NON-NLS-1$
+ error = Messages.JavaBeanCreationWizardPage_BeanIDEmptyErrorMessage;
} else {
if (exsitingBeanIDs != null) {
beanID = beanID.trim();
for (Iterator<?> iterator = exsitingBeanIDs.iterator(); iterator.hasNext();) {
String id = (String) iterator.next();
if (id.equals(beanID)) {
- error = "Bean ID '" + beanID + "' is duplicate";
+ error = Messages.JavaBeanCreationWizardPage_BeanIDDuplicateErrorMessage1 + beanID + Messages.JavaBeanCreationWizardPage_BeanIDDuplicateErrorMessage2;
}
}
}
}
- if (beanClass == null || "".equals(beanClass.trim())) {
- error = "Bean Class is empty";
+ if (beanClass == null || "".equals(beanClass.trim())) { //$NON-NLS-1$
+ error = Messages.JavaBeanCreationWizardPage_BeanClassEmptyErrorMessage;
} else {
try {
beanClass = beanClass.trim();
@@ -540,13 +540,13 @@
} catch (JavaModelException e) {
e.printStackTrace();
} catch (ClassNotFoundException e) {
- error = "Can't find the class \"" + beanClass + "\"";
+ error = Messages.JavaBeanCreationWizardPage_CatFindClassErrorMessage1 + beanClass + Messages.JavaBeanCreationWizardPage_27;
}
}
if (isCollection) {
- if (collectionClass == null || "".equals(collectionClass.trim())) {
- error = "Colletion component class is empty";
+ if (collectionClass == null || "".equals(collectionClass.trim())) { //$NON-NLS-1$
+ error = Messages.JavaBeanCreationWizardPage_CollectionComponentClassEmptyErrorMessage;
} else {
try {
ProjectClassLoader loader = new ProjectClassLoader(project);
@@ -554,7 +554,7 @@
} catch (JavaModelException e) {
e.printStackTrace();
} catch (ClassNotFoundException e) {
- error = "Can't find the class \"" + beanClass;
+ error = Messages.JavaBeanCreationWizardPage_CatFindClassErrorMessage1 + beanClass;
}
}
}
Added: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/wizards/Messages.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/wizards/Messages.java (rev 0)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/wizards/Messages.java 2009-11-29 13:31:29 UTC (rev 18914)
@@ -0,0 +1,30 @@
+package org.jboss.tools.smooks.graphical.wizards;
+
+import org.eclipse.osgi.util.NLS;
+
+public class Messages extends NLS {
+ private static final String BUNDLE_NAME = "org.jboss.tools.smooks.graphical.wizards.messages"; //$NON-NLS-1$
+ public static String JavaBeanCreationWizardPage_27;
+ public static String JavaBeanCreationWizardPage_ArrayButtonText;
+ public static String JavaBeanCreationWizardPage_BeanClassEmptyErrorMessage;
+ public static String JavaBeanCreationWizardPage_BeanClassLabel;
+ public static String JavaBeanCreationWizardPage_BeanIDDuplicateErrorMessage1;
+ public static String JavaBeanCreationWizardPage_BeanIDDuplicateErrorMessage2;
+ public static String JavaBeanCreationWizardPage_BeanIDEmptyErrorMessage;
+ public static String JavaBeanCreationWizardPage_BeanIDLabel;
+ public static String JavaBeanCreationWizardPage_BeanTypeLabel;
+ public static String JavaBeanCreationWizardPage_BrowseButtonLabel;
+ public static String JavaBeanCreationWizardPage_CatFindClassErrorMessage1;
+ public static String JavaBeanCreationWizardPage_CollectionButtonLabel;
+ public static String JavaBeanCreationWizardPage_CollectionClassLabel;
+ public static String JavaBeanCreationWizardPage_CollectionComponentClassEmptyErrorMessage;
+ public static String JavaBeanCreationWizardPage_WizardDes;
+ public static String JavaBeanCreationWizardPage_WizardTitle;
+ static {
+ // initialize resource bundle
+ NLS.initializeMessages(BUNDLE_NAME, Messages.class);
+ }
+
+ private Messages() {
+ }
+}
Property changes on: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/wizards/Messages.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/wizards/messages.properties
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/wizards/messages.properties (rev 0)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/wizards/messages.properties 2009-11-29 13:31:29 UTC (rev 18914)
@@ -0,0 +1,16 @@
+JavaBeanCreationWizardPage_27="
+JavaBeanCreationWizardPage_ArrayButtonText=Array
+JavaBeanCreationWizardPage_BeanClassEmptyErrorMessage=Bean Class is empty
+JavaBeanCreationWizardPage_BeanClassLabel=Bean Class :
+JavaBeanCreationWizardPage_BeanIDDuplicateErrorMessage1=Bean ID '
+JavaBeanCreationWizardPage_BeanIDDuplicateErrorMessage2=' is duplicate
+JavaBeanCreationWizardPage_BeanIDEmptyErrorMessage=Bean ID is empty
+JavaBeanCreationWizardPage_BeanIDLabel=Bean ID :
+JavaBeanCreationWizardPage_BeanTypeLabel=Bean Type :
+JavaBeanCreationWizardPage_BrowseButtonLabel=Browse...
+JavaBeanCreationWizardPage_CatFindClassErrorMessage1=Can't find the class "
+JavaBeanCreationWizardPage_CollectionButtonLabel=Collection
+JavaBeanCreationWizardPage_CollectionClassLabel=Collection Class :
+JavaBeanCreationWizardPage_CollectionComponentClassEmptyErrorMessage=Colletion component class is empty
+JavaBeanCreationWizardPage_WizardDes=Create a Java Bean model
+JavaBeanCreationWizardPage_WizardTitle=Java Bean Creation
Property changes on: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/wizards/messages.properties
___________________________________________________________________
Name: svn:mime-type
+ text/plain
15 years
JBoss Tools SVN: r18912 - trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors.
by jbosstools-commits@lists.jboss.org
Author: DartPeng
Date: 2009-11-29 04:43:36 -0500 (Sun, 29 Nov 2009)
New Revision: 18912
Modified:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksReaderFormPage.java
Log:
JBIDE-5280
Analyze the config file when it dosen't contain the input type <param> information.
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksReaderFormPage.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksReaderFormPage.java 2009-11-28 22:05:23 UTC (rev 18911)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksReaderFormPage.java 2009-11-29 09:43:36 UTC (rev 18912)
@@ -327,10 +327,30 @@
for (int i = 0; i < readerTypeList.size(); i++) {
Object r = readerTypeList.get(i);
if (r instanceof EObject) {
- if (r.getClass() == reader.getClass()) {
- readerCombo.select(i);
- break;
+ if (CsvReader.class.isInstance(reader) || CSV12Reader.class.isInstance(reader)) {
+ if (CsvReader.class.isInstance(r) || CSV12Reader.class.isInstance(r)) {
+ readerCombo.select(i);
+ break;
+ }
}
+ if (EDIReader.class.isInstance(reader) || EDI12Reader.class.isInstance(reader)) {
+ if (EDIReader.class.isInstance(r) || EDI12Reader.class.isInstance(r)) {
+ readerCombo.select(i);
+ break;
+ }
+ }
+ if (JsonReader.class.isInstance(reader) || Json12Reader.class.isInstance(reader)) {
+ if (JsonReader.class.isInstance(r) || Json12Reader.class.isInstance(r)) {
+ readerCombo.select(i);
+ break;
+ }
+ }
+ if (ReaderType.class.isInstance(reader)) {
+ if (ReaderType.class.isInstance(r)) {
+ readerCombo.select(i);
+ break;
+ }
+ }
}
}
}
15 years
JBoss Tools SVN: r18911 - trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca.
by jbosstools-commits@lists.jboss.org
Author: vrubezhny
Date: 2009-11-28 17:05:23 -0500 (Sat, 28 Nov 2009)
New Revision: 18911
Modified:
trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/ContentAssistantTestCase.java
trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/JsfJspJbide1807Test.java
trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/JsfJspJbide1813Test.java
trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/MissingKBBuilderTest.java
Log:
JBIDE-5137: Fix JstJspAllTests
Modified: trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/ContentAssistantTestCase.java
===================================================================
--- trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/ContentAssistantTestCase.java 2009-11-28 21:48:44 UTC (rev 18910)
+++ trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/ContentAssistantTestCase.java 2009-11-28 22:05:23 UTC (rev 18911)
@@ -15,6 +15,7 @@
import org.eclipse.ui.part.FileEditorInput;
import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
import org.eclipse.wst.sse.ui.internal.StructuredTextViewer;
+import org.jboss.tools.common.text.ext.util.Utils;
import org.jboss.tools.jst.jsp.contentassist.AutoContentAssistantProposal;
import org.jboss.tools.jst.jsp.jspeditor.JSPMultiPageEditor;
import org.jboss.tools.jst.jsp.jspeditor.JSPTextEditor;
@@ -97,7 +98,27 @@
for (int i = 0; i < proposals.length; i++) {
if (proposals[i] instanceof AutoContentAssistantProposal) {
AutoContentAssistantProposal ap = (AutoContentAssistantProposal)proposals[i];
- if (ap.getReplacementString().toLowerCase().equals(proposalName.toLowerCase())) return true;
+ String replacementString = ap.getReplacementString().toLowerCase();
+ if (replacementString.equalsIgnoreCase(proposalName)) return true;
+
+ // For a tag proposal there will be not only the the tag name but all others characters like default attributes, tag ending characters and so on
+ String[] replacementStringParts = replacementString.split(" ");
+ if (replacementStringParts != null && replacementStringParts.length > 0) {
+ if (replacementStringParts[0].equalsIgnoreCase(proposalName)) return true;
+ }
+
+ // for an attribute proposal there will be a pare of attribute-value (i.e. attrName="attrValue")
+ replacementStringParts = replacementString.split("=");
+ if (replacementStringParts != null && replacementStringParts.length > 0) {
+ if (replacementStringParts[0].equalsIgnoreCase(proposalName)) return true;
+ }
+
+ // For an attribute value proposal there will be the quote characters
+ replacementString = Utils.trimQuotes(replacementString);
+ if (replacementString.equalsIgnoreCase(proposalName)) return true;
+
+
+
} else {
if(proposals[i].getDisplayString().toLowerCase().equals(proposalName.toLowerCase())) return true;
}
Modified: trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/JsfJspJbide1807Test.java
===================================================================
--- trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/JsfJspJbide1807Test.java 2009-11-28 21:48:44 UTC (rev 18910)
+++ trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/JsfJspJbide1807Test.java 2009-11-28 22:05:23 UTC (rev 18911)
@@ -25,9 +25,9 @@
// - The EL-proposals are removed from the test-list.
// - The "/pages" proposal is added as the main case to test
String[] proposals={
- "/pages",
- "/templates",
- "new jsf el expression - create a new attribute value with #{}"
+ "/pages/",
+ "/templates/",
+ "#{}"
};
checkProposals(PAGE_NAME, "<input type=\"image\" src=\"", 25, proposals, true);
Modified: trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/JsfJspJbide1813Test.java
===================================================================
--- trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/JsfJspJbide1813Test.java 2009-11-28 21:48:44 UTC (rev 18910)
+++ trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/JsfJspJbide1813Test.java 2009-11-28 22:05:23 UTC (rev 18911)
@@ -27,7 +27,7 @@
String[] proposals={
"ltr",
"rtl",
- "new jsf el expression - create a new attribute value with #{}"
+ "#{}"
};
checkProposals(PAGE_NAME, "dir=\"\"", 5, proposals, true);
Modified: trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/MissingKBBuilderTest.java
===================================================================
--- trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/MissingKBBuilderTest.java 2009-11-28 21:48:44 UTC (rev 18910)
+++ trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/MissingKBBuilderTest.java 2009-11-28 22:05:23 UTC (rev 18911)
@@ -32,7 +32,7 @@
System.out.println("-1->" + (ps == null ? 0 : ps.length));
JobUtils.waitForIdle(2000);
ps = checkProposals(PAGE_NAME, "<f:loadBundle basename=\"\" var=\"msg\" />", 24, proposals, false);
- System.out.println("-2->" + ps.length);
+ System.out.println("-2->" + (ps == null ? 0 : ps.length));
}
protected ICompletionProposal[] checkProposals(String fileName, String substring, int offset){
15 years
JBoss Tools SVN: r18909 - in trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks: editor/propertySections and 3 other directories.
by jbosstools-commits@lists.jboss.org
Author: DartPeng
Date: 2009-11-28 16:16:21 -0500 (Sat, 28 Nov 2009)
New Revision: 18909
Modified:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksConfigurationOverviewPage.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/editor/propertySections/CSVRecordSection.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/editparts/freemarker/FreemarkerCSVNodeEditPart.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/model/freemarker/FreemarkerCSVNodeGraphicalModel.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/model/freemarker/FreemarkerTemplateGraphicalModel.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/process/ProcessTaskAnalyzer.java
Log:
JBIDE-5299
Done
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksConfigurationOverviewPage.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksConfigurationOverviewPage.java 2009-11-28 20:46:14 UTC (rev 18908)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksConfigurationOverviewPage.java 2009-11-28 21:16:21 UTC (rev 18909)
@@ -512,6 +512,10 @@
public void sourceChange(Object model) {
lockEventFire = true;
+ if (streamFilterTypeCombo == null || defaultSerializationOnCheckbox == null || versionCombo == null) {
+ lockEventFire = false;
+ return;
+ }
streamFilterTypeCombo.setEnabled(true);
defaultSerializationOnCheckbox.setEnabled(true);
String version = getSmooksVersion();
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/editor/propertySections/CSVRecordSection.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/editor/propertySections/CSVRecordSection.java 2009-11-28 20:46:14 UTC (rev 18908)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/editor/propertySections/CSVRecordSection.java 2009-11-28 21:16:21 UTC (rev 18909)
@@ -30,6 +30,7 @@
import org.jboss.tools.smooks.graphical.editors.model.freemarker.FreemarkerTemplateGraphicalModel;
import org.jboss.tools.smooks.model.freemarker.Freemarker;
import org.jboss.tools.smooks.model.smooks.ParamType;
+import org.jboss.tools.smooks.model.smooks.SmooksFactory;
import org.jboss.tools.smooks10.model.smooks.util.SmooksModelUtils;
/**
@@ -123,12 +124,15 @@
speratorText.addModifyListener(new ModifyListener() {
public void modifyText(ModifyEvent e) {
if (fireEvent) {
- Freemarker template = getFreemarker();
- if (template != null) {
- ParamType param = SmooksModelUtils.getParam(template.getParam(),
+ Freemarker freemarker = getFreemarker();
+ if (freemarker != null) {
+ ParamType param = SmooksModelUtils.getParam(freemarker.getParam(),
SmooksModelUtils.KEY_CSV_SEPERATOR);
- if (param == null)
- return;
+ if (param == null){
+ param = SmooksFactory.eINSTANCE.createParamType();
+ param.setName(SmooksModelUtils.KEY_CSV_SEPERATOR);
+ freemarker.getParam().add(param);
+ }
SmooksModelUtils.setTextToSmooksType(getSmooksModelProvider().getEditingDomain(), param,
speratorText.getText());
generateNewTemplateContent();
@@ -140,12 +144,15 @@
quoteText.addModifyListener(new ModifyListener() {
public void modifyText(ModifyEvent e) {
if (fireEvent) {
- Freemarker template = getFreemarker();
- if (template != null) {
+ Freemarker freemarker = getFreemarker();
+ if (freemarker != null) {
ParamType param = SmooksModelUtils
- .getParam(template.getParam(), SmooksModelUtils.KEY_CSV_QUOTE);
- if (param == null)
- return;
+ .getParam(freemarker.getParam(), SmooksModelUtils.KEY_CSV_QUOTE);
+ if (param == null){
+ param = SmooksFactory.eINSTANCE.createParamType();
+ param.setName(SmooksModelUtils.KEY_CSV_QUOTE);
+ freemarker.getParam().add(param);
+ }
SmooksModelUtils.setTextToSmooksType(getSmooksModelProvider().getEditingDomain(), param,
quoteText.getText());
generateNewTemplateContent();
@@ -170,7 +177,8 @@
if (freemarker != null) {
String quote = SmooksModelUtils.getParamValue(freemarker.getParam(), SmooksModelUtils.KEY_CSV_QUOTE);
String sperator = SmooksModelUtils.getParamValue(freemarker.getParam(), SmooksModelUtils.KEY_CSV_SEPERATOR);
-
+ if(quote == null) quote = "";
+ if(sperator == null) sperator = "";
speratorText.setText(sperator);
quoteText.setText(quote);
}
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/editparts/freemarker/FreemarkerCSVNodeEditPart.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/editparts/freemarker/FreemarkerCSVNodeEditPart.java 2009-11-28 20:46:14 UTC (rev 18908)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/editparts/freemarker/FreemarkerCSVNodeEditPart.java 2009-11-28 21:16:21 UTC (rev 18909)
@@ -273,7 +273,6 @@
*/
@Override
public void treeExpanded(TreeFigureExpansionEvent event) {
- System.out.println();
}
/*
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/model/freemarker/FreemarkerCSVNodeGraphicalModel.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/model/freemarker/FreemarkerCSVNodeGraphicalModel.java 2009-11-28 20:46:14 UTC (rev 18908)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/model/freemarker/FreemarkerCSVNodeGraphicalModel.java 2009-11-28 21:16:21 UTC (rev 18909)
@@ -27,6 +27,7 @@
import org.jboss.tools.smooks.model.freemarker.Freemarker;
import org.jboss.tools.smooks.model.freemarker.Template;
import org.jboss.tools.smooks.model.smooks.ParamType;
+import org.jboss.tools.smooks.model.smooks.SmooksFactory;
import org.jboss.tools.smooks10.model.smooks.util.SmooksModelUtils;
/**
@@ -98,6 +99,11 @@
Freemarker freemarker = (Freemarker) parent.getData();
if (freemarker != null) {
ParamType param = SmooksModelUtils.getParam(freemarker.getParam(), SmooksModelUtils.KEY_CSV_FIELDS);
+ if (param == null){
+ param = SmooksFactory.eINSTANCE.createParamType();
+ param.setName(SmooksModelUtils.KEY_CSV_FIELDS);
+ freemarker.getParam().add(param);
+ }
if (param != null) {
SmooksModelUtils.setTextToSmooksType(this.domainProvider.getEditingDomain(), param, fieldsString);
changeFreemarkerContents();
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/model/freemarker/FreemarkerTemplateGraphicalModel.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/model/freemarker/FreemarkerTemplateGraphicalModel.java 2009-11-28 20:46:14 UTC (rev 18908)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/model/freemarker/FreemarkerTemplateGraphicalModel.java 2009-11-28 21:16:21 UTC (rev 18909)
@@ -38,7 +38,7 @@
public static final int TYPE_XML = 3;
- public static final int TYPE_XSD = 3;
+ public static final int TYPE_XSD = 4;
private ISmooksModelProvider smooksModelProvider;
@@ -56,17 +56,17 @@
Freemarker freemarker = (Freemarker) getData();
// Template template = freemarker.getTemplate();
if (freemarker != null) {
+ CSVNodeModel recordModel = new CSVNodeModel();
+ recordModel.setName("CSV-Record");
+ recordModel.setRecord(true);
+ FreemarkerCSVNodeGraphicalModel recordGraphNode = new FreemarkerCSVNodeGraphicalModel(recordModel,
+ contentProvider, labelProvider, smooksModelProvider);
+ this.getChildrenWithoutDynamic().add(recordGraphNode);
+ recordGraphNode.setParent(this);
String[] fields = SmooksModelUtils.getFreemarkerCSVFileds(freemarker);
String type = SmooksModelUtils.getTemplateType(freemarker);
if (SmooksModelUtils.FREEMARKER_TEMPLATE_TYPE_CSV.equals(type)) {
if (fields != null) {
- CSVNodeModel recordModel = new CSVNodeModel();
- recordModel.setName("CSV-Record");
- recordModel.setRecord(true);
- FreemarkerCSVNodeGraphicalModel recordGraphNode = new FreemarkerCSVNodeGraphicalModel(recordModel,
- contentProvider, labelProvider, smooksModelProvider);
- this.getChildrenWithoutDynamic().add(recordGraphNode);
- recordGraphNode.setParent(this);
List<FreemarkerCSVNodeGraphicalModel> fieldsGraphNodeList = new ArrayList<FreemarkerCSVNodeGraphicalModel>();
for (int i = 0; i < fields.length; i++) {
String field = fields[i];
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/process/ProcessTaskAnalyzer.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/process/ProcessTaskAnalyzer.java 2009-11-28 20:46:14 UTC (rev 18908)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/process/ProcessTaskAnalyzer.java 2009-11-28 21:16:21 UTC (rev 18909)
@@ -19,6 +19,7 @@
import org.jboss.tools.smooks.model.javabean12.BeanType;
import org.jboss.tools.smooks.model.smooks.AbstractResourceConfig;
import org.jboss.tools.smooks.model.smooks.SmooksResourceListType;
+import org.jboss.tools.smooks10.model.smooks.util.SmooksModelUtils;
/**
* @author Dart
@@ -28,12 +29,13 @@
public void analyzeTaskNode(ProcessType process, SmooksResourceListType resourceList) {
process.getTask().clear();
- if(resourceList == null) return;
+ if (resourceList == null)
+ return;
// Input task node must be in process:
TaskType inputTask = ProcessFactory.eINSTANCE.createTaskType();
inputTask.setId(TaskTypeManager.TASK_ID_INPUT);
inputTask.setName(TaskTypeManager.getTaskLabel(TaskTypeManager.TASK_ID_INPUT));
-
+
process.addTask(inputTask);
List<AbstractResourceConfig> resourceConfigList = resourceList.getAbstractResourceConfig();
@@ -56,9 +58,15 @@
for (Iterator<?> iterator = resourceConfigList.iterator(); iterator.hasNext();) {
AbstractResourceConfig abstractResourceConfig = (AbstractResourceConfig) iterator.next();
if (abstractResourceConfig instanceof Freemarker) {
- TemplateAppyTaskNode templateTask =(TemplateAppyTaskNode) ProcessFactory.eINSTANCE.createTemplateTask();
- templateTask.addSmooksModel(abstractResourceConfig);
- javaMappingTask.addTask(templateTask);
+ String messageType = SmooksModelUtils.getParamValue(((Freemarker) abstractResourceConfig)
+ .getParam(), SmooksModelUtils.KEY_TEMPLATE_TYPE);
+ if (SmooksModelUtils.FREEMARKER_TEMPLATE_TYPE_CSV.equals(messageType)) {
+ TemplateAppyTaskNode templateTask = (TemplateAppyTaskNode) ProcessFactory.eINSTANCE
+ .createTemplateTask();
+ templateTask.setType(messageType);
+ templateTask.addSmooksModel(abstractResourceConfig);
+ javaMappingTask.addTask(templateTask);
+ }
}
}
}
15 years
JBoss Tools SVN: r18908 - in trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks: gef/tree/editparts and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: DartPeng
Date: 2009-11-28 15:46:14 -0500 (Sat, 28 Nov 2009)
New Revision: 18908
Modified:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/validate/BeanIdRefValidator.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/gef/tree/editparts/TreeContainerEditPart.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/gef/tree/editparts/TreeNodeEditPart.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/gef/tree/figures/TreeContainerFigure.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/SmooksGraphicalEditorPart.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/SmooksJavaMappingGraphicalEditor.java
Log:
JBIDE-5298
Done. when refresh the figure, to get the root layer to refresh too.
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/validate/BeanIdRefValidator.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/validate/BeanIdRefValidator.java 2009-11-28 19:45:06 UTC (rev 18907)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/validate/BeanIdRefValidator.java 2009-11-28 20:46:14 UTC (rev 18908)
@@ -78,7 +78,7 @@
if (idRef != null) {
if (!idList.contains(idRef) && beanIDRefFeature != null && beanIDRefFeature instanceof EAttribute) {
- return newWaringDiagnostic("Reference BeanId '" + idRef + "' dosen't exist.", model,
+ return newWaringDiagnostic("The Java Bean '" + idRef + "' dosen't exist.", model,
(EAttribute) beanIDRefFeature);
}
}
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/gef/tree/editparts/TreeContainerEditPart.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/gef/tree/editparts/TreeContainerEditPart.java 2009-11-28 19:45:06 UTC (rev 18907)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/gef/tree/editparts/TreeContainerEditPart.java 2009-11-28 20:46:14 UTC (rev 18908)
@@ -65,7 +65,7 @@
int serverity = model.getSeverity();
String message = getSeverityMessage(model);
if (serverity == IValidatableModel.NONE) {
- i = model.getImage();
+ i = model.getImage();
}
if (serverity == IValidatableModel.ERROR) {
i = SmooksConfigurationActivator.getDefault().getImageRegistry().get(GraphicsConstants.IMAGE_ERROR);
@@ -96,6 +96,8 @@
try {
((GraphicalEditPart) this.getParent()).setLayoutConstraint(this, this.getFigure(), new Rectangle(location,
size));
+ IFigure figure = getFigure().getParent();
+ figure.repaint();
} catch (Exception e) {
e.printStackTrace();
}
@@ -131,8 +133,8 @@
ISmooksModelProvider modelProvider = (ISmooksModelProvider) editor.getAdapter(ISmooksModelProvider.class);
if (modelProvider != null && getModel() instanceof IMoveableModel) {
- Rectangle rect = ((IMoveableModel) getModel()).getBounds();
-// recordBounds(graph, rect);
+ // Rectangle rect = ((IMoveableModel) getModel()).getBounds();
+ // recordBounds(graph, rect);
}
}
}
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/gef/tree/editparts/TreeNodeEditPart.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/gef/tree/editparts/TreeNodeEditPart.java 2009-11-28 19:45:06 UTC (rev 18907)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/gef/tree/editparts/TreeNodeEditPart.java 2009-11-28 20:46:14 UTC (rev 18908)
@@ -10,6 +10,7 @@
import java.util.List;
import org.eclipse.draw2d.ConnectionAnchor;
+import org.eclipse.draw2d.FreeformLayer;
import org.eclipse.draw2d.IFigure;
import org.eclipse.draw2d.Label;
import org.eclipse.gef.ConnectionEditPart;
@@ -184,34 +185,45 @@
}
protected void refreshVisuals() {
- TreeNodeModel node = (TreeNodeModel) getModel();
- String text = node.getText();
- if (text != null) {
- ((TreeNodeFigure) getFigure()).setLabelText(text);
- }
- Label tooltip = null;
- int serverity = node.getSeverity();
- String message = getSeverityMessage(node);
- Image image = node.getImage();
- if (serverity == IValidatableModel.NONE) {
- image = node.getImage();
+ try {
+ TreeNodeModel node = (TreeNodeModel) getModel();
+ String text = node.getText();
+ if (text != null) {
+ ((TreeNodeFigure) getFigure()).setLabelText(text);
+ }
+ Label tooltip = null;
+ int serverity = node.getSeverity();
+ String message = getSeverityMessage(node);
+ Image image = node.getImage();
+ if (serverity == IValidatableModel.NONE) {
+ image = node.getImage();
+ }
+ if (serverity == IValidatableModel.ERROR) {
+ image = SmooksConfigurationActivator.getDefault().getImageRegistry().get(GraphicsConstants.IMAGE_ERROR);
+ tooltip = errorLabel;
+ tooltip.setText(message);
+ }
+ if (serverity == IValidatableModel.WARNING) {
+ image = SmooksConfigurationActivator.getDefault().getImageRegistry().get(
+ GraphicsConstants.IMAGE_WARNING);
+ tooltip = warningLabel;
+ tooltip.setText(message);
+ }
+ if (image != null) {
+ ((TreeNodeFigure) getFigure()).setLabelImage(image);
+ }
+ ((TreeNodeFigure) getFigure()).setToolTip(tooltip);
+ IFigure parent = getFigure();
+ while (parent != null && !(parent instanceof FreeformLayer)) {
+ parent = parent.getParent();
+ }
+ if (parent != null) {
+ parent.repaint();
+ }
+ } catch (Throwable e) {
+ e.printStackTrace();
}
- if (serverity == IValidatableModel.ERROR) {
- image = SmooksConfigurationActivator.getDefault().getImageRegistry().get(GraphicsConstants.IMAGE_ERROR);
- tooltip = errorLabel;
- tooltip.setText(message);
- }
- if (serverity == IValidatableModel.WARNING) {
- image = SmooksConfigurationActivator.getDefault().getImageRegistry().get(GraphicsConstants.IMAGE_WARNING);
- tooltip = warningLabel;
- tooltip.setText(message);
- }
- if (image != null) {
- ((TreeNodeFigure) getFigure()).setLabelImage(image);
- }
- ((TreeNodeFigure) getFigure()).setToolTip(tooltip);
- super.refreshVisuals();
// Dimension size = getFigure().getPreferredSize(-1, -1);
// Rectangle rect = getFigure().getBounds();
@@ -298,45 +310,49 @@
}
}
-// protected void recordBounds(SmooksGraphicsExtType graphicsExt, Rectangle bounds) {
-// GraphType graph = graphicsExt.getGraph();
-// if (graph == null) {
-// graph = GraphFactory.eINSTANCE.createGraphType();
-// graphicsExt.setGraph(graph);
-// }
-// String figureId = generateFigureID();
-// if (figureId == null)
-// return;
-// FigureType figure = SmooksGraphUtil.findFigureType(graph, figureId);
-//
-// if (figure == null) {
-// figure = GraphFactory.eINSTANCE.createFigureType();
-// figure.setId(figureId);
-// graph.getFigure().add(figure);
-// }
-// recordFigureBounds(figure, bounds);
-// }
-//
-// protected void recordFigureBounds(FigureType figureType, Rectangle bounds) {
-// figureType.setX(String.valueOf(bounds.getLocation().x));
-// figureType.setY(String.valueOf(bounds.getLocation().y));
-//
-// figureType.setHeight(String.valueOf(bounds.getSize().height));
-// figureType.setWidth(String.valueOf(bounds.getSize().width));
-//
-// EObject ext = figureType;
-// while (ext != null && !(ext instanceof SmooksGraphicsExtType)) {
-// ext = ext.eContainer();
-// }
-//
-// if (ext != null && ext instanceof SmooksGraphicsExtType) {
-// List<ISmooksGraphChangeListener> listeners = ((SmooksGraphicsExtType) ext).getChangeListeners();
-// for (Iterator<?> iterator = listeners.iterator(); iterator.hasNext();) {
-// ISmooksGraphChangeListener smooksGraphChangeListener = (ISmooksGraphChangeListener) iterator.next();
-// smooksGraphChangeListener.graphChanged((SmooksGraphicsExtType) ext);
-// }
-// }
-// }
+ // protected void recordBounds(SmooksGraphicsExtType graphicsExt, Rectangle
+ // bounds) {
+ // GraphType graph = graphicsExt.getGraph();
+ // if (graph == null) {
+ // graph = GraphFactory.eINSTANCE.createGraphType();
+ // graphicsExt.setGraph(graph);
+ // }
+ // String figureId = generateFigureID();
+ // if (figureId == null)
+ // return;
+ // FigureType figure = SmooksGraphUtil.findFigureType(graph, figureId);
+ //
+ // if (figure == null) {
+ // figure = GraphFactory.eINSTANCE.createFigureType();
+ // figure.setId(figureId);
+ // graph.getFigure().add(figure);
+ // }
+ // recordFigureBounds(figure, bounds);
+ // }
+ //
+ // protected void recordFigureBounds(FigureType figureType, Rectangle
+ // bounds) {
+ // figureType.setX(String.valueOf(bounds.getLocation().x));
+ // figureType.setY(String.valueOf(bounds.getLocation().y));
+ //
+ // figureType.setHeight(String.valueOf(bounds.getSize().height));
+ // figureType.setWidth(String.valueOf(bounds.getSize().width));
+ //
+ // EObject ext = figureType;
+ // while (ext != null && !(ext instanceof SmooksGraphicsExtType)) {
+ // ext = ext.eContainer();
+ // }
+ //
+ // if (ext != null && ext instanceof SmooksGraphicsExtType) {
+ // List<ISmooksGraphChangeListener> listeners = ((SmooksGraphicsExtType)
+ // ext).getChangeListeners();
+ // for (Iterator<?> iterator = listeners.iterator(); iterator.hasNext();) {
+ // ISmooksGraphChangeListener smooksGraphChangeListener =
+ // (ISmooksGraphChangeListener) iterator.next();
+ // smooksGraphChangeListener.graphChanged((SmooksGraphicsExtType) ext);
+ // }
+ // }
+ // }
protected String generateFigureID() {
return null;
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/gef/tree/figures/TreeContainerFigure.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/gef/tree/figures/TreeContainerFigure.java 2009-11-28 19:45:06 UTC (rev 18907)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/gef/tree/figures/TreeContainerFigure.java 2009-11-28 20:46:14 UTC (rev 18908)
@@ -444,6 +444,7 @@
*/
public void setContentFigure(IFigure contentFigure) {
this.contentFigure = contentFigure;
+// this.repaint(0,0,0,0);
repaint();
}
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/SmooksGraphicalEditorPart.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/SmooksGraphicalEditorPart.java 2009-11-28 19:45:06 UTC (rev 18907)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/SmooksGraphicalEditorPart.java 2009-11-28 20:46:14 UTC (rev 18908)
@@ -1351,10 +1351,14 @@
}
}
+
+ protected String getDiagnosticMessage(Diagnostic diagnostic){
+ return diagnostic.getMessage();
+ }
protected void refreshValidateResult(Diagnostic diagnostic) {
int severity = diagnostic.getSeverity();
- String message = diagnostic.getMessage();
+ String message = getDiagnosticMessage(diagnostic);
if (severity == Diagnostic.ERROR || severity == Diagnostic.WARNING) {
List<?> datas = diagnostic.getData();
AbstractSmooksGraphicalModel obj = null;
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/SmooksJavaMappingGraphicalEditor.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/SmooksJavaMappingGraphicalEditor.java 2009-11-28 19:45:06 UTC (rev 18907)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/SmooksJavaMappingGraphicalEditor.java 2009-11-28 20:46:14 UTC (rev 18908)
@@ -12,6 +12,7 @@
import java.util.List;
+import org.eclipse.emf.common.util.Diagnostic;
import org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain;
import org.eclipse.emf.edit.ui.provider.AdapterFactoryContentProvider;
import org.eclipse.gef.palette.PaletteRoot;
@@ -27,9 +28,11 @@
import org.jboss.tools.smooks.graphical.editors.model.javamapping.JavaMappingActionCreator;
import org.jboss.tools.smooks.model.javabean.BindingsType;
import org.jboss.tools.smooks.model.javabean.ExpressionType;
+import org.jboss.tools.smooks.model.javabean.JavabeanPackage;
import org.jboss.tools.smooks.model.javabean.ValueType;
import org.jboss.tools.smooks.model.javabean.WiringType;
import org.jboss.tools.smooks.model.javabean12.BeanType;
+import org.jboss.tools.smooks.model.javabean12.Javabean12Package;
/**
* @author Dart
@@ -48,6 +51,56 @@
* (non-Javadoc)
*
* @seeorg.jboss.tools.smooks.graphical.editors.SmooksGraphicalEditorPart#
+ * getDiagnosticMessage(org.eclipse.emf.common.util.Diagnostic)
+ */
+ @Override
+ protected String getDiagnosticMessage(Diagnostic diagnostic) {
+ List<?> datas = diagnostic.getData();
+ if (datas.size() == 2) {
+ Object parentObj = datas.get(0);
+
+ if (parentObj instanceof BeanType || parentObj instanceof BindingsType) {
+ Object obj = datas.get(1);
+ if (obj == JavabeanPackage.Literals.BINDINGS_TYPE__BEAN_ID
+ || obj == Javabean12Package.Literals.BEAN_TYPE__BEAN_ID) {
+ String message = diagnostic.getMessage();
+ if (message != null && message.startsWith("The required feature")) {
+ return "The Bean ID shouldn't be empty";
+ }
+ }
+ }
+
+ if (parentObj instanceof ValueType
+ || parentObj instanceof org.jboss.tools.smooks.model.javabean12.ValueType) {
+ Object obj = datas.get(1);
+ if (obj == JavabeanPackage.Literals.VALUE_TYPE__DATA
+ || obj == Javabean12Package.Literals.VALUE_TYPE__DATA) {
+ String message = diagnostic.getMessage();
+ if (message != null && message.startsWith("The required feature")) {
+ return "The node must be linked with input source";
+ }
+ }
+ }
+
+ if (parentObj instanceof WiringType
+ || parentObj instanceof org.jboss.tools.smooks.model.javabean12.WiringType) {
+ Object obj = datas.get(1);
+ if (obj == JavabeanPackage.Literals.WIRING_TYPE__BEAN_ID_REF
+ || obj == Javabean12Package.Literals.WIRING_TYPE__BEAN_ID_REF) {
+ String message = diagnostic.getMessage();
+ if (message != null && message.startsWith("The required feature")) {
+ return "The node must link to another Java Bean";
+ }
+ }
+ }
+ }
+ return super.getDiagnosticMessage(diagnostic);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @seeorg.jboss.tools.smooks.graphical.editors.SmooksGraphicalEditorPart#
* getPaletteRoot()
*/
// @Override
15 years
JBoss Tools SVN: r18907 - trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors.
by jbosstools-commits@lists.jboss.org
Author: DartPeng
Date: 2009-11-28 14:45:06 -0500 (Sat, 28 Nov 2009)
New Revision: 18907
Modified:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksConfigurationOverviewPage.java
Log:
JBIDE-5297
synchronize the option page with the source page.
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksConfigurationOverviewPage.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksConfigurationOverviewPage.java 2009-11-28 19:23:31 UTC (rev 18906)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksConfigurationOverviewPage.java 2009-11-28 19:45:06 UTC (rev 18907)
@@ -58,7 +58,8 @@
* @author Dart
*
*/
-public class SmooksConfigurationOverviewPage extends FormPage implements ISmooksModelValidateListener, ISourceSynchronizeListener {
+public class SmooksConfigurationOverviewPage extends FormPage implements ISmooksModelValidateListener,
+ ISourceSynchronizeListener {
private ISmooksModelProvider smooksModelProvider;
private ModelPanelCreator defaultSettingPanelCreator;
@@ -68,33 +69,33 @@
private Combo streamFilterTypeCombo;
private Button defaultSerializationOnCheckbox;
+ private Combo versionCombo;
// unused fields for now
-// private Button newParamButton;
-// private Button removeParamButton;
-// private Button upParamButton;
-// private Button downParamButton;
-// private Button paramPropertiesButton;
-// private TableViewer paramViewer;
-// private TableViewer conditionViewer;
-// private Button newConditionButton;
-// private Button removeConditionButton;
-// private Button upConditionButton;
-// private Button downConditionButton;
-// private Button conditionPropertiesButton;
-// private Composite defaultSettingComposite;
-// private Button newProfileButton;
-// private Button removeProfileButton;
-// private Button upProfileButton;
-// private Button downProfileButton;
-// private Button profilePropertiesButton;
-// private TableViewer profileViewer;
-// private Section generalSettingSection;
-// private Section conditionSection;
-// private Section profilesSection;
-// private Text smooksNameText;
-// private Text smooksAuthorText;
-
+ // private Button newParamButton;
+ // private Button removeParamButton;
+ // private Button upParamButton;
+ // private Button downParamButton;
+ // private Button paramPropertiesButton;
+ // private TableViewer paramViewer;
+ // private TableViewer conditionViewer;
+ // private Button newConditionButton;
+ // private Button removeConditionButton;
+ // private Button upConditionButton;
+ // private Button downConditionButton;
+ // private Button conditionPropertiesButton;
+ // private Composite defaultSettingComposite;
+ // private Button newProfileButton;
+ // private Button removeProfileButton;
+ // private Button upProfileButton;
+ // private Button downProfileButton;
+ // private Button profilePropertiesButton;
+ // private TableViewer profileViewer;
+ // private Section generalSettingSection;
+ // private Section conditionSection;
+ // private Section profilesSection;
+ // private Text smooksNameText;
+ // private Text smooksAuthorText;
public SmooksConfigurationOverviewPage(FormEditor editor, String id, String title, ISmooksModelProvider provider) {
super(editor, id, title);
@@ -146,8 +147,8 @@
createSettingSection(settingComposite, toolkit);
- globalParamSection = toolkit.createSection(mainComposite, Section.TITLE_BAR
- | Section.TWISTIE | Section.EXPANDED);
+ globalParamSection = toolkit.createSection(mainComposite, Section.TITLE_BAR | Section.TWISTIE
+ | Section.EXPANDED);
globalParamSection.setText("Filter Settings");
globalParamSection.setLayout(new FillLayout());
Composite globalParamComposite = toolkit.createComposite(globalParamSection);
@@ -163,60 +164,67 @@
createGlobalParamterSection(globalParamComposite, toolkit);
- // Have disabled the more open methods for applying "global" properties for now
-// generalSettingSection = toolkit.createSection(mainComposite, Section.DESCRIPTION | Section.TITLE_BAR
-// | Section.TWISTIE | Section.EXPANDED);
-// generalSettingSection.setLayout(new FillLayout());
-// generalSettingSection.setText("Smooks Default Setting");
-// generalSettingSection.setDescription("Define the Smooks configuration file default setting");
-// defaultSettingComposite = toolkit.createComposite(generalSettingSection);
-// generalSettingSection.setClient(defaultSettingComposite);
-// gd = new GridData();
-// gd.widthHint = 500;
-// generalSettingSection.setLayoutData(gd);
-//
-// GridLayout ggl = new GridLayout();
-// defaultSettingComposite.setLayout(ggl);
-// ggl.numColumns = 2;
-// ggl.verticalSpacing = 0;
-//
-// createDefaultSection(defaultSettingComposite, toolkit);
-//
-// conditionSection = toolkit.createSection(mainComposite, Section.DESCRIPTION | Section.TITLE_BAR
-// | Section.TWISTIE);
-// conditionSection.setText("Conditions");
-// conditionSection.setDescription("Define the conditions");
-// conditionSection.setLayout(new FillLayout());
-// Composite conditionComposite = toolkit.createComposite(conditionSection);
-// conditionSection.setClient(conditionComposite);
-// gd = new GridData();
-// gd.verticalAlignment = GridData.BEGINNING;
-// gd.widthHint = 500;
-// conditionSection.setLayoutData(gd);
-//
-// GridLayout cgl = new GridLayout();
-// conditionComposite.setLayout(cgl);
-// cgl.numColumns = 2;
-//
-// createConditionsSection(conditionComposite, toolkit);
-//
-// profilesSection = toolkit.createSection(mainComposite, Section.DESCRIPTION | Section.TITLE_BAR
-// | Section.TWISTIE);
-// profilesSection.setDescription("Define the profiles");
-// profilesSection.setText("Profiles");
-// profilesSection.setLayout(new FillLayout());
-// Composite profilesComposite = toolkit.createComposite(profilesSection);
-// profilesSection.setClient(profilesComposite);
-// gd = new GridData();
-// gd.verticalAlignment = GridData.BEGINNING;
-// gd.widthHint = 500;
-// profilesSection.setLayoutData(gd);
-//
-// GridLayout pgl = new GridLayout();
-// profilesComposite.setLayout(pgl);
-// pgl.numColumns = 2;
-//
-// createProfilesSection(profilesComposite, toolkit);
+ // Have disabled the more open methods for applying "global" properties
+ // for now
+ // generalSettingSection = toolkit.createSection(mainComposite,
+ // Section.DESCRIPTION | Section.TITLE_BAR
+ // | Section.TWISTIE | Section.EXPANDED);
+ // generalSettingSection.setLayout(new FillLayout());
+ // generalSettingSection.setText("Smooks Default Setting");
+ // generalSettingSection.setDescription("Define the Smooks configuration file default setting");
+ // defaultSettingComposite =
+ // toolkit.createComposite(generalSettingSection);
+ // generalSettingSection.setClient(defaultSettingComposite);
+ // gd = new GridData();
+ // gd.widthHint = 500;
+ // generalSettingSection.setLayoutData(gd);
+ //
+ // GridLayout ggl = new GridLayout();
+ // defaultSettingComposite.setLayout(ggl);
+ // ggl.numColumns = 2;
+ // ggl.verticalSpacing = 0;
+ //
+ // createDefaultSection(defaultSettingComposite, toolkit);
+ //
+ // conditionSection = toolkit.createSection(mainComposite,
+ // Section.DESCRIPTION | Section.TITLE_BAR
+ // | Section.TWISTIE);
+ // conditionSection.setText("Conditions");
+ // conditionSection.setDescription("Define the conditions");
+ // conditionSection.setLayout(new FillLayout());
+ // Composite conditionComposite =
+ // toolkit.createComposite(conditionSection);
+ // conditionSection.setClient(conditionComposite);
+ // gd = new GridData();
+ // gd.verticalAlignment = GridData.BEGINNING;
+ // gd.widthHint = 500;
+ // conditionSection.setLayoutData(gd);
+ //
+ // GridLayout cgl = new GridLayout();
+ // conditionComposite.setLayout(cgl);
+ // cgl.numColumns = 2;
+ //
+ // createConditionsSection(conditionComposite, toolkit);
+ //
+ // profilesSection = toolkit.createSection(mainComposite,
+ // Section.DESCRIPTION | Section.TITLE_BAR
+ // | Section.TWISTIE);
+ // profilesSection.setDescription("Define the profiles");
+ // profilesSection.setText("Profiles");
+ // profilesSection.setLayout(new FillLayout());
+ // Composite profilesComposite =
+ // toolkit.createComposite(profilesSection);
+ // profilesSection.setClient(profilesComposite);
+ // gd = new GridData();
+ // gd.verticalAlignment = GridData.BEGINNING;
+ // gd.widthHint = 500;
+ // profilesSection.setLayoutData(gd);
+ //
+ // GridLayout pgl = new GridLayout();
+ // profilesComposite.setLayout(pgl);
+ // pgl.numColumns = 2;
+ //
+ // createProfilesSection(profilesComposite, toolkit);
}
@@ -227,75 +235,27 @@
if (SmooksUIUtils.isLinuxOS()) {
type = SWT.BORDER;
}
- final Combo combo = new Combo(settingComposite, type | SWT.READ_ONLY);
- combo.setEnabled(false);
+ versionCombo = new Combo(settingComposite, type | SWT.READ_ONLY);
+ versionCombo.setEnabled(false);
GridData gd = new GridData(GridData.FILL_HORIZONTAL);
- combo.setLayoutData(gd);
+ versionCombo.setLayoutData(gd);
for (int i = 0; i < SmooksConstants.SMOOKS_VERSIONS.length; i++) {
String version = SmooksConstants.SMOOKS_VERSIONS[i];
- combo.add(version);
+ versionCombo.add(version);
}
String version = getSmooksVersion();
if (version != null)
- combo.setText(version);
- combo.addModifyListener(new ModifyListener() {
+ versionCombo.setText(version);
+ versionCombo.addModifyListener(new ModifyListener() {
public void modifyText(ModifyEvent e) {
- String v = combo.getText();
-// if (smooksModelProvider != null) {
-// smooksModelProvider.getSmooksGraphicsExt().setPlatformVersion(v);
-// }
+ // if (smooksModelProvider != null) {
+ // smooksModelProvider.getSmooksGraphicsExt().setPlatformVersion(v);
+ // }
}
});
- // have hidden the Name & Author bits
-// toolkit.createLabel(settingComposite, "Name : ").setForeground(toolkit.getColors().getColor(IFormColors.TITLE));
-// smooksNameText = toolkit.createText(settingComposite, "", SWT.NONE);
-// smooksNameText.setLayoutData(gd);
-// String name = smooksModelProvider.getSmooksGraphicsExt().getName();
-// if (name != null)
-// smooksNameText.setText(name);
-// smooksNameText.addModifyListener(new ModifyListener() {
-//
-// public void modifyText(ModifyEvent e) {
-// if (lockEventFire)
-// return;
-// if (smooksModelProvider != null) {
-// Command setCommand = SetCommand.create(smooksModelProvider.getEditingDomain(), smooksModelProvider
-// .getSmooksGraphicsExt(), GraphPackage.Literals.SMOOKS_GRAPHICS_EXT_TYPE__NAME,
-// smooksNameText.getText());
-// smooksModelProvider.getEditingDomain().getCommandStack().execute(setCommand);
-// }
-// }
-// });
-//
-// toolkit.paintBordersFor(settingComposite);
-//
-// toolkit.createLabel(settingComposite, "Author : ").setForeground(
-// toolkit.getColors().getColor(IFormColors.TITLE));
-// smooksAuthorText = toolkit.createText(settingComposite, "", SWT.NONE);
-// smooksAuthorText.setLayoutData(gd);
-//
-// String author = smooksModelProvider.getSmooksGraphicsExt().getAuthor();
-// if (author != null)
-// smooksAuthorText.setText(author);
-// smooksAuthorText.addModifyListener(new ModifyListener() {
-//
-// public void modifyText(ModifyEvent e) {
-// if (lockEventFire)
-// return;
-// if (smooksModelProvider != null) {
-// Command setCommand = SetCommand.create(smooksModelProvider.getEditingDomain(), smooksModelProvider
-// .getSmooksGraphicsExt(), GraphPackage.Literals.SMOOKS_GRAPHICS_EXT_TYPE__AUTHOR,
-// smooksAuthorText.getText());
-// smooksModelProvider.getEditingDomain().getCommandStack().execute(setCommand);
-// }
-// }
-// });
-//
-// toolkit.createLabel(settingComposite, "");
-
toolkit.paintBordersFor(settingComposite);
}
@@ -324,7 +284,7 @@
if (parent != null) {
EList<?> parmList = parent.getParam();
for (int i = 0; i < parmList.size(); i++) {
- param = (ParamType)parmList.get(i);
+ param = (ParamType) parmList.get(i);
if (param.getName().equals(propertyID)) {
foundProperty = true;
break;
@@ -359,64 +319,48 @@
editingDomain.getCommandStack().execute(command);
((SmooksResourceListType) resource).setParams((ParamsType) parent);
}
-
+
private void createGlobalParamterSection(Composite globalParamComposite, FormToolkit toolkit) {
- // ModelPanelCreator creator = new ModelPanelCreator();
if (smooksModelProvider != null) {
-// AdapterFactoryEditingDomain editingDomain = (AdapterFactoryEditingDomain) smooksModelProvider
-// .getEditingDomain();
- ParamsType m = getParamsType();
- // if (m == null)
- // return;
- toolkit.createLabel(globalParamComposite, "Stream Filter Type:").setForeground(toolkit.getColors().getColor(IFormColors.TITLE));
+ toolkit.createLabel(globalParamComposite, "Stream Filter Type:").setForeground(
+ toolkit.getColors().getColor(IFormColors.TITLE));
GridData gd = new GridData(SWT.FILL, SWT.NONE, true, false);
- streamFilterTypeCombo = new Combo(globalParamComposite, SWT.DROP_DOWN | SWT.READ_ONLY );
- streamFilterTypeCombo.setItems(new String[] {"SAX", "DOM"});
+ streamFilterTypeCombo = new Combo(globalParamComposite, SWT.DROP_DOWN | SWT.READ_ONLY);
+ streamFilterTypeCombo.setItems(new String[] { "SAX", "DOM" });
streamFilterTypeCombo.setLayoutData(gd);
- toolkit.createLabel(globalParamComposite, "Default Serialization is On:").setForeground(toolkit.getColors().getColor(IFormColors.TITLE));
+ toolkit.createLabel(globalParamComposite, "Default Serialization is On:").setForeground(
+ toolkit.getColors().getColor(IFormColors.TITLE));
gd = new GridData(SWT.FILL, SWT.NONE, true, false);
defaultSerializationOnCheckbox = toolkit.createButton(globalParamComposite, "", SWT.CHECK);
defaultSerializationOnCheckbox.setLayoutData(gd);
- if (m != null) {
- EList<?> parmList = m.getParam();
- for (int i = 0; i < parmList.size(); i++) {
- ParamType param = (ParamType)parmList.get(i);
- if (param.getName().equals("stream.filter.type")) {
- streamFilterTypeCombo.setText(param.getStringValue());
- }
- else if (param.getName().equals("default.serialization.on")) {
- Boolean boolValue = Boolean.valueOf(param.getStringValue());
- defaultSerializationOnCheckbox.setSelection(boolValue.booleanValue());
- }
- }
- }
- else { // set defaults
- streamFilterTypeCombo.setText("SAX");
- defaultSerializationOnCheckbox.setSelection(true);
- }
+ initGlobalSettingControls();
toolkit.paintBordersFor(globalParamComposite);
-
- streamFilterTypeCombo.addSelectionListener( new SelectionListener() {
-
+
+ streamFilterTypeCombo.addSelectionListener(new SelectionListener() {
+
public void widgetSelected(SelectionEvent e) {
+ if (lockEventFire)
+ return;
String value = streamFilterTypeCombo.getText();
- updateGlobalProperty ("stream.filter.type", value);
+ updateGlobalProperty("stream.filter.type", value);
}
-
+
public void widgetDefaultSelected(SelectionEvent e) {
widgetSelected(e);
}
});
-
- defaultSerializationOnCheckbox.addSelectionListener( new SelectionListener() {
+ defaultSerializationOnCheckbox.addSelectionListener(new SelectionListener() {
+
public void widgetDefaultSelected(SelectionEvent e) {
+ if (lockEventFire)
+ return;
String value = Boolean.toString(defaultSerializationOnCheckbox.getSelection());
- updateGlobalProperty ("default.serialization.on", value);
+ updateGlobalProperty("default.serialization.on", value);
}
public void widgetSelected(SelectionEvent e) {
@@ -425,97 +369,127 @@
});
// am hiding the more open Global Parameters method for now
-// paramViewer = new TableViewer(globalParamComposite);
-// GridData gd = new GridData(SWT.FILL, SWT.FILL, true, true);
-// paramViewer.getControl().setLayoutData(gd);
-// toolkit.paintBordersFor(globalParamComposite);
-// Composite buttonArea = toolkit.createComposite(globalParamComposite);
-// gd = new GridData(GridData.FILL_VERTICAL | GridData.FILL_HORIZONTAL);
-// gd.widthHint = 200;
-// GridLayout bgl = new GridLayout();
-// buttonArea.setLayout(bgl);
-//
-// newParamButton = toolkit.createButton(buttonArea, "New", SWT.NONE);
-// gd = new GridData(GridData.FILL_HORIZONTAL);
-// newParamButton.setLayoutData(gd);
-//
-// removeParamButton = toolkit.createButton(buttonArea, "Remove", SWT.NONE);
-// gd = new GridData(GridData.FILL_HORIZONTAL);
-// removeParamButton.setLayoutData(gd);
-//
-// upParamButton = toolkit.createButton(buttonArea, "Up", SWT.NONE);
-// gd = new GridData(GridData.FILL_HORIZONTAL);
-// upParamButton.setLayoutData(gd);
-//
-// downParamButton = toolkit.createButton(buttonArea, "Down", SWT.NONE);
-// gd = new GridData(GridData.FILL_HORIZONTAL);
-// downParamButton.setLayoutData(gd);
-//
-// paramPropertiesButton = toolkit.createButton(buttonArea, "Properties..", SWT.NONE);
-// gd = new GridData(GridData.FILL_HORIZONTAL);
-// paramPropertiesButton.setLayoutData(gd);
-//
-// paramViewer.setContentProvider(new AdapterFactoryContentProvider(editingDomain.getAdapterFactory()) {
-//
-// @Override
-// public boolean hasChildren(Object object) {
-// return false;
-// }
-//
-// });
-//
-// paramViewer.setLabelProvider(new DecoratingLabelProvider(new AdapterFactoryLabelProvider(editingDomain
-// .getAdapterFactory()) {
-//
-// /*
-// * (non-Javadoc)
-// *
-// * @see
-// * org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider
-// * # getText(java.lang.Object)
-// */
-// @Override
-// public String getText(Object object) {
-// Object obj = AdapterFactoryEditingDomain.unwrap(object);
-// if (obj instanceof AbstractAnyType) {
-// return super.getText(obj);
-// }
-// return super.getText(object);
-// }
-//
-// }, SmooksConfigurationActivator.getDefault().getWorkbench().getDecoratorManager().getLabelDecorator()));
-// if (m != null) {
-// paramViewer.setInput(m);
-// }
-//
-// paramViewer.addDoubleClickListener(new IDoubleClickListener() {
-//
-// public void doubleClick(DoubleClickEvent event) {
-// openParamPropertiesModifyDialog();
-// }
-// });
-//
-// paramViewer.addSelectionChangedListener(new ISelectionChangedListener() {
-//
-// public void selectionChanged(SelectionChangedEvent event) {
-// updateParamButtons();
-// }
-// });
-//
-// hookGlobalParamterButtons();
-// updateParamButtons();
+ // paramViewer = new TableViewer(globalParamComposite);
+ // GridData gd = new GridData(SWT.FILL, SWT.FILL, true, true);
+ // paramViewer.getControl().setLayoutData(gd);
+ // toolkit.paintBordersFor(globalParamComposite);
+ // Composite buttonArea =
+ // toolkit.createComposite(globalParamComposite);
+ // gd = new GridData(GridData.FILL_VERTICAL |
+ // GridData.FILL_HORIZONTAL);
+ // gd.widthHint = 200;
+ // GridLayout bgl = new GridLayout();
+ // buttonArea.setLayout(bgl);
+ //
+ // newParamButton = toolkit.createButton(buttonArea, "New",
+ // SWT.NONE);
+ // gd = new GridData(GridData.FILL_HORIZONTAL);
+ // newParamButton.setLayoutData(gd);
+ //
+ // removeParamButton = toolkit.createButton(buttonArea, "Remove",
+ // SWT.NONE);
+ // gd = new GridData(GridData.FILL_HORIZONTAL);
+ // removeParamButton.setLayoutData(gd);
+ //
+ // upParamButton = toolkit.createButton(buttonArea, "Up", SWT.NONE);
+ // gd = new GridData(GridData.FILL_HORIZONTAL);
+ // upParamButton.setLayoutData(gd);
+ //
+ // downParamButton = toolkit.createButton(buttonArea, "Down",
+ // SWT.NONE);
+ // gd = new GridData(GridData.FILL_HORIZONTAL);
+ // downParamButton.setLayoutData(gd);
+ //
+ // paramPropertiesButton = toolkit.createButton(buttonArea,
+ // "Properties..", SWT.NONE);
+ // gd = new GridData(GridData.FILL_HORIZONTAL);
+ // paramPropertiesButton.setLayoutData(gd);
+ //
+ // paramViewer.setContentProvider(new
+ // AdapterFactoryContentProvider(editingDomain.getAdapterFactory())
+ // {
+ //
+ // @Override
+ // public boolean hasChildren(Object object) {
+ // return false;
+ // }
+ //
+ // });
+ //
+ // paramViewer.setLabelProvider(new DecoratingLabelProvider(new
+ // AdapterFactoryLabelProvider(editingDomain
+ // .getAdapterFactory()) {
+ //
+ // /*
+ // * (non-Javadoc)
+ // *
+ // * @see
+ // * org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider
+ // * # getText(java.lang.Object)
+ // */
+ // @Override
+ // public String getText(Object object) {
+ // Object obj = AdapterFactoryEditingDomain.unwrap(object);
+ // if (obj instanceof AbstractAnyType) {
+ // return super.getText(obj);
+ // }
+ // return super.getText(object);
+ // }
+ //
+ // },
+ // SmooksConfigurationActivator.getDefault().getWorkbench().getDecoratorManager().getLabelDecorator()));
+ // if (m != null) {
+ // paramViewer.setInput(m);
+ // }
+ //
+ // paramViewer.addDoubleClickListener(new IDoubleClickListener() {
+ //
+ // public void doubleClick(DoubleClickEvent event) {
+ // openParamPropertiesModifyDialog();
+ // }
+ // });
+ //
+ // paramViewer.addSelectionChangedListener(new
+ // ISelectionChangedListener() {
+ //
+ // public void selectionChanged(SelectionChangedEvent event) {
+ // updateParamButtons();
+ // }
+ // });
+ //
+ // hookGlobalParamterButtons();
+ // updateParamButtons();
}
}
-// public void graphChanged(SmooksGraphicsExtType extType) {
-//
-// }
+ // public void graphChanged(SmooksGraphicsExtType extType) {
+ //
+ // }
public void graphPropertyChange(EStructuralFeature featre, Object value) {
}
+ protected void initGlobalSettingControls() {
+ ParamsType m = getParamsType();
+ if (m != null) {
+ EList<?> parmList = m.getParam();
+ for (int i = 0; i < parmList.size(); i++) {
+ ParamType param = (ParamType) parmList.get(i);
+ if (param.getName().equals("stream.filter.type")) {
+ streamFilterTypeCombo.setText(param.getStringValue());
+ } else if (param.getName().equals("default.serialization.on")) {
+ Boolean boolValue = Boolean.valueOf(param.getStringValue());
+ defaultSerializationOnCheckbox.setSelection(boolValue.booleanValue());
+ }
+ }
+ } else { // set defaults
+ streamFilterTypeCombo.setText("SAX");
+ defaultSerializationOnCheckbox.setSelection(true);
+ }
+ }
+
public ModelPanelCreator getDefaultSettingPanelCreator() {
if (defaultSettingPanelCreator == null) {
defaultSettingPanelCreator = new ModelPanelCreator();
@@ -523,9 +497,9 @@
return defaultSettingPanelCreator;
}
-// public void inputTypeChanged(SmooksGraphicsExtType extType) {
-//
-// }
+ // public void inputTypeChanged(SmooksGraphicsExtType extType) {
+ //
+ // }
public void validateEnd(List<Diagnostic> diagnosticResult) {
ModelPanelCreator creator = getDefaultSettingPanelCreator();
@@ -538,28 +512,47 @@
public void sourceChange(Object model) {
lockEventFire = true;
-// SmooksGraphicsExtType extType = smooksModelProvider.getSmooksGraphicsExt();
-// if (extType == null) {
-// return;
-// }
+ streamFilterTypeCombo.setEnabled(true);
+ defaultSerializationOnCheckbox.setEnabled(true);
+ String version = getSmooksVersion();
+ if (version == null)
+ version = "";
+ versionCombo.setText(version);
-// String name = extType.getName();
-// if (name != null)
-// smooksNameText.setText(name);
-//
-// String author = extType.getAuthor();
-// if (author != null)
-// smooksAuthorText.setText(author);
+ if (model == null) {
+ // the file was broken
+ streamFilterTypeCombo.setEnabled(false);
+ defaultSerializationOnCheckbox.setEnabled(false);
+ defaultSerializationOnCheckbox.setSelection(false);
+ } else {
+ initGlobalSettingControls();
+ }
+
+ // SmooksGraphicsExtType extType =
+ // smooksModelProvider.getSmooksGraphicsExt();
+ // if (extType == null) {
+ // return;
+ // }
+
+ // String name = extType.getName();
+ // if (name != null)
+ // smooksNameText.setText(name);
+ //
+ // String author = extType.getAuthor();
+ // if (author != null)
+ // smooksAuthorText.setText(author);
+
lockEventFire = false;
-// disposeDefaultSettingCompositeControls();
-// createDefaultSection(defaultSettingComposite, this.getManagedForm().getToolkit());
-// defaultSettingComposite.getParent().layout();
-//
-// paramViewer.setInput(getParamsType());
-// conditionViewer.setInput(getConditionsType());
-// profileViewer.setInput(getProfilesType());
+ // disposeDefaultSettingCompositeControls();
+ // createDefaultSection(defaultSettingComposite,
+ // this.getManagedForm().getToolkit());
+ // defaultSettingComposite.getParent().layout();
+ //
+ // paramViewer.setInput(getParamsType());
+ // conditionViewer.setInput(getConditionsType());
+ // profileViewer.setInput(getProfilesType());
}
protected void disposeCompositeControls(Composite composite, Control[] ignoreControl) {
@@ -595,824 +588,920 @@
private String getSmooksVersion() {
if (smooksModelProvider != null) {
return smooksModelProvider.getPlatformVersion();
-// if (ext != null) {
-// return ext.getPlatformVersion();
-// }
+ // if (ext != null) {
+ // return ext.getPlatformVersion();
+ // }
}
return null;
}
-/*
- * The following code has been commented out for now. We may add more properties as they become necessary,
- * but for now, this is just extraneous code and confusing UI for the user that doesn't add much
- * functionality.
- */
-// protected void createProfilesSection(Composite profilesComposite, FormToolkit toolkit) {
-// if (smooksModelProvider != null) {
-// AdapterFactoryEditingDomain editingDomain = (AdapterFactoryEditingDomain) smooksModelProvider
-// .getEditingDomain();
-// EObject profiles = getProfilesType();
-// // if (m == null)
-// // return;
-//
-// profileViewer = new TableViewer(profilesComposite);
-// GridData gd = new GridData(GridData.FILL_BOTH);
-// profileViewer.getControl().setLayoutData(gd);
-// toolkit.paintBordersFor(profilesComposite);
-// Composite buttonArea = toolkit.createComposite(profilesComposite);
-// gd = new GridData(GridData.FILL_VERTICAL);
-// gd.widthHint = 30;
-// GridLayout bgl = new GridLayout();
-// buttonArea.setLayout(bgl);
-//
-// newProfileButton = toolkit.createButton(buttonArea, "New", SWT.NONE);
-// gd = new GridData(GridData.FILL_HORIZONTAL);
-// newProfileButton.setLayoutData(gd);
-//
-// removeProfileButton = toolkit.createButton(buttonArea, "Remove", SWT.NONE);
-// gd = new GridData(GridData.FILL_HORIZONTAL);
-// removeProfileButton.setLayoutData(gd);
-//
-// upProfileButton = toolkit.createButton(buttonArea, "Up", SWT.NONE);
-// gd = new GridData(GridData.FILL_HORIZONTAL);
-// upProfileButton.setLayoutData(gd);
-//
-// downProfileButton = toolkit.createButton(buttonArea, "Down", SWT.NONE);
-// gd = new GridData(GridData.FILL_HORIZONTAL);
-// downProfileButton.setLayoutData(gd);
-//
-// profilePropertiesButton = toolkit.createButton(buttonArea, "Properties..", SWT.NONE);
-// gd = new GridData(GridData.FILL_HORIZONTAL);
-// profilePropertiesButton.setLayoutData(gd);
-//
-// profileViewer.setContentProvider(new AdapterFactoryContentProvider(editingDomain.getAdapterFactory()) {
-//
-// @Override
-// public boolean hasChildren(Object object) {
-// return false;
-// }
-//
-// });
-//
-// profileViewer.setLabelProvider(new DecoratingLabelProvider(new AdapterFactoryLabelProvider(editingDomain
-// .getAdapterFactory()) {
-//
-// /*
-// * (non-Javadoc)
-// *
-// * @see
-// * org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider
-// * # getText(java.lang.Object)
-// */
-// @Override
-// public String getText(Object object) {
-// Object obj = AdapterFactoryEditingDomain.unwrap(object);
-// if (obj instanceof AbstractAnyType) {
-// return super.getText(obj);
-// }
-// return super.getText(object);
-// }
-//
-// }, SmooksConfigurationActivator.getDefault().getWorkbench().getDecoratorManager().getLabelDecorator()));
-//
-// if (profiles != null) {
-// profileViewer.setInput(profiles);
-// }
-//
-// profileViewer.addDoubleClickListener(new IDoubleClickListener() {
-//
-// public void doubleClick(DoubleClickEvent event) {
-// openProfilePropertiesModifyDialog();
-// }
-// });
-//
-// profileViewer.addSelectionChangedListener(new ISelectionChangedListener() {
-//
-// public void selectionChanged(SelectionChangedEvent event) {
-// updateProfilesButtons();
-// }
-// });
-//
-// hookProfilesButtons();
-// updateProfilesButtons();
-// }
-// }
-//
-// protected void openProfilePropertiesModifyDialog() {
-// IStructuredSelection selection = (IStructuredSelection) profileViewer.getSelection();
-// if (selection == null)
-// return;
-// Object obj = selection.getFirstElement();
-// if (obj instanceof EObject) {
-// EObject profile = (EObject) obj;
-// EObject parent = getProfilesType();
-// EStructuralFeature profileFeature = null;
-// if (SmooksConstants.VERSION_1_0.equals(getSmooksVersion())) {
-// profileFeature = org.jboss.tools.smooks10.model.smooks.SmooksPackage.Literals.PROFILES_TYPE__PROFILE;
-// }
-// if (SmooksConstants.VERSION_1_1.equals(getSmooksVersion())) {
-// profileFeature = SmooksPackage.Literals.PROFILES_TYPE__PROFILE;
-// }
-//
-// NewOrModifySmooksElementDialog dialog = new NewOrModifySmooksElementDialog(getEditorSite().getShell(),
-// profileFeature, profile, parent, getManagedForm().getToolkit(), smooksModelProvider,
-// SmooksConfigurationOverviewPage.this, true);
-// dialog.open();
-// }
-// }
-//
-// protected void updateProfilesButtons() {
-// if (getSmooksVersion() == null) {
-// profilePropertiesButton.setEnabled(false);
-// newProfileButton.setEnabled(false);
-// removeProfileButton.setEnabled(false);
-// upProfileButton.setEnabled(false);
-// downProfileButton.setEnabled(false);
-// return;
-// }
-// profilePropertiesButton.setEnabled(true);
-// removeProfileButton.setEnabled(true);
-// IStructuredSelection selection = (IStructuredSelection) profileViewer.getSelection();
-// if (selection == null) {
-// profilePropertiesButton.setEnabled(false);
-// removeProfileButton.setEnabled(false);
-// upProfileButton.setEnabled(false);
-// downProfileButton.setEnabled(false);
-// } else {
-// if (selection.getFirstElement() == null) {
-// profilePropertiesButton.setEnabled(false);
-// removeProfileButton.setEnabled(false);
-// upProfileButton.setEnabled(false);
-// downProfileButton.setEnabled(false);
-// return;
-// }
-//
-// Object obj = selection.getFirstElement();
-// if (obj instanceof EObject) {
-// EObject profilesType = getProfilesType();
-// if (profilesType == null)
-// return;
-// EObject v = (EObject) AdapterFactoryEditingDomain.unwrap(obj);
-// EObject parent = v.eContainer();
-// int index = parent.eContents().indexOf(v);
-// Command command = MoveCommand.create(smooksModelProvider.getEditingDomain(), parent, null, obj,
-// index - 1);
-// upProfileButton.setEnabled(command.canExecute());
-//
-// Command command1 = MoveCommand.create(smooksModelProvider.getEditingDomain(), parent, null, obj,
-// index + 1);
-// downProfileButton.setEnabled(command1.canExecute());
-// }
-//
-// if (selection.size() > 1) {
-// profilePropertiesButton.setEnabled(false);
-// removeProfileButton.setEnabled(false);
-// }
-// }
-//
-// }
-//
-// protected void hookProfilesButtons() {
-// newProfileButton.addSelectionListener(new SelectionAdapter() {
-//
-// @Override
-// public void widgetSelected(SelectionEvent e) {
-// if (getSmooksVersion() == null) {
-// return;
-// }
-// EObject model = null;
-// if (SmooksConstants.VERSION_1_0.equals(getSmooksVersion())) {
-// model = org.jboss.tools.smooks10.model.smooks.SmooksFactory.eINSTANCE.createProfileType();
-// }
-// if (SmooksConstants.VERSION_1_1.equals(getSmooksVersion())) {
-// model = SmooksFactory.eINSTANCE.createProfileType();
-// }
-// EObject parent = getProfilesType();
-// boolean newParent = false;
-// if (parent == null) {
-// newParent = true;
-// if (SmooksConstants.VERSION_1_0.equals(getSmooksVersion())) {
-// parent = org.jboss.tools.smooks10.model.smooks.SmooksFactory.eINSTANCE.createProfilesType();
-// }
-// if (SmooksConstants.VERSION_1_1.equals(getSmooksVersion())) {
-// parent = SmooksFactory.eINSTANCE.createProfilesType();
-// }
-// }
-// EStructuralFeature profileFeature = null;
-// if (SmooksConstants.VERSION_1_0.equals(getSmooksVersion())) {
-// profileFeature = org.jboss.tools.smooks10.model.smooks.SmooksPackage.Literals.PROFILES_TYPE__PROFILE;
-// }
-// if (SmooksConstants.VERSION_1_1.equals(getSmooksVersion())) {
-// profileFeature = SmooksPackage.Literals.PROFILES_TYPE__PROFILE;
-// }
-// NewOrModifySmooksElementDialog dialog = new NewOrModifySmooksElementDialog(getEditorSite().getShell(),
-// profileFeature, model, parent, getManagedForm().getToolkit(), smooksModelProvider,
-// SmooksConfigurationOverviewPage.this, false);
-//
-// EStructuralFeature profilesFeature = null;
-// if (SmooksConstants.VERSION_1_0.equals(getSmooksVersion())) {
-// profilesFeature = org.jboss.tools.smooks10.model.smooks.SmooksPackage.Literals.SMOOKS_RESOURCE_LIST_TYPE__PROFILES;
-// }
-// if (SmooksConstants.VERSION_1_1.equals(getSmooksVersion())) {
-// profilesFeature = SmooksPackage.Literals.SMOOKS_RESOURCE_LIST_TYPE__PROFILES;
-// }
-// if (dialog.open() == Dialog.OK && newParent) {
-// EObject resource = getSmooksResourceList();
-// if (resource == null)
-// return;
-// Command command = SetCommand.create(smooksModelProvider.getEditingDomain(), resource,
-// profilesFeature, parent);
-// if (command.canExecute()) {
-// smooksModelProvider.getEditingDomain().getCommandStack().execute(command);
-// profileViewer.setInput(parent);
-// }
-// }
-// super.widgetSelected(e);
-// }
-//
-// });
-// removeProfileButton.addSelectionListener(new SelectionAdapter() {
-//
-// @Override
-// public void widgetSelected(SelectionEvent e) {
-// IStructuredSelection selection = (IStructuredSelection) profileViewer.getSelection();
-// if (selection == null)
-// return;
-// Object obj = selection.getFirstElement();
-// if (obj instanceof EObject) {
-// EObject profile = (EObject) obj;
-// EObject parent = getProfilesType();
-// if (parent == null)
-// return;
-// CompoundCommand compoundCommand = new CompoundCommand();
-// Command command = RemoveCommand.create(smooksModelProvider.getEditingDomain(), profile);
-// compoundCommand.append(command);
-// if (parent.eContents().size() == 1) {
-// // remove parent;
-// Command command1 = RemoveCommand.create(smooksModelProvider.getEditingDomain(), parent);
-// compoundCommand.append(command1);
-// }
-// smooksModelProvider.getEditingDomain().getCommandStack().execute(compoundCommand);
-// }
-// }
-//
-// });
-// upProfileButton.addSelectionListener(new SelectionAdapter() {
-//
-// @Override
-// public void widgetSelected(SelectionEvent e) {
-// IStructuredSelection selection = (IStructuredSelection) profileViewer.getSelection();
-// if (selection == null)
-// return;
-// Object obj = selection.getFirstElement();
-// if (obj instanceof EObject) {
-// EObject profilesType = getProfilesType();
-// if (profilesType == null)
-// return;
-// EObject v = (EObject) AdapterFactoryEditingDomain.unwrap(obj);
-// EObject parent = v.eContainer();
-// int index = parent.eContents().indexOf(v);
-// Command command = MoveCommand.create(smooksModelProvider.getEditingDomain(), parent, null, obj,
-// index - 1);
-// smooksModelProvider.getEditingDomain().getCommandStack().execute(command);
-// }
-// }
-//
-// });
-// downProfileButton.addSelectionListener(new SelectionAdapter() {
-//
-// @Override
-// public void widgetSelected(SelectionEvent e) {
-// IStructuredSelection selection = (IStructuredSelection) profileViewer.getSelection();
-// if (selection == null)
-// return;
-// Object obj = selection.getFirstElement();
-// if (obj instanceof EObject) {
-// EObject profilesType = getProfilesType();
-// if (profilesType == null)
-// return;
-// EObject v = (EObject) AdapterFactoryEditingDomain.unwrap(obj);
-// EObject parent = v.eContainer();
-// int index = parent.eContents().indexOf(v);
-// Command command = MoveCommand.create(smooksModelProvider.getEditingDomain(), parent, null, obj,
-// index + 1);
-// smooksModelProvider.getEditingDomain().getCommandStack().execute(command);
-// }
-// }
-//
-// });
-// profilePropertiesButton.addSelectionListener(new SelectionAdapter() {
-//
-// @Override
-// public void widgetSelected(SelectionEvent e) {
-// openProfilePropertiesModifyDialog();
-// super.widgetSelected(e);
-// }
-//
-// });
-//
-// }
-//
-// private EObject getProfilesType() {
-// if (smooksModelProvider != null) {
-// EObject smooksModel = smooksModelProvider.getSmooksModel();
-// if (smooksModel instanceof DocumentRoot) {
-// EObject m = ((DocumentRoot) smooksModel).getSmooksResourceList().getProfiles();
-// return m;
-// }
-// if (smooksModel instanceof org.jboss.tools.smooks10.model.smooks.DocumentRoot) {
-// EObject m = ((org.jboss.tools.smooks10.model.smooks.DocumentRoot) smooksModel).getSmooksResourceList()
-// .getProfiles();
-// return m;
-// }
-// }
-// return null;
-// }
-//
-// private ConditionsType getConditionsType() {
-// if (smooksModelProvider != null) {
-// EObject smooksModel = smooksModelProvider.getSmooksModel();
-// if (smooksModel instanceof DocumentRoot) {
-// EObject m = ((DocumentRoot) smooksModel).getSmooksResourceList().getConditions();
-// return (ConditionsType) m;
-// }
-// }
-// return null;
-// }
-//
-// private void createConditionsSection(Composite conditionComposite, FormToolkit toolkit) {
-// if (smooksModelProvider != null) {
-// AdapterFactoryEditingDomain editingDomain = (AdapterFactoryEditingDomain) smooksModelProvider
-// .getEditingDomain();
-// ConditionsType conditions = getConditionsType();
-// // if (m == null)
-// // return;
-//
-// conditionViewer = new TableViewer(conditionComposite);
-// GridData gd = new GridData(GridData.FILL_BOTH);
-// conditionViewer.getControl().setLayoutData(gd);
-// toolkit.paintBordersFor(conditionComposite);
-// Composite buttonArea = toolkit.createComposite(conditionComposite);
-// gd = new GridData(GridData.FILL_VERTICAL);
-// gd.widthHint = 30;
-// GridLayout bgl = new GridLayout();
-// buttonArea.setLayout(bgl);
-//
-// newConditionButton = toolkit.createButton(buttonArea, "New", SWT.NONE);
-// gd = new GridData(GridData.FILL_HORIZONTAL);
-// newConditionButton.setLayoutData(gd);
-//
-// removeConditionButton = toolkit.createButton(buttonArea, "Remove", SWT.NONE);
-// gd = new GridData(GridData.FILL_HORIZONTAL);
-// removeConditionButton.setLayoutData(gd);
-//
-// upConditionButton = toolkit.createButton(buttonArea, "Up", SWT.NONE);
-// gd = new GridData(GridData.FILL_HORIZONTAL);
-// upConditionButton.setLayoutData(gd);
-//
-// downConditionButton = toolkit.createButton(buttonArea, "Down", SWT.NONE);
-// gd = new GridData(GridData.FILL_HORIZONTAL);
-// downConditionButton.setLayoutData(gd);
-//
-// conditionPropertiesButton = toolkit.createButton(buttonArea, "Properties..", SWT.NONE);
-// gd = new GridData(GridData.FILL_HORIZONTAL);
-// conditionPropertiesButton.setLayoutData(gd);
-//
-// conditionViewer.setContentProvider(new AdapterFactoryContentProvider(editingDomain.getAdapterFactory()) {
-//
-// @Override
-// public boolean hasChildren(Object object) {
-// return false;
-// }
-//
-// });
-//
-// conditionViewer.setLabelProvider(new DecoratingLabelProvider(new AdapterFactoryLabelProvider(editingDomain
-// .getAdapterFactory()) {
-//
-// /*
-// * (non-Javadoc)
-// *
-// * @see
-// * org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider
-// * # getText(java.lang.Object)
-// */
-// @Override
-// public String getText(Object object) {
-// Object obj = AdapterFactoryEditingDomain.unwrap(object);
-// if (obj instanceof AbstractAnyType) {
-// return super.getText(obj);
-// }
-// return super.getText(object);
-// }
-//
-// }, SmooksConfigurationActivator.getDefault().getWorkbench().getDecoratorManager().getLabelDecorator()));
-//
-// if (conditions != null) {
-// conditionViewer.setInput(conditions);
-// }
-//
-// conditionViewer.addDoubleClickListener(new IDoubleClickListener() {
-//
-// public void doubleClick(DoubleClickEvent event) {
-// openConditionPropertiesModifyDialog();
-// }
-// });
-//
-// conditionViewer.addSelectionChangedListener(new ISelectionChangedListener() {
-//
-// public void selectionChanged(SelectionChangedEvent event) {
-// updateConditionsButtons();
-// }
-// });
-//
-// hookConditionsButtons();
-// updateConditionsButtons();
-// }
-// }
-//
-// protected void hookConditionsButtons() {
-// newConditionButton.addSelectionListener(new SelectionAdapter() {
-//
-// @Override
-// public void widgetSelected(SelectionEvent e) {
-// if (getSmooksVersion() == null || getSmooksVersion().equals(SmooksConstants.VERSION_1_0)) {
-// return;
-// }
-// ConditionType condition = SmooksFactory.eINSTANCE.createConditionType();
-// ConditionsType parent = getConditionsType();
-// boolean newParent = false;
-// if (parent == null) {
-// newParent = true;
-// parent = SmooksFactory.eINSTANCE.createConditionsType();
-//
-// }
-// NewOrModifySmooksElementDialog dialog = new NewOrModifySmooksElementDialog(getEditorSite().getShell(),
-// SmooksPackage.Literals.CONDITIONS_TYPE__CONDITION, condition, parent, getManagedForm()
-// .getToolkit(), smooksModelProvider, SmooksConfigurationOverviewPage.this, false);
-// if (dialog.open() == Dialog.OK && newParent) {
-// EObject resource = getSmooksResourceList();
-// if (resource == null)
-// return;
-// Command command = SetCommand.create(smooksModelProvider.getEditingDomain(), resource,
-// SmooksPackage.Literals.SMOOKS_RESOURCE_LIST_TYPE__CONDITIONS, parent);
-// if (command.canExecute()) {
-// smooksModelProvider.getEditingDomain().getCommandStack().execute(command);
-// conditionViewer.setInput(parent);
-// }
-// }
-// super.widgetSelected(e);
-// }
-//
-// });
-// removeConditionButton.addSelectionListener(new SelectionAdapter() {
-//
-// @Override
-// public void widgetSelected(SelectionEvent e) {
-// IStructuredSelection selection = (IStructuredSelection) conditionViewer.getSelection();
-// if (selection == null)
-// return;
-// Object obj = selection.getFirstElement();
-// if (obj instanceof ConditionType) {
-// ConditionType condition = (ConditionType) obj;
-// ConditionsType parent = getConditionsType();
-// if (parent == null)
-// return;
-// CompoundCommand compoundCommand = new CompoundCommand();
-// Command command = RemoveCommand.create(smooksModelProvider.getEditingDomain(), condition);
-// compoundCommand.append(command);
-// if (parent.getCondition().size() == 1) {
-// // remove parent;
-// Command command1 = RemoveCommand.create(smooksModelProvider.getEditingDomain(), parent);
-// compoundCommand.append(command1);
-// }
-// smooksModelProvider.getEditingDomain().getCommandStack().execute(compoundCommand);
-// }
-// }
-//
-// });
-// upConditionButton.addSelectionListener(new SelectionAdapter() {
-//
-// @Override
-// public void widgetSelected(SelectionEvent e) {
-// IStructuredSelection selection = (IStructuredSelection) conditionViewer.getSelection();
-// if (selection == null)
-// return;
-// Object obj = selection.getFirstElement();
-// if (obj instanceof ConditionType) {
-// ConditionsType conditionsType = getConditionsType();
-// if (conditionsType == null)
-// return;
-// EObject v = (EObject) AdapterFactoryEditingDomain.unwrap(obj);
-// EObject parent = v.eContainer();
-// int index = parent.eContents().indexOf(v);
-// Command command = MoveCommand.create(smooksModelProvider.getEditingDomain(), parent, null, obj,
-// index - 1);
-// smooksModelProvider.getEditingDomain().getCommandStack().execute(command);
-// }
-// }
-//
-// });
-// downConditionButton.addSelectionListener(new SelectionAdapter() {
-//
-// @Override
-// public void widgetSelected(SelectionEvent e) {
-// IStructuredSelection selection = (IStructuredSelection) conditionViewer.getSelection();
-// if (selection == null)
-// return;
-// Object obj = selection.getFirstElement();
-// if (obj instanceof ConditionType) {
-// ConditionsType conditionsType = getConditionsType();
-// if (conditionsType == null)
-// return;
-// EObject v = (EObject) AdapterFactoryEditingDomain.unwrap(obj);
-// EObject parent = v.eContainer();
-// int index = parent.eContents().indexOf(v);
-// Command command = MoveCommand.create(smooksModelProvider.getEditingDomain(), parent, null, obj,
-// index + 1);
-// smooksModelProvider.getEditingDomain().getCommandStack().execute(command);
-// }
-// }
-//
-// });
-// conditionPropertiesButton.addSelectionListener(new SelectionAdapter() {
-//
-// @Override
-// public void widgetSelected(SelectionEvent e) {
-// openConditionPropertiesModifyDialog();
-// super.widgetSelected(e);
-// }
-//
-// });
-//
-// }
-//
-// protected void updateConditionsButtons() {
-// if (getSmooksVersion() == null || getSmooksVersion().equals(SmooksConstants.VERSION_1_0)) {
-// conditionPropertiesButton.setEnabled(false);
-// newConditionButton.setEnabled(false);
-// removeConditionButton.setEnabled(false);
-// upConditionButton.setEnabled(false);
-// downConditionButton.setEnabled(false);
-// return;
-// }
-// conditionPropertiesButton.setEnabled(true);
-// removeConditionButton.setEnabled(true);
-// IStructuredSelection selection = (IStructuredSelection) conditionViewer.getSelection();
-// if (selection == null) {
-// conditionPropertiesButton.setEnabled(false);
-// removeConditionButton.setEnabled(false);
-// upConditionButton.setEnabled(false);
-// downConditionButton.setEnabled(false);
-// } else {
-// if (selection.getFirstElement() == null) {
-// conditionPropertiesButton.setEnabled(false);
-// removeConditionButton.setEnabled(false);
-// upConditionButton.setEnabled(false);
-// downConditionButton.setEnabled(false);
-// return;
-// }
-//
-// Object obj = selection.getFirstElement();
-// if (obj instanceof ConditionType) {
-// ConditionsType conditionsType = getConditionsType();
-// if (conditionsType == null)
-// return;
-// EObject v = (EObject) AdapterFactoryEditingDomain.unwrap(obj);
-// EObject parent = v.eContainer();
-// int index = parent.eContents().indexOf(v);
-// Command command = MoveCommand.create(smooksModelProvider.getEditingDomain(), parent, null, obj,
-// index - 1);
-// upConditionButton.setEnabled(command.canExecute());
-//
-// Command command1 = MoveCommand.create(smooksModelProvider.getEditingDomain(), parent, null, obj,
-// index + 1);
-// downConditionButton.setEnabled(command1.canExecute());
-// }
-//
-// if (selection.size() > 1) {
-// conditionPropertiesButton.setEnabled(false);
-// removeConditionButton.setEnabled(false);
-// }
-// }
-// }
-//
-// protected void openConditionPropertiesModifyDialog() {
-// IStructuredSelection selection = (IStructuredSelection) conditionViewer.getSelection();
-// if (selection == null)
-// return;
-// Object obj = selection.getFirstElement();
-// if (obj instanceof ConditionType) {
-// ConditionType condition = (ConditionType) obj;
-// ConditionsType parent = getConditionsType();
-// NewOrModifySmooksElementDialog dialog = new NewOrModifySmooksElementDialog(getEditorSite().getShell(),
-// SmooksPackage.Literals.CONDITIONS_TYPE__CONDITION, condition, parent,
-// getManagedForm().getToolkit(), smooksModelProvider, SmooksConfigurationOverviewPage.this, true);
-// dialog.open();
-// }
-// }
-//
-// protected void updateParamButtons() {
-// if (getSmooksVersion() == null || getSmooksVersion().equals(SmooksConstants.VERSION_1_0)) {
-// paramPropertiesButton.setEnabled(false);
-// newParamButton.setEnabled(false);
-// removeParamButton.setEnabled(false);
-// upParamButton.setEnabled(false);
-// downParamButton.setEnabled(false);
-// return;
-// }
-// paramPropertiesButton.setEnabled(true);
-// removeParamButton.setEnabled(true);
-// IStructuredSelection selection = (IStructuredSelection) paramViewer.getSelection();
-// if (selection == null) {
-// paramPropertiesButton.setEnabled(false);
-// removeParamButton.setEnabled(false);
-// upParamButton.setEnabled(false);
-// downParamButton.setEnabled(false);
-// } else {
-// if (selection.getFirstElement() == null) {
-// paramPropertiesButton.setEnabled(false);
-// removeParamButton.setEnabled(false);
-// upParamButton.setEnabled(false);
-// downParamButton.setEnabled(false);
-// return;
-// }
-//
-// Object obj = selection.getFirstElement();
-// if (obj instanceof ParamType) {
-// ParamsType paramsType = getParamsType();
-// if (paramsType == null)
-// return;
-// EObject v = (EObject) AdapterFactoryEditingDomain.unwrap(obj);
-// EObject parent = v.eContainer();
-// int index = parent.eContents().indexOf(v);
-// Command command = MoveCommand.create(smooksModelProvider.getEditingDomain(), parent, null, obj,
-// index - 1);
-// upParamButton.setEnabled(command.canExecute());
-//
-// Command command1 = MoveCommand.create(smooksModelProvider.getEditingDomain(), parent, null, obj,
-// index + 1);
-// downParamButton.setEnabled(command1.canExecute());
-// }
-//
-// if (selection.size() > 1) {
-// paramPropertiesButton.setEnabled(false);
-// removeParamButton.setEnabled(false);
-// }
-// }
-//
-// }
-//
-// private void hookGlobalParamterButtons() {
-// newParamButton.addSelectionListener(new SelectionAdapter() {
-//
-// @Override
-// public void widgetSelected(SelectionEvent e) {
-// if (getSmooksVersion() == null || getSmooksVersion().equals(SmooksConstants.VERSION_1_0)) {
-// return;
-// }
-// ParamType param = SmooksFactory.eINSTANCE.createParamType();
-// ParamsType parent = getParamsType();
-// boolean newParent = false;
-// if (parent == null) {
-// newParent = true;
-// parent = SmooksFactory.eINSTANCE.createParamsType();
-// EObject resource = getSmooksResourceList();
-// if (resource == null)
-// return;
-// Command command = SetCommand.create(smooksModelProvider.getEditingDomain(), resource,
-// SmooksPackage.Literals.SMOOKS_RESOURCE_LIST_TYPE__PARAMS, parent);
-// if (command.canExecute()) {
-// ((SmooksResourceListType) resource).setParams((ParamsType) parent);
-// paramViewer.setInput(parent);
-// }
-// }
-// NewOrModifySmooksElementDialog dialog = new NewOrModifySmooksElementDialog(getEditorSite().getShell(),
-// SmooksPackage.Literals.PARAMS_TYPE__PARAM, param, parent, getManagedForm().getToolkit(),
-// smooksModelProvider, SmooksConfigurationOverviewPage.this, false);
-// if (dialog.open() == Dialog.CANCEL && newParent) {
-// EObject resource = getSmooksResourceList();
-// ((SmooksResourceListType) resource).setParams(null);
-// paramViewer.setInput(null);
-// }
-// super.widgetSelected(e);
-// }
-//
-// });
-// removeParamButton.addSelectionListener(new SelectionAdapter() {
-//
-// @Override
-// public void widgetSelected(SelectionEvent e) {
-// IStructuredSelection selection = (IStructuredSelection) paramViewer.getSelection();
-// if (selection == null)
-// return;
-// Object obj = selection.getFirstElement();
-// if (obj instanceof ParamType) {
-// ParamType param = (ParamType) obj;
-// ParamsType parent = getParamsType();
-// if (parent == null)
-// return;
-// CompoundCommand compoundCommand = new CompoundCommand();
-// Command command = RemoveCommand.create(smooksModelProvider.getEditingDomain(), param);
-// compoundCommand.append(command);
-// if (parent.getParam().size() == 1) {
-// // remove parent;
-// Command command1 = RemoveCommand.create(smooksModelProvider.getEditingDomain(), parent);
-// compoundCommand.append(command1);
-// }
-// smooksModelProvider.getEditingDomain().getCommandStack().execute(compoundCommand);
-// }
-// }
-//
-// });
-// upParamButton.addSelectionListener(new SelectionAdapter() {
-//
-// @Override
-// public void widgetSelected(SelectionEvent e) {
-// IStructuredSelection selection = (IStructuredSelection) paramViewer.getSelection();
-// if (selection == null)
-// return;
-// Object obj = selection.getFirstElement();
-// if (obj instanceof ParamType) {
-// ParamsType paramsType = getParamsType();
-// if (paramsType == null)
-// return;
-// EObject v = (EObject) AdapterFactoryEditingDomain.unwrap(obj);
-// EObject parent = v.eContainer();
-// int index = parent.eContents().indexOf(v);
-// Command command = MoveCommand.create(smooksModelProvider.getEditingDomain(), parent, null, obj,
-// index - 1);
-// smooksModelProvider.getEditingDomain().getCommandStack().execute(command);
-// }
-// }
-//
-// });
-// downParamButton.addSelectionListener(new SelectionAdapter() {
-//
-// @Override
-// public void widgetSelected(SelectionEvent e) {
-// IStructuredSelection selection = (IStructuredSelection) paramViewer.getSelection();
-// if (selection == null)
-// return;
-// Object obj = selection.getFirstElement();
-// if (obj instanceof ParamType) {
-// ParamsType paramsType = getParamsType();
-// if (paramsType == null)
-// return;
-// EObject v = (EObject) AdapterFactoryEditingDomain.unwrap(obj);
-// EObject parent = v.eContainer();
-// int index = parent.eContents().indexOf(v);
-// Command command = MoveCommand.create(smooksModelProvider.getEditingDomain(), parent, null, obj,
-// index + 1);
-// smooksModelProvider.getEditingDomain().getCommandStack().execute(command);
-// }
-// }
-//
-// });
-// paramPropertiesButton.addSelectionListener(new SelectionAdapter() {
-//
-// @Override
-// public void widgetSelected(SelectionEvent e) {
-// openParamPropertiesModifyDialog();
-// super.widgetSelected(e);
-// }
-//
-// });
-// }
-//
-// protected void openParamPropertiesModifyDialog() {
-// IStructuredSelection selection = (IStructuredSelection) paramViewer.getSelection();
-// if (selection == null)
-// return;
-// Object obj = selection.getFirstElement();
-// if (obj instanceof ParamType) {
-// ParamType param = (ParamType) obj;
-// ParamsType parent = getParamsType();
-// NewOrModifySmooksElementDialog dialog = new NewOrModifySmooksElementDialog(getEditorSite().getShell(),
-// SmooksPackage.Literals.PARAMS_TYPE__PARAM, param, parent, getManagedForm().getToolkit(),
-// smooksModelProvider, SmooksConfigurationOverviewPage.this, true);
-// dialog.open();
-// }
-// }
-//
-// private void createDefaultSection(Composite parent, FormToolkit toolkit) {
-// ModelPanelCreator defaultSettingPanelCreator = getDefaultSettingPanelCreator();
-// EObject model = getSmooksResourceList();
-// if (model != null) {
-// AdapterFactoryEditingDomain editingDomain = (AdapterFactoryEditingDomain) smooksModelProvider
-// .getEditingDomain();
-// IItemPropertySource itemPropertySource = (IItemPropertySource) editingDomain.getAdapterFactory().adapt(
-// model, IItemPropertySource.class);
-// if (model != null) {
-// defaultSettingPanelCreator.createModelPanel(model, toolkit, parent, itemPropertySource,
-// smooksModelProvider, getEditor());
-// }
-// }
-//
-// }
-//
-// private void disposeDefaultSettingCompositeControls() {
-// disposeCompositeControls(defaultSettingComposite, null);
-// }
+ /*
+ * The following code has been commented out for now. We may add more
+ * properties as they become necessary, but for now, this is just extraneous
+ * code and confusing UI for the user that doesn't add much functionality.
+ */
+ // protected void createProfilesSection(Composite profilesComposite,
+ // FormToolkit toolkit) {
+ // if (smooksModelProvider != null) {
+ // AdapterFactoryEditingDomain editingDomain = (AdapterFactoryEditingDomain)
+ // smooksModelProvider
+ // .getEditingDomain();
+ // EObject profiles = getProfilesType();
+ // // if (m == null)
+ // // return;
+ //
+ // profileViewer = new TableViewer(profilesComposite);
+ // GridData gd = new GridData(GridData.FILL_BOTH);
+ // profileViewer.getControl().setLayoutData(gd);
+ // toolkit.paintBordersFor(profilesComposite);
+ // Composite buttonArea = toolkit.createComposite(profilesComposite);
+ // gd = new GridData(GridData.FILL_VERTICAL);
+ // gd.widthHint = 30;
+ // GridLayout bgl = new GridLayout();
+ // buttonArea.setLayout(bgl);
+ //
+ // newProfileButton = toolkit.createButton(buttonArea, "New", SWT.NONE);
+ // gd = new GridData(GridData.FILL_HORIZONTAL);
+ // newProfileButton.setLayoutData(gd);
+ //
+ // removeProfileButton = toolkit.createButton(buttonArea, "Remove",
+ // SWT.NONE);
+ // gd = new GridData(GridData.FILL_HORIZONTAL);
+ // removeProfileButton.setLayoutData(gd);
+ //
+ // upProfileButton = toolkit.createButton(buttonArea, "Up", SWT.NONE);
+ // gd = new GridData(GridData.FILL_HORIZONTAL);
+ // upProfileButton.setLayoutData(gd);
+ //
+ // downProfileButton = toolkit.createButton(buttonArea, "Down", SWT.NONE);
+ // gd = new GridData(GridData.FILL_HORIZONTAL);
+ // downProfileButton.setLayoutData(gd);
+ //
+ // profilePropertiesButton = toolkit.createButton(buttonArea,
+ // "Properties..", SWT.NONE);
+ // gd = new GridData(GridData.FILL_HORIZONTAL);
+ // profilePropertiesButton.setLayoutData(gd);
+ //
+ // profileViewer.setContentProvider(new
+ // AdapterFactoryContentProvider(editingDomain.getAdapterFactory()) {
+ //
+ // @Override
+ // public boolean hasChildren(Object object) {
+ // return false;
+ // }
+ //
+ // });
+ //
+ // profileViewer.setLabelProvider(new DecoratingLabelProvider(new
+ // AdapterFactoryLabelProvider(editingDomain
+ // .getAdapterFactory()) {
+ //
+ // /*
+ // * (non-Javadoc)
+ // *
+ // * @see
+ // * org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider
+ // * # getText(java.lang.Object)
+ // */
+ // @Override
+ // public String getText(Object object) {
+ // Object obj = AdapterFactoryEditingDomain.unwrap(object);
+ // if (obj instanceof AbstractAnyType) {
+ // return super.getText(obj);
+ // }
+ // return super.getText(object);
+ // }
+ //
+ // },
+ // SmooksConfigurationActivator.getDefault().getWorkbench().getDecoratorManager().getLabelDecorator()));
+ //
+ // if (profiles != null) {
+ // profileViewer.setInput(profiles);
+ // }
+ //
+ // profileViewer.addDoubleClickListener(new IDoubleClickListener() {
+ //
+ // public void doubleClick(DoubleClickEvent event) {
+ // openProfilePropertiesModifyDialog();
+ // }
+ // });
+ //
+ // profileViewer.addSelectionChangedListener(new ISelectionChangedListener()
+ // {
+ //
+ // public void selectionChanged(SelectionChangedEvent event) {
+ // updateProfilesButtons();
+ // }
+ // });
+ //
+ // hookProfilesButtons();
+ // updateProfilesButtons();
+ // }
+ // }
+ //
+ // protected void openProfilePropertiesModifyDialog() {
+ // IStructuredSelection selection = (IStructuredSelection)
+ // profileViewer.getSelection();
+ // if (selection == null)
+ // return;
+ // Object obj = selection.getFirstElement();
+ // if (obj instanceof EObject) {
+ // EObject profile = (EObject) obj;
+ // EObject parent = getProfilesType();
+ // EStructuralFeature profileFeature = null;
+ // if (SmooksConstants.VERSION_1_0.equals(getSmooksVersion())) {
+ // profileFeature =
+ // org.jboss.tools.smooks10.model.smooks.SmooksPackage.Literals.PROFILES_TYPE__PROFILE;
+ // }
+ // if (SmooksConstants.VERSION_1_1.equals(getSmooksVersion())) {
+ // profileFeature = SmooksPackage.Literals.PROFILES_TYPE__PROFILE;
+ // }
+ //
+ // NewOrModifySmooksElementDialog dialog = new
+ // NewOrModifySmooksElementDialog(getEditorSite().getShell(),
+ // profileFeature, profile, parent, getManagedForm().getToolkit(),
+ // smooksModelProvider,
+ // SmooksConfigurationOverviewPage.this, true);
+ // dialog.open();
+ // }
+ // }
+ //
+ // protected void updateProfilesButtons() {
+ // if (getSmooksVersion() == null) {
+ // profilePropertiesButton.setEnabled(false);
+ // newProfileButton.setEnabled(false);
+ // removeProfileButton.setEnabled(false);
+ // upProfileButton.setEnabled(false);
+ // downProfileButton.setEnabled(false);
+ // return;
+ // }
+ // profilePropertiesButton.setEnabled(true);
+ // removeProfileButton.setEnabled(true);
+ // IStructuredSelection selection = (IStructuredSelection)
+ // profileViewer.getSelection();
+ // if (selection == null) {
+ // profilePropertiesButton.setEnabled(false);
+ // removeProfileButton.setEnabled(false);
+ // upProfileButton.setEnabled(false);
+ // downProfileButton.setEnabled(false);
+ // } else {
+ // if (selection.getFirstElement() == null) {
+ // profilePropertiesButton.setEnabled(false);
+ // removeProfileButton.setEnabled(false);
+ // upProfileButton.setEnabled(false);
+ // downProfileButton.setEnabled(false);
+ // return;
+ // }
+ //
+ // Object obj = selection.getFirstElement();
+ // if (obj instanceof EObject) {
+ // EObject profilesType = getProfilesType();
+ // if (profilesType == null)
+ // return;
+ // EObject v = (EObject) AdapterFactoryEditingDomain.unwrap(obj);
+ // EObject parent = v.eContainer();
+ // int index = parent.eContents().indexOf(v);
+ // Command command =
+ // MoveCommand.create(smooksModelProvider.getEditingDomain(), parent, null,
+ // obj,
+ // index - 1);
+ // upProfileButton.setEnabled(command.canExecute());
+ //
+ // Command command1 =
+ // MoveCommand.create(smooksModelProvider.getEditingDomain(), parent, null,
+ // obj,
+ // index + 1);
+ // downProfileButton.setEnabled(command1.canExecute());
+ // }
+ //
+ // if (selection.size() > 1) {
+ // profilePropertiesButton.setEnabled(false);
+ // removeProfileButton.setEnabled(false);
+ // }
+ // }
+ //
+ // }
+ //
+ // protected void hookProfilesButtons() {
+ // newProfileButton.addSelectionListener(new SelectionAdapter() {
+ //
+ // @Override
+ // public void widgetSelected(SelectionEvent e) {
+ // if (getSmooksVersion() == null) {
+ // return;
+ // }
+ // EObject model = null;
+ // if (SmooksConstants.VERSION_1_0.equals(getSmooksVersion())) {
+ // model =
+ // org.jboss.tools.smooks10.model.smooks.SmooksFactory.eINSTANCE.createProfileType();
+ // }
+ // if (SmooksConstants.VERSION_1_1.equals(getSmooksVersion())) {
+ // model = SmooksFactory.eINSTANCE.createProfileType();
+ // }
+ // EObject parent = getProfilesType();
+ // boolean newParent = false;
+ // if (parent == null) {
+ // newParent = true;
+ // if (SmooksConstants.VERSION_1_0.equals(getSmooksVersion())) {
+ // parent =
+ // org.jboss.tools.smooks10.model.smooks.SmooksFactory.eINSTANCE.createProfilesType();
+ // }
+ // if (SmooksConstants.VERSION_1_1.equals(getSmooksVersion())) {
+ // parent = SmooksFactory.eINSTANCE.createProfilesType();
+ // }
+ // }
+ // EStructuralFeature profileFeature = null;
+ // if (SmooksConstants.VERSION_1_0.equals(getSmooksVersion())) {
+ // profileFeature =
+ // org.jboss.tools.smooks10.model.smooks.SmooksPackage.Literals.PROFILES_TYPE__PROFILE;
+ // }
+ // if (SmooksConstants.VERSION_1_1.equals(getSmooksVersion())) {
+ // profileFeature = SmooksPackage.Literals.PROFILES_TYPE__PROFILE;
+ // }
+ // NewOrModifySmooksElementDialog dialog = new
+ // NewOrModifySmooksElementDialog(getEditorSite().getShell(),
+ // profileFeature, model, parent, getManagedForm().getToolkit(),
+ // smooksModelProvider,
+ // SmooksConfigurationOverviewPage.this, false);
+ //
+ // EStructuralFeature profilesFeature = null;
+ // if (SmooksConstants.VERSION_1_0.equals(getSmooksVersion())) {
+ // profilesFeature =
+ // org.jboss.tools.smooks10.model.smooks.SmooksPackage.Literals.SMOOKS_RESOURCE_LIST_TYPE__PROFILES;
+ // }
+ // if (SmooksConstants.VERSION_1_1.equals(getSmooksVersion())) {
+ // profilesFeature =
+ // SmooksPackage.Literals.SMOOKS_RESOURCE_LIST_TYPE__PROFILES;
+ // }
+ // if (dialog.open() == Dialog.OK && newParent) {
+ // EObject resource = getSmooksResourceList();
+ // if (resource == null)
+ // return;
+ // Command command =
+ // SetCommand.create(smooksModelProvider.getEditingDomain(), resource,
+ // profilesFeature, parent);
+ // if (command.canExecute()) {
+ // smooksModelProvider.getEditingDomain().getCommandStack().execute(command);
+ // profileViewer.setInput(parent);
+ // }
+ // }
+ // super.widgetSelected(e);
+ // }
+ //
+ // });
+ // removeProfileButton.addSelectionListener(new SelectionAdapter() {
+ //
+ // @Override
+ // public void widgetSelected(SelectionEvent e) {
+ // IStructuredSelection selection = (IStructuredSelection)
+ // profileViewer.getSelection();
+ // if (selection == null)
+ // return;
+ // Object obj = selection.getFirstElement();
+ // if (obj instanceof EObject) {
+ // EObject profile = (EObject) obj;
+ // EObject parent = getProfilesType();
+ // if (parent == null)
+ // return;
+ // CompoundCommand compoundCommand = new CompoundCommand();
+ // Command command =
+ // RemoveCommand.create(smooksModelProvider.getEditingDomain(), profile);
+ // compoundCommand.append(command);
+ // if (parent.eContents().size() == 1) {
+ // // remove parent;
+ // Command command1 =
+ // RemoveCommand.create(smooksModelProvider.getEditingDomain(), parent);
+ // compoundCommand.append(command1);
+ // }
+ // smooksModelProvider.getEditingDomain().getCommandStack().execute(compoundCommand);
+ // }
+ // }
+ //
+ // });
+ // upProfileButton.addSelectionListener(new SelectionAdapter() {
+ //
+ // @Override
+ // public void widgetSelected(SelectionEvent e) {
+ // IStructuredSelection selection = (IStructuredSelection)
+ // profileViewer.getSelection();
+ // if (selection == null)
+ // return;
+ // Object obj = selection.getFirstElement();
+ // if (obj instanceof EObject) {
+ // EObject profilesType = getProfilesType();
+ // if (profilesType == null)
+ // return;
+ // EObject v = (EObject) AdapterFactoryEditingDomain.unwrap(obj);
+ // EObject parent = v.eContainer();
+ // int index = parent.eContents().indexOf(v);
+ // Command command =
+ // MoveCommand.create(smooksModelProvider.getEditingDomain(), parent, null,
+ // obj,
+ // index - 1);
+ // smooksModelProvider.getEditingDomain().getCommandStack().execute(command);
+ // }
+ // }
+ //
+ // });
+ // downProfileButton.addSelectionListener(new SelectionAdapter() {
+ //
+ // @Override
+ // public void widgetSelected(SelectionEvent e) {
+ // IStructuredSelection selection = (IStructuredSelection)
+ // profileViewer.getSelection();
+ // if (selection == null)
+ // return;
+ // Object obj = selection.getFirstElement();
+ // if (obj instanceof EObject) {
+ // EObject profilesType = getProfilesType();
+ // if (profilesType == null)
+ // return;
+ // EObject v = (EObject) AdapterFactoryEditingDomain.unwrap(obj);
+ // EObject parent = v.eContainer();
+ // int index = parent.eContents().indexOf(v);
+ // Command command =
+ // MoveCommand.create(smooksModelProvider.getEditingDomain(), parent, null,
+ // obj,
+ // index + 1);
+ // smooksModelProvider.getEditingDomain().getCommandStack().execute(command);
+ // }
+ // }
+ //
+ // });
+ // profilePropertiesButton.addSelectionListener(new SelectionAdapter() {
+ //
+ // @Override
+ // public void widgetSelected(SelectionEvent e) {
+ // openProfilePropertiesModifyDialog();
+ // super.widgetSelected(e);
+ // }
+ //
+ // });
+ //
+ // }
+ //
+ // private EObject getProfilesType() {
+ // if (smooksModelProvider != null) {
+ // EObject smooksModel = smooksModelProvider.getSmooksModel();
+ // if (smooksModel instanceof DocumentRoot) {
+ // EObject m = ((DocumentRoot)
+ // smooksModel).getSmooksResourceList().getProfiles();
+ // return m;
+ // }
+ // if (smooksModel instanceof
+ // org.jboss.tools.smooks10.model.smooks.DocumentRoot) {
+ // EObject m = ((org.jboss.tools.smooks10.model.smooks.DocumentRoot)
+ // smooksModel).getSmooksResourceList()
+ // .getProfiles();
+ // return m;
+ // }
+ // }
+ // return null;
+ // }
+ //
+ // private ConditionsType getConditionsType() {
+ // if (smooksModelProvider != null) {
+ // EObject smooksModel = smooksModelProvider.getSmooksModel();
+ // if (smooksModel instanceof DocumentRoot) {
+ // EObject m = ((DocumentRoot)
+ // smooksModel).getSmooksResourceList().getConditions();
+ // return (ConditionsType) m;
+ // }
+ // }
+ // return null;
+ // }
+ //
+ // private void createConditionsSection(Composite conditionComposite,
+ // FormToolkit toolkit) {
+ // if (smooksModelProvider != null) {
+ // AdapterFactoryEditingDomain editingDomain = (AdapterFactoryEditingDomain)
+ // smooksModelProvider
+ // .getEditingDomain();
+ // ConditionsType conditions = getConditionsType();
+ // // if (m == null)
+ // // return;
+ //
+ // conditionViewer = new TableViewer(conditionComposite);
+ // GridData gd = new GridData(GridData.FILL_BOTH);
+ // conditionViewer.getControl().setLayoutData(gd);
+ // toolkit.paintBordersFor(conditionComposite);
+ // Composite buttonArea = toolkit.createComposite(conditionComposite);
+ // gd = new GridData(GridData.FILL_VERTICAL);
+ // gd.widthHint = 30;
+ // GridLayout bgl = new GridLayout();
+ // buttonArea.setLayout(bgl);
+ //
+ // newConditionButton = toolkit.createButton(buttonArea, "New", SWT.NONE);
+ // gd = new GridData(GridData.FILL_HORIZONTAL);
+ // newConditionButton.setLayoutData(gd);
+ //
+ // removeConditionButton = toolkit.createButton(buttonArea, "Remove",
+ // SWT.NONE);
+ // gd = new GridData(GridData.FILL_HORIZONTAL);
+ // removeConditionButton.setLayoutData(gd);
+ //
+ // upConditionButton = toolkit.createButton(buttonArea, "Up", SWT.NONE);
+ // gd = new GridData(GridData.FILL_HORIZONTAL);
+ // upConditionButton.setLayoutData(gd);
+ //
+ // downConditionButton = toolkit.createButton(buttonArea, "Down", SWT.NONE);
+ // gd = new GridData(GridData.FILL_HORIZONTAL);
+ // downConditionButton.setLayoutData(gd);
+ //
+ // conditionPropertiesButton = toolkit.createButton(buttonArea,
+ // "Properties..", SWT.NONE);
+ // gd = new GridData(GridData.FILL_HORIZONTAL);
+ // conditionPropertiesButton.setLayoutData(gd);
+ //
+ // conditionViewer.setContentProvider(new
+ // AdapterFactoryContentProvider(editingDomain.getAdapterFactory()) {
+ //
+ // @Override
+ // public boolean hasChildren(Object object) {
+ // return false;
+ // }
+ //
+ // });
+ //
+ // conditionViewer.setLabelProvider(new DecoratingLabelProvider(new
+ // AdapterFactoryLabelProvider(editingDomain
+ // .getAdapterFactory()) {
+ //
+ // /*
+ // * (non-Javadoc)
+ // *
+ // * @see
+ // * org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider
+ // * # getText(java.lang.Object)
+ // */
+ // @Override
+ // public String getText(Object object) {
+ // Object obj = AdapterFactoryEditingDomain.unwrap(object);
+ // if (obj instanceof AbstractAnyType) {
+ // return super.getText(obj);
+ // }
+ // return super.getText(object);
+ // }
+ //
+ // },
+ // SmooksConfigurationActivator.getDefault().getWorkbench().getDecoratorManager().getLabelDecorator()));
+ //
+ // if (conditions != null) {
+ // conditionViewer.setInput(conditions);
+ // }
+ //
+ // conditionViewer.addDoubleClickListener(new IDoubleClickListener() {
+ //
+ // public void doubleClick(DoubleClickEvent event) {
+ // openConditionPropertiesModifyDialog();
+ // }
+ // });
+ //
+ // conditionViewer.addSelectionChangedListener(new
+ // ISelectionChangedListener() {
+ //
+ // public void selectionChanged(SelectionChangedEvent event) {
+ // updateConditionsButtons();
+ // }
+ // });
+ //
+ // hookConditionsButtons();
+ // updateConditionsButtons();
+ // }
+ // }
+ //
+ // protected void hookConditionsButtons() {
+ // newConditionButton.addSelectionListener(new SelectionAdapter() {
+ //
+ // @Override
+ // public void widgetSelected(SelectionEvent e) {
+ // if (getSmooksVersion() == null ||
+ // getSmooksVersion().equals(SmooksConstants.VERSION_1_0)) {
+ // return;
+ // }
+ // ConditionType condition = SmooksFactory.eINSTANCE.createConditionType();
+ // ConditionsType parent = getConditionsType();
+ // boolean newParent = false;
+ // if (parent == null) {
+ // newParent = true;
+ // parent = SmooksFactory.eINSTANCE.createConditionsType();
+ //
+ // }
+ // NewOrModifySmooksElementDialog dialog = new
+ // NewOrModifySmooksElementDialog(getEditorSite().getShell(),
+ // SmooksPackage.Literals.CONDITIONS_TYPE__CONDITION, condition, parent,
+ // getManagedForm()
+ // .getToolkit(), smooksModelProvider, SmooksConfigurationOverviewPage.this,
+ // false);
+ // if (dialog.open() == Dialog.OK && newParent) {
+ // EObject resource = getSmooksResourceList();
+ // if (resource == null)
+ // return;
+ // Command command =
+ // SetCommand.create(smooksModelProvider.getEditingDomain(), resource,
+ // SmooksPackage.Literals.SMOOKS_RESOURCE_LIST_TYPE__CONDITIONS, parent);
+ // if (command.canExecute()) {
+ // smooksModelProvider.getEditingDomain().getCommandStack().execute(command);
+ // conditionViewer.setInput(parent);
+ // }
+ // }
+ // super.widgetSelected(e);
+ // }
+ //
+ // });
+ // removeConditionButton.addSelectionListener(new SelectionAdapter() {
+ //
+ // @Override
+ // public void widgetSelected(SelectionEvent e) {
+ // IStructuredSelection selection = (IStructuredSelection)
+ // conditionViewer.getSelection();
+ // if (selection == null)
+ // return;
+ // Object obj = selection.getFirstElement();
+ // if (obj instanceof ConditionType) {
+ // ConditionType condition = (ConditionType) obj;
+ // ConditionsType parent = getConditionsType();
+ // if (parent == null)
+ // return;
+ // CompoundCommand compoundCommand = new CompoundCommand();
+ // Command command =
+ // RemoveCommand.create(smooksModelProvider.getEditingDomain(), condition);
+ // compoundCommand.append(command);
+ // if (parent.getCondition().size() == 1) {
+ // // remove parent;
+ // Command command1 =
+ // RemoveCommand.create(smooksModelProvider.getEditingDomain(), parent);
+ // compoundCommand.append(command1);
+ // }
+ // smooksModelProvider.getEditingDomain().getCommandStack().execute(compoundCommand);
+ // }
+ // }
+ //
+ // });
+ // upConditionButton.addSelectionListener(new SelectionAdapter() {
+ //
+ // @Override
+ // public void widgetSelected(SelectionEvent e) {
+ // IStructuredSelection selection = (IStructuredSelection)
+ // conditionViewer.getSelection();
+ // if (selection == null)
+ // return;
+ // Object obj = selection.getFirstElement();
+ // if (obj instanceof ConditionType) {
+ // ConditionsType conditionsType = getConditionsType();
+ // if (conditionsType == null)
+ // return;
+ // EObject v = (EObject) AdapterFactoryEditingDomain.unwrap(obj);
+ // EObject parent = v.eContainer();
+ // int index = parent.eContents().indexOf(v);
+ // Command command =
+ // MoveCommand.create(smooksModelProvider.getEditingDomain(), parent, null,
+ // obj,
+ // index - 1);
+ // smooksModelProvider.getEditingDomain().getCommandStack().execute(command);
+ // }
+ // }
+ //
+ // });
+ // downConditionButton.addSelectionListener(new SelectionAdapter() {
+ //
+ // @Override
+ // public void widgetSelected(SelectionEvent e) {
+ // IStructuredSelection selection = (IStructuredSelection)
+ // conditionViewer.getSelection();
+ // if (selection == null)
+ // return;
+ // Object obj = selection.getFirstElement();
+ // if (obj instanceof ConditionType) {
+ // ConditionsType conditionsType = getConditionsType();
+ // if (conditionsType == null)
+ // return;
+ // EObject v = (EObject) AdapterFactoryEditingDomain.unwrap(obj);
+ // EObject parent = v.eContainer();
+ // int index = parent.eContents().indexOf(v);
+ // Command command =
+ // MoveCommand.create(smooksModelProvider.getEditingDomain(), parent, null,
+ // obj,
+ // index + 1);
+ // smooksModelProvider.getEditingDomain().getCommandStack().execute(command);
+ // }
+ // }
+ //
+ // });
+ // conditionPropertiesButton.addSelectionListener(new SelectionAdapter() {
+ //
+ // @Override
+ // public void widgetSelected(SelectionEvent e) {
+ // openConditionPropertiesModifyDialog();
+ // super.widgetSelected(e);
+ // }
+ //
+ // });
+ //
+ // }
+ //
+ // protected void updateConditionsButtons() {
+ // if (getSmooksVersion() == null ||
+ // getSmooksVersion().equals(SmooksConstants.VERSION_1_0)) {
+ // conditionPropertiesButton.setEnabled(false);
+ // newConditionButton.setEnabled(false);
+ // removeConditionButton.setEnabled(false);
+ // upConditionButton.setEnabled(false);
+ // downConditionButton.setEnabled(false);
+ // return;
+ // }
+ // conditionPropertiesButton.setEnabled(true);
+ // removeConditionButton.setEnabled(true);
+ // IStructuredSelection selection = (IStructuredSelection)
+ // conditionViewer.getSelection();
+ // if (selection == null) {
+ // conditionPropertiesButton.setEnabled(false);
+ // removeConditionButton.setEnabled(false);
+ // upConditionButton.setEnabled(false);
+ // downConditionButton.setEnabled(false);
+ // } else {
+ // if (selection.getFirstElement() == null) {
+ // conditionPropertiesButton.setEnabled(false);
+ // removeConditionButton.setEnabled(false);
+ // upConditionButton.setEnabled(false);
+ // downConditionButton.setEnabled(false);
+ // return;
+ // }
+ //
+ // Object obj = selection.getFirstElement();
+ // if (obj instanceof ConditionType) {
+ // ConditionsType conditionsType = getConditionsType();
+ // if (conditionsType == null)
+ // return;
+ // EObject v = (EObject) AdapterFactoryEditingDomain.unwrap(obj);
+ // EObject parent = v.eContainer();
+ // int index = parent.eContents().indexOf(v);
+ // Command command =
+ // MoveCommand.create(smooksModelProvider.getEditingDomain(), parent, null,
+ // obj,
+ // index - 1);
+ // upConditionButton.setEnabled(command.canExecute());
+ //
+ // Command command1 =
+ // MoveCommand.create(smooksModelProvider.getEditingDomain(), parent, null,
+ // obj,
+ // index + 1);
+ // downConditionButton.setEnabled(command1.canExecute());
+ // }
+ //
+ // if (selection.size() > 1) {
+ // conditionPropertiesButton.setEnabled(false);
+ // removeConditionButton.setEnabled(false);
+ // }
+ // }
+ // }
+ //
+ // protected void openConditionPropertiesModifyDialog() {
+ // IStructuredSelection selection = (IStructuredSelection)
+ // conditionViewer.getSelection();
+ // if (selection == null)
+ // return;
+ // Object obj = selection.getFirstElement();
+ // if (obj instanceof ConditionType) {
+ // ConditionType condition = (ConditionType) obj;
+ // ConditionsType parent = getConditionsType();
+ // NewOrModifySmooksElementDialog dialog = new
+ // NewOrModifySmooksElementDialog(getEditorSite().getShell(),
+ // SmooksPackage.Literals.CONDITIONS_TYPE__CONDITION, condition, parent,
+ // getManagedForm().getToolkit(), smooksModelProvider,
+ // SmooksConfigurationOverviewPage.this, true);
+ // dialog.open();
+ // }
+ // }
+ //
+ // protected void updateParamButtons() {
+ // if (getSmooksVersion() == null ||
+ // getSmooksVersion().equals(SmooksConstants.VERSION_1_0)) {
+ // paramPropertiesButton.setEnabled(false);
+ // newParamButton.setEnabled(false);
+ // removeParamButton.setEnabled(false);
+ // upParamButton.setEnabled(false);
+ // downParamButton.setEnabled(false);
+ // return;
+ // }
+ // paramPropertiesButton.setEnabled(true);
+ // removeParamButton.setEnabled(true);
+ // IStructuredSelection selection = (IStructuredSelection)
+ // paramViewer.getSelection();
+ // if (selection == null) {
+ // paramPropertiesButton.setEnabled(false);
+ // removeParamButton.setEnabled(false);
+ // upParamButton.setEnabled(false);
+ // downParamButton.setEnabled(false);
+ // } else {
+ // if (selection.getFirstElement() == null) {
+ // paramPropertiesButton.setEnabled(false);
+ // removeParamButton.setEnabled(false);
+ // upParamButton.setEnabled(false);
+ // downParamButton.setEnabled(false);
+ // return;
+ // }
+ //
+ // Object obj = selection.getFirstElement();
+ // if (obj instanceof ParamType) {
+ // ParamsType paramsType = getParamsType();
+ // if (paramsType == null)
+ // return;
+ // EObject v = (EObject) AdapterFactoryEditingDomain.unwrap(obj);
+ // EObject parent = v.eContainer();
+ // int index = parent.eContents().indexOf(v);
+ // Command command =
+ // MoveCommand.create(smooksModelProvider.getEditingDomain(), parent, null,
+ // obj,
+ // index - 1);
+ // upParamButton.setEnabled(command.canExecute());
+ //
+ // Command command1 =
+ // MoveCommand.create(smooksModelProvider.getEditingDomain(), parent, null,
+ // obj,
+ // index + 1);
+ // downParamButton.setEnabled(command1.canExecute());
+ // }
+ //
+ // if (selection.size() > 1) {
+ // paramPropertiesButton.setEnabled(false);
+ // removeParamButton.setEnabled(false);
+ // }
+ // }
+ //
+ // }
+ //
+ // private void hookGlobalParamterButtons() {
+ // newParamButton.addSelectionListener(new SelectionAdapter() {
+ //
+ // @Override
+ // public void widgetSelected(SelectionEvent e) {
+ // if (getSmooksVersion() == null ||
+ // getSmooksVersion().equals(SmooksConstants.VERSION_1_0)) {
+ // return;
+ // }
+ // ParamType param = SmooksFactory.eINSTANCE.createParamType();
+ // ParamsType parent = getParamsType();
+ // boolean newParent = false;
+ // if (parent == null) {
+ // newParent = true;
+ // parent = SmooksFactory.eINSTANCE.createParamsType();
+ // EObject resource = getSmooksResourceList();
+ // if (resource == null)
+ // return;
+ // Command command =
+ // SetCommand.create(smooksModelProvider.getEditingDomain(), resource,
+ // SmooksPackage.Literals.SMOOKS_RESOURCE_LIST_TYPE__PARAMS, parent);
+ // if (command.canExecute()) {
+ // ((SmooksResourceListType) resource).setParams((ParamsType) parent);
+ // paramViewer.setInput(parent);
+ // }
+ // }
+ // NewOrModifySmooksElementDialog dialog = new
+ // NewOrModifySmooksElementDialog(getEditorSite().getShell(),
+ // SmooksPackage.Literals.PARAMS_TYPE__PARAM, param, parent,
+ // getManagedForm().getToolkit(),
+ // smooksModelProvider, SmooksConfigurationOverviewPage.this, false);
+ // if (dialog.open() == Dialog.CANCEL && newParent) {
+ // EObject resource = getSmooksResourceList();
+ // ((SmooksResourceListType) resource).setParams(null);
+ // paramViewer.setInput(null);
+ // }
+ // super.widgetSelected(e);
+ // }
+ //
+ // });
+ // removeParamButton.addSelectionListener(new SelectionAdapter() {
+ //
+ // @Override
+ // public void widgetSelected(SelectionEvent e) {
+ // IStructuredSelection selection = (IStructuredSelection)
+ // paramViewer.getSelection();
+ // if (selection == null)
+ // return;
+ // Object obj = selection.getFirstElement();
+ // if (obj instanceof ParamType) {
+ // ParamType param = (ParamType) obj;
+ // ParamsType parent = getParamsType();
+ // if (parent == null)
+ // return;
+ // CompoundCommand compoundCommand = new CompoundCommand();
+ // Command command =
+ // RemoveCommand.create(smooksModelProvider.getEditingDomain(), param);
+ // compoundCommand.append(command);
+ // if (parent.getParam().size() == 1) {
+ // // remove parent;
+ // Command command1 =
+ // RemoveCommand.create(smooksModelProvider.getEditingDomain(), parent);
+ // compoundCommand.append(command1);
+ // }
+ // smooksModelProvider.getEditingDomain().getCommandStack().execute(compoundCommand);
+ // }
+ // }
+ //
+ // });
+ // upParamButton.addSelectionListener(new SelectionAdapter() {
+ //
+ // @Override
+ // public void widgetSelected(SelectionEvent e) {
+ // IStructuredSelection selection = (IStructuredSelection)
+ // paramViewer.getSelection();
+ // if (selection == null)
+ // return;
+ // Object obj = selection.getFirstElement();
+ // if (obj instanceof ParamType) {
+ // ParamsType paramsType = getParamsType();
+ // if (paramsType == null)
+ // return;
+ // EObject v = (EObject) AdapterFactoryEditingDomain.unwrap(obj);
+ // EObject parent = v.eContainer();
+ // int index = parent.eContents().indexOf(v);
+ // Command command =
+ // MoveCommand.create(smooksModelProvider.getEditingDomain(), parent, null,
+ // obj,
+ // index - 1);
+ // smooksModelProvider.getEditingDomain().getCommandStack().execute(command);
+ // }
+ // }
+ //
+ // });
+ // downParamButton.addSelectionListener(new SelectionAdapter() {
+ //
+ // @Override
+ // public void widgetSelected(SelectionEvent e) {
+ // IStructuredSelection selection = (IStructuredSelection)
+ // paramViewer.getSelection();
+ // if (selection == null)
+ // return;
+ // Object obj = selection.getFirstElement();
+ // if (obj instanceof ParamType) {
+ // ParamsType paramsType = getParamsType();
+ // if (paramsType == null)
+ // return;
+ // EObject v = (EObject) AdapterFactoryEditingDomain.unwrap(obj);
+ // EObject parent = v.eContainer();
+ // int index = parent.eContents().indexOf(v);
+ // Command command =
+ // MoveCommand.create(smooksModelProvider.getEditingDomain(), parent, null,
+ // obj,
+ // index + 1);
+ // smooksModelProvider.getEditingDomain().getCommandStack().execute(command);
+ // }
+ // }
+ //
+ // });
+ // paramPropertiesButton.addSelectionListener(new SelectionAdapter() {
+ //
+ // @Override
+ // public void widgetSelected(SelectionEvent e) {
+ // openParamPropertiesModifyDialog();
+ // super.widgetSelected(e);
+ // }
+ //
+ // });
+ // }
+ //
+ // protected void openParamPropertiesModifyDialog() {
+ // IStructuredSelection selection = (IStructuredSelection)
+ // paramViewer.getSelection();
+ // if (selection == null)
+ // return;
+ // Object obj = selection.getFirstElement();
+ // if (obj instanceof ParamType) {
+ // ParamType param = (ParamType) obj;
+ // ParamsType parent = getParamsType();
+ // NewOrModifySmooksElementDialog dialog = new
+ // NewOrModifySmooksElementDialog(getEditorSite().getShell(),
+ // SmooksPackage.Literals.PARAMS_TYPE__PARAM, param, parent,
+ // getManagedForm().getToolkit(),
+ // smooksModelProvider, SmooksConfigurationOverviewPage.this, true);
+ // dialog.open();
+ // }
+ // }
+ //
+ // private void createDefaultSection(Composite parent, FormToolkit toolkit)
+ // {
+ // ModelPanelCreator defaultSettingPanelCreator =
+ // getDefaultSettingPanelCreator();
+ // EObject model = getSmooksResourceList();
+ // if (model != null) {
+ // AdapterFactoryEditingDomain editingDomain = (AdapterFactoryEditingDomain)
+ // smooksModelProvider
+ // .getEditingDomain();
+ // IItemPropertySource itemPropertySource = (IItemPropertySource)
+ // editingDomain.getAdapterFactory().adapt(
+ // model, IItemPropertySource.class);
+ // if (model != null) {
+ // defaultSettingPanelCreator.createModelPanel(model, toolkit, parent,
+ // itemPropertySource,
+ // smooksModelProvider, getEditor());
+ // }
+ // }
+ //
+ // }
+ //
+ // private void disposeDefaultSettingCompositeControls() {
+ // disposeCompositeControls(defaultSettingComposite, null);
+ // }
}
15 years
JBoss Tools SVN: r18906 - trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors.
by jbosstools-commits@lists.jboss.org
Author: DartPeng
Date: 2009-11-28 14:23:31 -0500 (Sat, 28 Nov 2009)
New Revision: 18906
Modified:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/SmooksProcessGraphicalEditor.java
Log:
JBIDE-5296
done
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/SmooksProcessGraphicalEditor.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/SmooksProcessGraphicalEditor.java 2009-11-28 18:57:19 UTC (rev 18905)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/SmooksProcessGraphicalEditor.java 2009-11-28 19:23:31 UTC (rev 18906)
@@ -96,6 +96,10 @@
public class SmooksProcessGraphicalEditor extends FormPage implements ISelectionChangedListener,
ISourceSynchronizeListener, IPropertyListener, ISmooksModelValidateListener, IProcessProvider,
PropertyChangeListener {
+
+ private boolean processChanged = false;
+
+ private boolean lockProcessChangeEvent = false;
private List<IAction> processPanelActions = new ArrayList<IAction>();
@@ -199,8 +203,9 @@
process.addPropertyChangeListener(this);
}
ProcessTaskAnalyzer analyzer = new ProcessTaskAnalyzer();
+ lockProcessChangeEvent = true;
analyzer.analyzeTaskNode(process, getSmooksResourceListType());
-
+ lockProcessChangeEvent = false;
if (getProcessGraphViewer() != null) {
getProcessGraphViewer().setInput(process);
}
@@ -821,7 +826,7 @@
dirty = (((IEditorPart) object).isDirty() || dirty);
}
}
- return dirty;
+ return( dirty || processChanged);
}
/*
@@ -839,6 +844,7 @@
((IEditorPart) object).doSave(monitor);
}
}
+ processChanged = false;
firePropertyChange(PROP_DIRTY);
}
@@ -1120,6 +1126,7 @@
}
public void propertyChange(PropertyChangeEvent evt) {
+ if(lockProcessChangeEvent) return;
String name = evt.getPropertyName();
Object newtask = evt.getNewValue();
if (ProcessType.PRO_ADD_CHILD.equals(name) || ProcessType.PRO_REMOVE_CHILD.equals(name)) {
@@ -1127,6 +1134,8 @@
getProcessGraphViewer().refresh();
getProcessGraphViewer().applyLayout();
}
+ processChanged = true;
+ getManagedForm().dirtyStateChanged();
}
if (ProcessType.PRO_ADD_CHILD.equals(name)) {
15 years
JBoss Tools SVN: r18905 - in trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks: configuration/editors/uitls and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: DartPeng
Date: 2009-11-28 13:57:19 -0500 (Sat, 28 Nov 2009)
New Revision: 18905
Modified:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksReaderFormPage.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/uitls/SmooksUIUtils.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/editor/AbstractSmooksFormEditor.java
Log:
JBIDE-5280
Analyze the config file when it dosen't contain the input type <param> information.
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksReaderFormPage.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksReaderFormPage.java 2009-11-28 14:29:16 UTC (rev 18904)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksReaderFormPage.java 2009-11-28 18:57:19 UTC (rev 18905)
@@ -20,7 +20,6 @@
import org.eclipse.core.filesystem.IFileInfo;
import org.eclipse.core.filesystem.IFileStore;
import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.Path;
import org.eclipse.draw2d.ColorConstants;
import org.eclipse.emf.common.command.Command;
@@ -137,7 +136,6 @@
public SmooksReaderFormPage(String id, String title) {
super(id, title);
- IResource resource;
}
@Override
@@ -669,7 +667,6 @@
}
AdapterFactoryEditingDomain editDomain = getEditingDomain();
- Object obj = editDomain.getAdapterFactory().adapt(resourceList, IEditingDomainItemProvider.class);
IEditingDomainItemProvider provider = (IEditingDomainItemProvider) editDomain.getAdapterFactory().adapt(
resourceList, IEditingDomainItemProvider.class);
Collection<?> collections = provider.getNewChildDescriptors(resourceList, editDomain, null);
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/uitls/SmooksUIUtils.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/uitls/SmooksUIUtils.java 2009-11-28 14:29:16 UTC (rev 18904)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/uitls/SmooksUIUtils.java 2009-11-28 18:57:19 UTC (rev 18905)
@@ -3011,6 +3011,20 @@
}
return SmooksConstants.VERSION_1_2;
}
+
+ public static void addInputTypeParam(String inputType, SmooksResourceListType resourceList){
+ ParamsType params = resourceList.getParams();
+ if(params == null){
+ params = SmooksFactory.eINSTANCE.createParamsType();
+ resourceList.setParams(params);
+ }
+
+ ParamType param = SmooksFactory.eINSTANCE.createParamType();
+ param.setName(SmooksModelUtils.INPUT_TYPE);
+ param.setStringValue(inputType);
+
+ params.getParam().add(param);
+ }
public static String judgeInputType(EObject smooksModel) {
String inputType = null;
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/editor/AbstractSmooksFormEditor.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/editor/AbstractSmooksFormEditor.java 2009-11-28 14:29:16 UTC (rev 18904)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/editor/AbstractSmooksFormEditor.java 2009-11-28 18:57:19 UTC (rev 18905)
@@ -91,10 +91,12 @@
import org.jboss.tools.smooks.model.rules10.provider.Rules10ItemProviderAdapterFactory;
import org.jboss.tools.smooks.model.smooks.DocumentRoot;
import org.jboss.tools.smooks.model.smooks.ParamType;
+import org.jboss.tools.smooks.model.smooks.SmooksResourceListType;
import org.jboss.tools.smooks.model.smooks.provider.SmooksItemProviderAdapterFactory;
import org.jboss.tools.smooks.model.smooks.util.SmooksResourceFactoryImpl;
import org.jboss.tools.smooks.model.validation10.provider.Validation10ItemProviderAdapterFactory;
import org.jboss.tools.smooks.model.xsl.provider.XslItemProviderAdapterFactory;
+import org.jboss.tools.smooks10.model.smooks.util.SmooksModelUtils;
public class AbstractSmooksFormEditor extends FormEditor implements IEditingDomainProvider,
ISmooksModelValidateListener, ISmooksModelProvider {
@@ -506,6 +508,7 @@
smooksModel = null;
}
setPlatformVersion(SmooksUIUtils.judgeSmooksPlatformVersion(smooksModel));
+ judgeInputReader();
for (Iterator<?> iterator = this.sourceSynchronizeListener.iterator(); iterator.hasNext();) {
ISourceSynchronizeListener l = (ISourceSynchronizeListener) iterator.next();
try {
@@ -650,13 +653,39 @@
// create new one for it
setPartName(partName);
-
String version = SmooksUIUtils.judgeSmooksPlatformVersion(smooksModel);
- try {
- this.setPlatformVersion(version);
- } catch (Exception e) {
+ this.setPlatformVersion(version);
+ judgeInputReader();
+ }
+ protected void judgeInputReader() {
+ SmooksResourceListType resourceList = SmooksUIUtils.getSmooks11ResourceListType(smooksModel);
+ if (resourceList == null)
+ return;
+ ParamType param = SmooksUIUtils.getInputTypeParam(resourceList);
+ String inputType = null;
+ if (param != null) {
+ inputType = param.getStringValue();
+ String realInputType = SmooksUIUtils.judgeInputType(smooksModel);
+ if (realInputType == null) {
+ if (inputType != null) {
+ if (inputType.equals(SmooksModelUtils.INPUT_TYPE_XML)
+ || inputType.equals(SmooksModelUtils.INPUT_TYPE_JAVA)
+ || inputType.equals(SmooksModelUtils.INPUT_TYPE_XSD)) {
+
+ }
+ }
+ } else {
+ if (!realInputType.equals(inputType)) {
+ param.setStringValue(realInputType);
+ inputType = realInputType;
+ }
+ }
+ } else {
+ inputType = SmooksUIUtils.judgeInputType(smooksModel);
+ SmooksUIUtils.addInputTypeParam(inputType, resourceList);
}
+ this.setInputType(inputType);
}
public EObject getSmooksResourceList() {
15 years
JBoss Tools SVN: r18904 - trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide.
by jbosstools-commits@lists.jboss.org
Author: dmaliarevich
Date: 2009-11-28 09:29:16 -0500 (Sat, 28 Nov 2009)
New Revision: 18904
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE4373Test.java
Log:
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE4373Test.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE4373Test.java 2009-11-28 10:15:18 UTC (rev 18903)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE4373Test.java 2009-11-28 14:29:16 UTC (rev 18904)
@@ -158,7 +158,7 @@
*
* @throws CoreException
*/
- public void _testOpenOnForCImport() throws CoreException {
+ public void testOpenOnForCImport() throws CoreException {
VpeController vpeController = openInVpe(JsfAllTests.IMPORT_CUSTOM_FACELETS_PROJECT, "c-import.xhtml"); //$NON-NLS-1$
int position = TestUtil.getLinePositionOffcet(vpeController.getSourceEditor().getTextViewer(), 12, 25);
Node sourceNode = SelectionUtil.getNodeBySourcePosition(vpeController.getSourceEditor(), position);
@@ -219,7 +219,7 @@
*
* @throws CoreException
*/
- public void _testOpenOnForJspDirectiveInclude() throws CoreException {
+ public void testOpenOnForJspDirectiveInclude() throws CoreException {
VpeController vpeController = openInVpe(JsfAllTests.IMPORT_CUSTOM_FACELETS_PROJECT, "jsp-directive-include-relative.jsp"); //$NON-NLS-1$
int position = TestUtil.getLinePositionOffcet(vpeController.getSourceEditor().getTextViewer(), 13, 46);
Node sourceNode = SelectionUtil.getNodeBySourcePosition(vpeController.getSourceEditor(), position);
@@ -234,7 +234,7 @@
*
* @throws CoreException
*/
- public void _testOpenOnForJspInclude() throws CoreException {
+ public void testOpenOnForJspInclude() throws CoreException {
VpeController vpeController = openInVpe(JsfAllTests.IMPORT_CUSTOM_FACELETS_PROJECT, "jsp-include-relative.jsp"); //$NON-NLS-1$
int position = TestUtil.getLinePositionOffcet(vpeController.getSourceEditor().getTextViewer(), 13, 36);
Node sourceNode = SelectionUtil.getNodeBySourcePosition(vpeController.getSourceEditor(), position);
15 years