Author: DartPeng
Date: 2009-05-13 06:37:36 -0400 (Wed, 13 May 2009)
New Revision: 15239
Modified:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/AttributeFieldEditPart.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/IPropertyUICreator.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/PropertyUICreator.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SelectorAttributes.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SelectoreSelectionDialog.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksStuffPropertyDetailPage.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/datasource/DirectUICreator.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/freemarker/TemplateUICreator.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/groovy/GroovyUICreator.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/groovy/ScriptUICreator.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/smooks/ParamTypeUICreator.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/configuration/editors/xsl/TemplateUICreator.java
Log:
JBIDE-4298
write a method to group multiple attribute field editors.
Modified:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/AttributeFieldEditPart.java
===================================================================
---
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/AttributeFieldEditPart.java 2009-05-13
10:02:54 UTC (rev 15238)
+++
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/AttributeFieldEditPart.java 2009-05-13
10:37:36 UTC (rev 15239)
@@ -18,6 +18,8 @@
*/
public class AttributeFieldEditPart {
+ private Object attribute;
+
private IFieldMarker fieldMarker;
private Control contentControl;
@@ -49,4 +51,20 @@
public void setContentControl(Control contentControl) {
this.contentControl = contentControl;
}
+
+ /**
+ * @return the attribute
+ */
+ public Object getAttribute() {
+ return attribute;
+ }
+
+ /**
+ * @param attribute the attribute to set
+ */
+ public void setAttribute(Object attribute) {
+ this.attribute = attribute;
+ }
+
+
}
Modified:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/IPropertyUICreator.java
===================================================================
---
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/IPropertyUICreator.java 2009-05-13
10:02:54 UTC (rev 15238)
+++
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/IPropertyUICreator.java 2009-05-13
10:37:36 UTC (rev 15239)
@@ -10,6 +10,8 @@
******************************************************************************/
package org.jboss.tools.smooks.configuration.editors;
+import java.util.List;
+
import org.eclipse.emf.ecore.EAttribute;
import org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain;
import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
@@ -26,7 +28,7 @@
IItemPropertyDescriptor propertyDescriptor, Object model, EAttribute feature,
SmooksMultiFormEditor formEditor);
- public void createExtendUI(AdapterFactoryEditingDomain editingdomain, FormToolkit
toolkit,
+ public List<AttributeFieldEditPart> createExtendUI(AdapterFactoryEditingDomain
editingdomain, FormToolkit toolkit,
Composite parent, Object model, SmooksMultiFormEditor formEditor);
public boolean ignoreProperty(EAttribute feature);
Modified:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/PropertyUICreator.java
===================================================================
---
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/PropertyUICreator.java 2009-05-13
10:02:54 UTC (rev 15238)
+++
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/PropertyUICreator.java 2009-05-13
10:37:36 UTC (rev 15239)
@@ -11,6 +11,7 @@
package org.jboss.tools.smooks.configuration.editors;
import java.util.ArrayList;
+import java.util.Collections;
import java.util.Iterator;
import java.util.List;
@@ -26,6 +27,7 @@
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.ModifyEvent;
import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Combo;
@@ -33,6 +35,7 @@
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.forms.events.IHyperlinkListener;
import org.eclipse.ui.forms.widgets.FormToolkit;
+import org.eclipse.ui.forms.widgets.Section;
import org.jboss.tools.smooks.configuration.editors.uitls.FieldMarkerWrapper;
import org.jboss.tools.smooks.configuration.editors.uitls.IFieldDialog;
import org.jboss.tools.smooks.configuration.editors.uitls.IModelProcsser;
@@ -65,8 +68,9 @@
* org.eclipse.emf.edit.provider.IItemPropertyDescriptor, java.lang.Object,
* org.eclipse.emf.ecore.EAttribute)
*/
- public AttributeFieldEditPart createPropertyUI(FormToolkit toolkit, Composite parent,
IItemPropertyDescriptor propertyDescriptor, Object model,
- EAttribute feature, SmooksMultiFormEditor formEditor) {
+ public AttributeFieldEditPart createPropertyUI(FormToolkit toolkit, Composite parent,
+ IItemPropertyDescriptor propertyDescriptor, Object model, EAttribute feature,
+ SmooksMultiFormEditor formEditor) {
if (isBeanIDRefFieldFeature(feature)) {
return createBeanIDRefFieldEditor(toolkit, parent, propertyDescriptor, model, feature,
formEditor);
}
@@ -79,9 +83,9 @@
if (isFileSelectionFeature(feature)) {
return createFileSelectionFieldEditor(toolkit, parent, propertyDescriptor, model,
feature, formEditor);
}
- if(isConditionSelectionFeature(feature)){
+ if (isConditionSelectionFeature(feature)) {
return SmooksUIUtils.createConditionsChoiceFieldEditor(parent, toolkit,
propertyDescriptor, model);
-// return parent;
+ // return parent;
}
if (feature == SmooksPackage.eINSTANCE.getAbstractReader_TargetProfile()) {
@@ -125,16 +129,18 @@
return SmooksUIUtils.getJavaProject(model);
}
- public void createExtendUI(AdapterFactoryEditingDomain editingdomain, FormToolkit
toolkit, Composite parent, Object model,
- SmooksMultiFormEditor formEditor) {
+ public List<AttributeFieldEditPart> createExtendUI(AdapterFactoryEditingDomain
editingdomain, FormToolkit toolkit,
+ Composite parent, Object model, SmooksMultiFormEditor formEditor) {
+ return Collections.emptyList();
}
protected boolean isFileSelectionFeature(EAttribute attribute) {
return false;
}
- public AttributeFieldEditPart createFileSelectionFieldEditor(FormToolkit toolkit,
Composite parent, IItemPropertyDescriptor propertyDescriptor, Object model,
- EAttribute feature, SmooksMultiFormEditor formEditor) {
+ public AttributeFieldEditPart createFileSelectionFieldEditor(FormToolkit toolkit,
Composite parent,
+ IItemPropertyDescriptor propertyDescriptor, Object model, EAttribute feature,
+ SmooksMultiFormEditor formEditor) {
IFieldDialog dialog = new IFieldDialog() {
public Object open(Shell shell) {
FileSelectionWizard wizard = new FileSelectionWizard();
@@ -160,16 +166,17 @@
}
};
- return SmooksUIUtils.createDialogFieldEditor(parent, toolkit, propertyDescriptor,
"Browse", dialog, (EObject) model, true,
- getFileFiledEditorLinkListener());
+ return SmooksUIUtils.createDialogFieldEditor(parent, toolkit, propertyDescriptor,
"Browse", dialog,
+ (EObject) model, true, getFileFiledEditorLinkListener());
}
protected boolean isSelectorFeature(EAttribute attribute) {
return false;
}
- public AttributeFieldEditPart createSelectorFieldEditor(FormToolkit toolkit, Composite
parent, IItemPropertyDescriptor propertyDescriptor, Object model,
- EAttribute feature, SmooksMultiFormEditor formEditor) {
+ public AttributeFieldEditPart createSelectorFieldEditor(FormToolkit toolkit, Composite
parent,
+ IItemPropertyDescriptor propertyDescriptor, Object model, EAttribute feature,
+ SmooksMultiFormEditor formEditor) {
SmooksGraphicsExtType ext = formEditor.getSmooksGraphicsExt();
if (ext != null) {
return SmooksUIUtils.createSelectorFieldEditor(toolkit, parent, propertyDescriptor,
model, ext);
@@ -181,8 +188,9 @@
return false;
}
- public AttributeFieldEditPart createJavaTypeSearchEditor(FormToolkit toolkit, Composite
parent, IItemPropertyDescriptor propertyDescriptor, Object model,
- EAttribute feature, SmooksMultiFormEditor formEditor) {
+ public AttributeFieldEditPart createJavaTypeSearchEditor(FormToolkit toolkit, Composite
parent,
+ IItemPropertyDescriptor propertyDescriptor, Object model, EAttribute feature,
+ SmooksMultiFormEditor formEditor) {
if (model instanceof EObject)
return SmooksUIUtils.createJavaTypeSearchFieldEditor(parent, toolkit,
propertyDescriptor, (EObject) model);
return null;
@@ -192,15 +200,17 @@
return false;
}
- public AttributeFieldEditPart createBeanIDRefFieldEditor(FormToolkit toolkit, Composite
parent, IItemPropertyDescriptor propertyDescriptor, Object model,
- EAttribute feature, SmooksMultiFormEditor formEditor) {
+ public AttributeFieldEditPart createBeanIDRefFieldEditor(FormToolkit toolkit, Composite
parent,
+ IItemPropertyDescriptor propertyDescriptor, Object model, EAttribute feature,
+ SmooksMultiFormEditor formEditor) {
if (model instanceof EObject) {
AttributeFieldEditPart editPart = new AttributeFieldEditPart();
SmooksResourceListType smooksResourceList = getSmooksResourceList((EObject) model);
if (smooksResourceList != null) {
- FieldMarkerWrapper wrapper = SmooksUIUtils.createFieldEditorLabel(null,parent,
toolkit, propertyDescriptor, model, false);
+ FieldMarkerWrapper wrapper = SmooksUIUtils.createFieldEditorLabel(null, parent,
toolkit,
+ propertyDescriptor, model, false);
editPart.setFieldMarker(wrapper.getMarker());
-
+
Composite tcom = toolkit.createComposite(parent);
GridLayout layout = new GridLayout();
layout.numColumns = 2;
@@ -208,7 +218,7 @@
layout.marginRight = 0;
layout.horizontalSpacing = 0;
tcom.setLayout(layout);
-
+
FieldMarkerComposite notificationComposite = new FieldMarkerComposite(tcom,
SWT.NONE);
GridData gd = new GridData();
gd.heightHint = 8;
@@ -217,13 +227,13 @@
gd.verticalAlignment = GridData.BEGINNING;
notificationComposite.setLayoutData(gd);
editPart.setFieldMarker(notificationComposite);
-
+
final Combo combo = new Combo(tcom, SWT.BORDER);
editPart.setContentControl(combo);
gd = new GridData(GridData.FILL_HORIZONTAL);
combo.setLayoutData(gd);
tcom.setLayoutData(gd);
-
+
Object editValue = SmooksUIUtils.getEditValue(propertyDescriptor, model);
if (editValue != null) {
combo.setText(editValue.toString());
@@ -284,4 +294,45 @@
return false;
}
+ protected List<AttributeFieldEditPart> createElementSelectionSection(String
sectionTitle,
+ AdapterFactoryEditingDomain editingdomain, FormToolkit toolkit, Composite parent,
Object model,
+ SmooksMultiFormEditor formEditor, IItemPropertyDescriptor createOnElementFeature,
+ IItemPropertyDescriptor createOnElementFeatureNS) {
+ Section section = toolkit.createSection(parent, Section.TITLE_BAR);
+ section.setText(sectionTitle);
+
+ FillLayout layout = new FillLayout();
+ layout.marginHeight = 0;
+ layout.marginWidth = 0;
+
+ section.setLayout(layout);
+
+ GridData gd = new GridData(GridData.FILL_HORIZONTAL);
+ gd.heightHint = 100;
+ gd.horizontalSpan = 2;
+ section.setLayoutData(gd);
+
+ Composite container = toolkit.createComposite(section);
+
+ section.setClient(container);
+
+ GridLayout glayout = new GridLayout();
+ glayout.numColumns = 2;
+ container.setLayout(glayout);
+
+ AttributeFieldEditPart editPart1 =
SmooksUIUtils.createSelectorFieldEditor("Name", toolkit, container,
+ createOnElementFeature, model, formEditor.getSmooksGraphicsExt());
+ editPart1.setAttribute(createOnElementFeature.getFeature(model));
+
+ AttributeFieldEditPart editPart2 =
SmooksUIUtils.createStringFieldEditor("Namespace", container, editingdomain,
+ toolkit, createOnElementFeatureNS, model, false, false, false, 0, null,
SmooksUIUtils.VALUE_TYPE_VALUE,
+ null);
+ editPart2.setAttribute(createOnElementFeatureNS.getFeature(model));
+
+ List<AttributeFieldEditPart> list = new
ArrayList<AttributeFieldEditPart>();
+ list.add(editPart1);
+ list.add(editPart2);
+
+ return list;
+ }
}
Modified:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SelectorAttributes.java
===================================================================
---
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SelectorAttributes.java 2009-05-13
10:02:54 UTC (rev 15238)
+++
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SelectorAttributes.java 2009-05-13
10:37:36 UTC (rev 15239)
@@ -16,7 +16,7 @@
public static final String IGNORE_ROOT = "ignore_root";
public static final String INCLUDE_PARENT = "include_parent";
- private String selectorSperator = " ";
+ private String selectorSperator = "/";
private String selectorPolicy = SelectorAttributes.FULL_PATH;
public String getSelectorSperator() {
return selectorSperator;
Modified:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SelectoreSelectionDialog.java
===================================================================
---
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SelectoreSelectionDialog.java 2009-05-13
10:02:54 UTC (rev 15238)
+++
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SelectoreSelectionDialog.java 2009-05-13
10:37:36 UTC (rev 15239)
@@ -24,7 +24,6 @@
import org.eclipse.jface.viewers.TreeViewer;
import org.eclipse.jface.window.IShellProvider;
import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.CCombo;
import org.eclipse.swt.events.ModifyEvent;
import org.eclipse.swt.events.ModifyListener;
import org.eclipse.swt.events.SelectionAdapter;
@@ -32,6 +31,7 @@
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Combo;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Label;
@@ -95,11 +95,11 @@
Label label = new Label(composite,SWT.NONE);
label.setText("Sperator Char : ");
- final CCombo speratorCombo = new CCombo(composite,SWT.BORDER);
+ final Combo speratorCombo = new Combo(composite,SWT.BORDER|SWT.READ_ONLY);
speratorCombo.add(" ");
speratorCombo.add("/");
- speratorCombo.select(0);
- speratorCombo.setEditable(false);
+ speratorCombo.select(1);
+// speratorCombo.setEditable(false);
gd = new GridData(GridData.FILL_HORIZONTAL);
speratorCombo.setLayoutData(gd);
speratorCombo.addModifyListener(new ModifyListener(){
Modified:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksStuffPropertyDetailPage.java
===================================================================
---
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksStuffPropertyDetailPage.java 2009-05-13
10:02:54 UTC (rev 15238)
+++
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksStuffPropertyDetailPage.java 2009-05-13
10:37:36 UTC (rev 15239)
@@ -139,8 +139,17 @@
}
}
if (creator != null) {
- creator.createExtendUI((AdapterFactoryEditingDomain) formEditor.getEditingDomain(),
formToolkit,
+ List<AttributeFieldEditPart> list =
creator.createExtendUI((AdapterFactoryEditingDomain) formEditor.getEditingDomain(),
formToolkit,
detailsComposite, getModel(), getFormEditor());
+ if(list != null){
+ for (Iterator<?> iterator = list.iterator(); iterator.hasNext();) {
+ AttributeFieldEditPart attributeFieldEditPart = (AttributeFieldEditPart)
iterator.next();
+ Object attribute = attributeFieldEditPart.getAttribute();
+ if(attribute != null){
+ currentPropertyUIMap.put(attribute, attributeFieldEditPart);
+ }
+ }
+ }
}
formToolkit.paintBordersFor(detailsComposite);
detailsComposite.pack();
Modified:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/datasource/DirectUICreator.java
===================================================================
---
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/datasource/DirectUICreator.java 2009-05-13
10:02:54 UTC (rev 15238)
+++
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/datasource/DirectUICreator.java 2009-05-13
10:37:36 UTC (rev 15239)
@@ -10,8 +10,14 @@
******************************************************************************/
package org.jboss.tools.smooks.configuration.editors.datasource;
+import java.util.Collections;
+import java.util.Iterator;
+import java.util.List;
+
import org.eclipse.emf.ecore.EAttribute;
+import org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain;
import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
+import org.eclipse.emf.edit.provider.IItemPropertySource;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.ui.forms.widgets.FormToolkit;
import org.jboss.tools.smooks.configuration.editors.AttributeFieldEditPart;
@@ -33,8 +39,9 @@
* org.eclipse.emf.edit.provider.IItemPropertyDescriptor, java.lang.Object,
* org.eclipse.emf.ecore.EAttribute)
*/
- public AttributeFieldEditPart createPropertyUI(FormToolkit toolkit, Composite parent,
IItemPropertyDescriptor propertyDescriptor, Object model,
- EAttribute feature, SmooksMultiFormEditor formEditor) {
+ public AttributeFieldEditPart createPropertyUI(FormToolkit toolkit, Composite parent,
+ IItemPropertyDescriptor propertyDescriptor, Object model, EAttribute feature,
+ SmooksMultiFormEditor formEditor) {
if (feature == DatasourcePackage.eINSTANCE.getDirect_AutoCommit()) {
}
if (feature == DatasourcePackage.eINSTANCE.getDirect_BindOnElementNS()) {
@@ -50,7 +57,59 @@
return super.createPropertyUI(toolkit, parent, propertyDescriptor, model, feature,
formEditor);
}
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.jboss.tools.smooks.configuration.editors.PropertyUICreator#ignoreProperty
+ * (org.eclipse.emf.ecore.EAttribute)
+ */
@Override
+ public boolean ignoreProperty(EAttribute feature) {
+ if (feature == DatasourcePackage.eINSTANCE.getDirect_BindOnElementNS()) {
+ return true;
+ }
+ if (feature == DatasourcePackage.eINSTANCE.getDirect_BindOnElement()) {
+ return true;
+ }
+ return super.ignoreProperty(feature);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.jboss.tools.smooks.configuration.editors.PropertyUICreator#createExtendUI
+ * (org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain,
+ * org.eclipse.ui.forms.widgets.FormToolkit,
+ * org.eclipse.swt.widgets.Composite, java.lang.Object,
+ * org.jboss.tools.smooks.configuration.editors.SmooksMultiFormEditor)
+ */
+ @Override
+ public List<AttributeFieldEditPart> createExtendUI(AdapterFactoryEditingDomain
editingdomain, FormToolkit toolkit,
+ Composite parent, Object model, SmooksMultiFormEditor formEditor) {
+ IItemPropertySource itemPropertySource = (IItemPropertySource)
editingdomain.getAdapterFactory().adapt(model,
+ IItemPropertySource.class);
+ List<IItemPropertyDescriptor> propertyDes =
itemPropertySource.getPropertyDescriptors(model);
+ IItemPropertyDescriptor createOnElementFeature = null;
+ IItemPropertyDescriptor createOnElementFeatureNS = null;
+ for (Iterator<?> iterator = propertyDes.iterator(); iterator.hasNext();) {
+ IItemPropertyDescriptor itemPropertyDescriptor = (IItemPropertyDescriptor)
iterator.next();
+ if (itemPropertyDescriptor.getFeature(model) ==
DatasourcePackage.eINSTANCE.getDirect_BindOnElement()) {
+ createOnElementFeature = itemPropertyDescriptor;
+ }
+ if (itemPropertyDescriptor.getFeature(model) ==
DatasourcePackage.eINSTANCE.getDirect_BindOnElementNS()) {
+ createOnElementFeatureNS = itemPropertyDescriptor;
+ }
+ }
+ if(createOnElementFeature == null || createOnElementFeatureNS == null){
+ return Collections.emptyList();
+ }
+ return this.createElementSelectionSection("Binding On Element",
editingdomain, toolkit, parent, model, formEditor,
+ createOnElementFeature, createOnElementFeatureNS);
+ }
+
+ @Override
public boolean isJavaTypeFeature(EAttribute attribute) {
if (attribute == DatasourcePackage.eINSTANCE.getDirect_Driver()) {
return true;
@@ -60,12 +119,11 @@
@Override
public boolean isSelectorFeature(EAttribute attribute) {
- if (attribute == DatasourcePackage.eINSTANCE.getDirect_BindOnElement()) {
- return true;
- }
+ // if (attribute ==
+ // DatasourcePackage.eINSTANCE.getDirect_BindOnElement()) {
+ // return true;
+ // }
return super.isSelectorFeature(attribute);
}
-
-
}
\ No newline at end of file
Modified:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/freemarker/TemplateUICreator.java
===================================================================
---
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/freemarker/TemplateUICreator.java 2009-05-13
10:02:54 UTC (rev 15238)
+++
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/freemarker/TemplateUICreator.java 2009-05-13
10:37:36 UTC (rev 15239)
@@ -10,6 +10,9 @@
******************************************************************************/
package org.jboss.tools.smooks.configuration.editors.freemarker;
+import java.util.Collections;
+import java.util.List;
+
import org.eclipse.emf.ecore.EAttribute;
import org.eclipse.emf.ecore.xml.type.AnyType;
import org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain;
@@ -48,7 +51,7 @@
}
@Override
- public void createExtendUI(AdapterFactoryEditingDomain editingdomain, FormToolkit
toolkit, Composite parent, Object model,
+ public List<AttributeFieldEditPart> createExtendUI(AdapterFactoryEditingDomain
editingdomain, FormToolkit toolkit, Composite parent, Object model,
SmooksMultiFormEditor formEditor) {
OpenEditorEditInnerContentsAction openCDATAEditorAction = new
OpenEditorEditInnerContentsAction(editingdomain,(AnyType) model,
SmooksUIUtils.VALUE_TYPE_CDATA, "flt");
OpenEditorEditInnerContentsAction openCommentEditorAction = new
OpenEditorEditInnerContentsAction(editingdomain,(AnyType) model,
SmooksUIUtils.VALUE_TYPE_COMMENT, "flt");
@@ -60,6 +63,8 @@
openCDATAEditorAction.setRelateText((Text)cdatatext.getContentControl());
openCommentEditorAction.setRelateText((Text)commenttext.getContentControl());
+
+ return Collections.emptyList();
}
@Override
Modified:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/groovy/GroovyUICreator.java
===================================================================
---
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/groovy/GroovyUICreator.java 2009-05-13
10:02:54 UTC (rev 15238)
+++
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/groovy/GroovyUICreator.java 2009-05-13
10:37:36 UTC (rev 15239)
@@ -10,6 +10,9 @@
******************************************************************************/
package org.jboss.tools.smooks.configuration.editors.groovy;
+import java.util.Collections;
+import java.util.List;
+
import org.eclipse.emf.ecore.EAttribute;
import org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain;
import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
@@ -61,8 +64,9 @@
@Override
- public void createExtendUI(AdapterFactoryEditingDomain editingdomain, FormToolkit
toolkit,
+ public List<AttributeFieldEditPart> createExtendUI(AdapterFactoryEditingDomain
editingdomain, FormToolkit toolkit,
Composite parent, Object model, SmooksMultiFormEditor formEditor) {
+ return Collections.emptyList();
// SmooksUIUtils.createCommentFieldEditor("Script Contents",editingdomain,
toolkit, parent, model);
}
Modified:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/groovy/ScriptUICreator.java
===================================================================
---
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/groovy/ScriptUICreator.java 2009-05-13
10:02:54 UTC (rev 15238)
+++
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/groovy/ScriptUICreator.java 2009-05-13
10:37:36 UTC (rev 15239)
@@ -10,6 +10,9 @@
******************************************************************************/
package org.jboss.tools.smooks.configuration.editors.groovy;
+import java.util.Collections;
+import java.util.List;
+
import org.eclipse.emf.ecore.EAttribute;
import org.eclipse.emf.ecore.xml.type.AnyType;
import org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain;
@@ -42,11 +45,12 @@
}
@Override
- public void createExtendUI(AdapterFactoryEditingDomain editingdomain, FormToolkit
toolkit, Composite parent, Object model,
+ public List<AttributeFieldEditPart> createExtendUI(AdapterFactoryEditingDomain
editingdomain, FormToolkit toolkit, Composite parent, Object model,
SmooksMultiFormEditor formEditor) {
OpenEditorEditInnerContentsAction action2 = new
OpenEditorEditInnerContentsAction(editingdomain,(AnyType) model,
SmooksUIUtils.VALUE_TYPE_COMMENT, "groovy");
AttributeFieldEditPart editPart = SmooksUIUtils.createCommentFieldEditor("Script
Contents", editingdomain, toolkit, parent, model, action2);
action2.setRelateText((Text)editPart.getContentControl());
+ return Collections.emptyList();
}
@Override
Modified:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/smooks/ParamTypeUICreator.java
===================================================================
---
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/smooks/ParamTypeUICreator.java 2009-05-13
10:02:54 UTC (rev 15238)
+++
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/smooks/ParamTypeUICreator.java 2009-05-13
10:37:36 UTC (rev 15239)
@@ -10,6 +10,9 @@
******************************************************************************/
package org.jboss.tools.smooks.configuration.editors.smooks;
+import java.util.Collections;
+import java.util.List;
+
import org.eclipse.emf.ecore.EAttribute;
import org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain;
import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
@@ -45,9 +48,11 @@
}
@Override
- public void createExtendUI(AdapterFactoryEditingDomain editingdomain, FormToolkit
toolkit,
+ public List<AttributeFieldEditPart> createExtendUI(AdapterFactoryEditingDomain
editingdomain, FormToolkit toolkit,
Composite parent, Object model, SmooksMultiFormEditor formEditor) {
SmooksUIUtils.createMixedTextFieldEditor("Text Value", editingdomain,
toolkit, parent, model , false , 500,false,false,null,null);
SmooksUIUtils.createCDATAFieldEditor("CDATA Value", editingdomain, toolkit,
parent, model,null);
+
+ return Collections.emptyList();
}
}
\ No newline at end of file
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-05-13
10:02:54 UTC (rev 15238)
+++
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/uitls/SmooksUIUtils.java 2009-05-13
10:37:36 UTC (rev 15239)
@@ -151,10 +151,12 @@
String displayName = labelText;
if (itemPropertyDescriptor == null) {
} else {
- displayName = itemPropertyDescriptor.getDisplayName(model);
- EAttribute feature = (EAttribute) itemPropertyDescriptor.getFeature(model);
- if (feature.isRequired()) {
- displayName = displayName + "*";
+ if (displayName == null) {
+ displayName = itemPropertyDescriptor.getDisplayName(model);
+ EAttribute feature = (EAttribute) itemPropertyDescriptor.getFeature(model);
+ if (feature.isRequired()) {
+ displayName = displayName + "*";
+ }
}
}
Composite labelComposite = formToolKit.createComposite(parent);
@@ -344,7 +346,7 @@
label = itemPropertyDescriptor.getDisplayName(model);
EAttribute feature = (EAttribute) itemPropertyDescriptor.getFeature(model);
if (feature.isRequired()) {
- label = "*" + label;
+ label = label + "*";
}
}
if (multiText) {
@@ -573,7 +575,13 @@
public static AttributeFieldEditPart createSelectorFieldEditor(FormToolkit toolkit,
Composite parent,
final IItemPropertyDescriptor propertyDescriptor, Object model, final
SmooksGraphicsExtType extType) {
- return createDialogFieldEditor(parent, toolkit, propertyDescriptor, "Browse",
new IFieldDialog() {
+ return createSelectorFieldEditor(null, toolkit, parent, propertyDescriptor, model,
extType);
+ }
+
+ public static AttributeFieldEditPart createSelectorFieldEditor(String labelText,
FormToolkit toolkit,
+ Composite parent, final IItemPropertyDescriptor propertyDescriptor, Object model,
+ final SmooksGraphicsExtType extType) {
+ return createDialogFieldEditor(labelText, parent, toolkit, propertyDescriptor,
"Browse", new IFieldDialog() {
public Object open(Shell shell) {
SelectoreSelectionDialog dialog = new SelectoreSelectionDialog(shell, extType);
if (dialog.open() == Dialog.OK) {
@@ -989,11 +997,26 @@
return createDialogFieldEditor(parent, toolkit, propertyDescriptor, buttonName, dialog,
model, false, null);
}
+ public static AttributeFieldEditPart createDialogFieldEditor(String label, Composite
parent, FormToolkit toolkit,
+ final IItemPropertyDescriptor propertyDescriptor, String buttonName, IFieldDialog
dialog,
+ final EObject model) {
+ return createDialogFieldEditor(label, parent, toolkit, propertyDescriptor, buttonName,
dialog, model, false,
+ null);
+ }
+
public static AttributeFieldEditPart createDialogFieldEditor(Composite parent,
FormToolkit toolkit,
final IItemPropertyDescriptor propertyDescriptor, String buttonName, IFieldDialog
dialog,
final EObject model, boolean labelLink, IHyperlinkListener listener) {
+ return createDialogFieldEditor(null, parent, toolkit, propertyDescriptor, buttonName,
dialog, model, labelLink,
+ listener);
+ }
+
+ public static AttributeFieldEditPart createDialogFieldEditor(String labelText, Composite
parent,
+ FormToolkit toolkit, final IItemPropertyDescriptor propertyDescriptor, String
buttonName,
+ IFieldDialog dialog, final EObject model, boolean labelLink, IHyperlinkListener
listener) {
AttributeFieldEditPart editpart = new AttributeFieldEditPart();
- FieldMarkerWrapper wrapper = createFieldEditorLabel(parent, toolkit,
propertyDescriptor, model, labelLink);
+ FieldMarkerWrapper wrapper = createFieldEditorLabel(labelText, parent, toolkit,
propertyDescriptor, model,
+ labelLink);
editpart.setFieldMarker(wrapper.getMarker());
Control label = wrapper.getLabelControl();
if (label instanceof Hyperlink && listener != null) {
Modified:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/xsl/TemplateUICreator.java
===================================================================
---
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/xsl/TemplateUICreator.java 2009-05-13
10:02:54 UTC (rev 15238)
+++
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/xsl/TemplateUICreator.java 2009-05-13
10:37:36 UTC (rev 15239)
@@ -10,6 +10,9 @@
******************************************************************************/
package org.jboss.tools.smooks.configuration.editors.xsl;
+import java.util.Collections;
+import java.util.List;
+
import org.eclipse.emf.ecore.EAttribute;
import org.eclipse.emf.ecore.xml.type.AnyType;
import org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain;
@@ -64,7 +67,7 @@
}
@Override
- public void createExtendUI(AdapterFactoryEditingDomain editingdomain, FormToolkit
toolkit, Composite parent, Object model,
+ public List<AttributeFieldEditPart> createExtendUI(AdapterFactoryEditingDomain
editingdomain, FormToolkit toolkit, Composite parent, Object model,
SmooksMultiFormEditor formEditor) {
OpenEditorEditInnerContentsAction openCdataEditorAction = new
OpenEditorEditInnerContentsAction(editingdomain,(AnyType) model,
SmooksUIUtils.VALUE_TYPE_CDATA, "xsl");
OpenEditorEditInnerContentsAction openCommentEditorAction = new
OpenEditorEditInnerContentsAction(editingdomain,(AnyType) model,
SmooksUIUtils.VALUE_TYPE_COMMENT, "xsl");
@@ -74,6 +77,8 @@
AttributeFieldEditPart text2 = SmooksUIUtils.createCommentFieldEditor("Template
Contents (Comment)", editingdomain, toolkit, parent, model,
openCommentEditorAction);
openCdataEditorAction.setRelateText((Text)text1.getContentControl());
openCommentEditorAction.setRelateText((Text)text2.getContentControl());
+
+ return Collections.emptyList();
}
}
\ No newline at end of file