summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormistria2012-01-05 11:41:58 (EST)
committer vzurczak2012-01-05 11:41:58 (EST)
commit95ef36b7c9e20aef3ee3cd4d59f1d686d9d92305 (patch)
tree359242bc5325650721feba1c0f52f69c76cc8dcf
parent78ddd98a072e376a2bed1e95dc8a0e4ce2b33feb (diff)
downloadorg.eclipse.bpel-95ef36b7c9e20aef3ee3cd4d59f1d686d9d92305.zip
org.eclipse.bpel-95ef36b7c9e20aef3ee3cd4d59f1d686d9d92305.tar.gz
org.eclipse.bpel-95ef36b7c9e20aef3ee3cd4d59f1d686d9d92305.tar.bz2
Apply the patch provided by Mickaƫl Istria
See bug #357605
-rw-r--r--plugins/org.eclipse.bpel.examples.extensionPoints/src/org/eclipse/bpel/examples/extensionpoints/expression/editors/SimpleTextExpressionEditor.java14
-rw-r--r--plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/expressions/AbstractExpressionEditor.java26
-rw-r--r--plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/expressions/DefaultExpressionEditor.java11
-rw-r--r--plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/expressions/IExpressionEditor.java5
-rw-r--r--plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/expressions/XPathExpressionEditor.java23
-rw-r--r--plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/properties/DateTimeSelector.java8
-rw-r--r--plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/properties/DurationSelector.java8
-rw-r--r--plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/properties/ExpressionSection.java2
-rw-r--r--plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/properties/TextSection.java4
9 files changed, 30 insertions, 71 deletions
diff --git a/plugins/org.eclipse.bpel.examples.extensionPoints/src/org/eclipse/bpel/examples/extensionpoints/expression/editors/SimpleTextExpressionEditor.java b/plugins/org.eclipse.bpel.examples.extensionPoints/src/org/eclipse/bpel/examples/extensionpoints/expression/editors/SimpleTextExpressionEditor.java
index 3030d14..a7ce6fa 100644
--- a/plugins/org.eclipse.bpel.examples.extensionPoints/src/org/eclipse/bpel/examples/extensionpoints/expression/editors/SimpleTextExpressionEditor.java
+++ b/plugins/org.eclipse.bpel.examples.extensionPoints/src/org/eclipse/bpel/examples/extensionpoints/expression/editors/SimpleTextExpressionEditor.java
@@ -2,17 +2,13 @@ package org.eclipse.bpel.examples.extensionpoints.expression.editors;
import org.eclipse.bpel.ui.expressions.AbstractExpressionEditor;
-import org.eclipse.bpel.ui.properties.BPELPropertySection;
-import org.eclipse.bpel.ui.properties.TextSection;
import org.eclipse.core.resources.IMarker;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.IEditorPart;
import org.eclipse.ui.IPropertyListener;
-import org.eclipse.ui.texteditor.AbstractDecoratedTextEditor;
-import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory;
+import org.eclipse.ui.forms.widgets.FormToolkit;
/**
* Simple text editor used as an expression editor.
@@ -58,8 +54,8 @@ public class SimpleTextExpressionEditor extends AbstractExpressionEditor {
*/
@Override
- public void createControls (Composite parent, BPELPropertySection aSection) {
- super.createControls(parent, aSection);
+ public void createControls (Composite parent, FormToolkit toolkit) {
+ super.createControls(parent, toolkit);
createEditor(parent);
}
@@ -90,8 +86,6 @@ public class SimpleTextExpressionEditor extends AbstractExpressionEditor {
fInput = new TextEditorInput( fBody, getModelObject(), getExprType() );
- TabbedPropertySheetWidgetFactory wf = getWidgetFactory();
-
fEditorComposite = wf.createComposite(parent, SWT.BORDER);
fEditorComposite.setLayout( new FillLayout() );
@@ -150,7 +144,7 @@ public class SimpleTextExpressionEditor extends AbstractExpressionEditor {
fPropertyListener = new IPropertyListener() {
@SuppressWarnings("synthetic-access")
public void propertyChanged(Object source, int propId) {
- if (!updating && propId == IEditorPart.PROP_DIRTY && fEditorPart.isDirty() && !((TextSection)fSection).isExecutingStoreCommand()) {
+ if (!updating && propId == IEditorPart.PROP_DIRTY && fEditorPart.isDirty()) {
notifyChanged();
}
}
diff --git a/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/expressions/AbstractExpressionEditor.java b/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/expressions/AbstractExpressionEditor.java
index d99bb29..1b3af17 100644
--- a/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/expressions/AbstractExpressionEditor.java
+++ b/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/expressions/AbstractExpressionEditor.java
@@ -17,7 +17,6 @@ import org.eclipse.bpel.common.ui.composite.EditorInViewManager;
import org.eclipse.bpel.ui.BPELUIPlugin;
import org.eclipse.bpel.ui.IBPELUIConstants;
import org.eclipse.bpel.ui.commands.CompoundCommand;
-import org.eclipse.bpel.ui.properties.BPELPropertySection;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.ui.IEditorInput;
@@ -27,7 +26,7 @@ import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.PartInitException;
import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory;
+import org.eclipse.ui.forms.widgets.FormToolkit;
/**
* @author IBM Original Contribution.
@@ -41,12 +40,12 @@ public abstract class AbstractExpressionEditor implements IExpressionEditor {
protected EditorInViewManager fManager;
- /** The owner BPELProperty section */
- protected BPELPropertySection fSection;
-
/** The underlying model object */
private Object fModelObject;
+ /** a {@link FormToolkit} to use */
+ protected FormToolkit wf;
+
/** The expression type */
private String fExprType ;
@@ -54,8 +53,8 @@ public abstract class AbstractExpressionEditor implements IExpressionEditor {
* @see org.eclipse.bpel.ui.expressions.IExpressionEditor#createControls(org.eclipse.swt.widgets.Composite,
* org.eclipse.bpel.ui.properties.BPELPropertySection)
*/
- public void createControls(Composite parent, BPELPropertySection aSection) {
- this.fSection = aSection;
+ public void createControls(Composite parent, FormToolkit toolkit) {
+ this.wf = toolkit;
}
/**
@@ -139,16 +138,6 @@ public abstract class AbstractExpressionEditor implements IExpressionEditor {
}
/**
- * Return the BPELPropertySection in which we are created.
- *
- * @return the BPELProperty section.
- */
-
- public BPELPropertySection getSection() {
- return fSection;
- }
-
- /**
* @see org.eclipse.bpel.ui.expressions.IExpressionEditor#setExpressionType(java.lang.String)
*/
@@ -172,7 +161,4 @@ public abstract class AbstractExpressionEditor implements IExpressionEditor {
return fModelObject;
}
- protected TabbedPropertySheetWidgetFactory getWidgetFactory() {
- return fSection.getWidgetFactory();
- }
}
diff --git a/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/expressions/DefaultExpressionEditor.java b/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/expressions/DefaultExpressionEditor.java
index 6ef8c7e..ab67842 100644
--- a/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/expressions/DefaultExpressionEditor.java
+++ b/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/expressions/DefaultExpressionEditor.java
@@ -12,8 +12,6 @@ package org.eclipse.bpel.ui.expressions;
import org.eclipse.bpel.ui.editors.TextEditor;
import org.eclipse.bpel.ui.editors.TextEditorInput;
-import org.eclipse.bpel.ui.properties.BPELPropertySection;
-import org.eclipse.bpel.ui.properties.TextSection;
import org.eclipse.core.resources.IMarker;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.FocusAdapter;
@@ -24,7 +22,7 @@ import org.eclipse.swt.widgets.Composite;
import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.IEditorPart;
import org.eclipse.ui.IPropertyListener;
-import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory;
+import org.eclipse.ui.forms.widgets.FormToolkit;
/**
@@ -63,8 +61,8 @@ public class DefaultExpressionEditor extends AbstractExpressionEditor {
*/
@Override
- public void createControls(Composite parent, BPELPropertySection aSection) {
- super.createControls(parent, aSection);
+ public void createControls(Composite parent, FormToolkit toolkit) {
+ super.createControls(parent, toolkit);
createEditor(parent);
}
@@ -92,7 +90,6 @@ public class DefaultExpressionEditor extends AbstractExpressionEditor {
protected void createEditor(Composite parent) {
IEditorInput input = new TextEditorInput( fBody, getModelObject(), getExprType() );
- TabbedPropertySheetWidgetFactory wf = getWidgetFactory();
editorComposite = wf.createComposite(parent, SWT.BORDER);
editorComposite.setLayout( new FillLayout() );
@@ -153,7 +150,7 @@ public class DefaultExpressionEditor extends AbstractExpressionEditor {
if (propertyListener == null) {
propertyListener = new IPropertyListener() {
public void propertyChanged(Object source, int propId) {
- if (!updating && propId == IEditorPart.PROP_DIRTY && editor.isDirty() && !((TextSection)fSection).isExecutingStoreCommand()) {
+ if (!updating && propId == IEditorPart.PROP_DIRTY && editor.isDirty()) {
notifyChanged();
}
}
diff --git a/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/expressions/IExpressionEditor.java b/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/expressions/IExpressionEditor.java
index d4af5fe..089fc45 100644
--- a/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/expressions/IExpressionEditor.java
+++ b/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/expressions/IExpressionEditor.java
@@ -14,6 +14,7 @@ import org.eclipse.bpel.ui.commands.CompoundCommand;
import org.eclipse.bpel.ui.properties.BPELPropertySection;
import org.eclipse.core.resources.IMarker;
import org.eclipse.swt.widgets.Composite;
+import org.eclipse.ui.forms.widgets.FormToolkit;
/**
@@ -36,9 +37,9 @@ public interface IExpressionEditor {
/**
* Creates the editor widgets.
* @param parent the parent composite
- * @param section the section
+ * @param tk a {@link FormToolkit}, retrieved for example from the host {@link BPELPropertySection}
*/
- void createControls(Composite parent, BPELPropertySection section);
+ void createControls(Composite parent, FormToolkit tk);
/**
* Dispose of the editor.
diff --git a/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/expressions/XPathExpressionEditor.java b/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/expressions/XPathExpressionEditor.java
index 443412e..fe04f9d 100644
--- a/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/expressions/XPathExpressionEditor.java
+++ b/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/expressions/XPathExpressionEditor.java
@@ -25,7 +25,6 @@ import org.eclipse.bpel.ui.editors.xpath.XPathTextEditor;
import org.eclipse.bpel.ui.properties.BPELPropertySection;
import org.eclipse.bpel.ui.properties.DateTimeSelector;
import org.eclipse.bpel.ui.properties.DurationSelector;
-import org.eclipse.bpel.ui.properties.TextSection;
import org.eclipse.bpel.ui.util.BPELDateTimeHelpers;
import org.eclipse.bpel.ui.util.BPELUtil;
import org.eclipse.core.resources.IMarker;
@@ -48,7 +47,7 @@ import org.eclipse.swt.widgets.Layout;
import org.eclipse.ui.IEditorPart;
import org.eclipse.ui.IPropertyListener;
import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory;
+import org.eclipse.ui.forms.widgets.FormToolkit;
/**
@@ -115,15 +114,13 @@ public class XPathExpressionEditor extends AbstractExpressionEditor {
* Create controls ..
*/
@Override
- public void createControls(Composite parent, BPELPropertySection aSection) {
- super.createControls(parent, aSection);
+ public void createControls(Composite parent, FormToolkit toolkit) {
+ super.createControls(parent, toolkit);
createEditor(parent);
}
protected void createEditor(Composite parent) {
- TabbedPropertySheetWidgetFactory wf = getWidgetFactory();
-
this.mainComposite = wf.createComposite( parent );
FormLayout layout = new FormLayout();
layout.marginWidth = layout.marginHeight = 0;
@@ -208,8 +205,6 @@ public class XPathExpressionEditor extends AbstractExpressionEditor {
return textEditorComposite;
}
- // otherwise create it ...
- TabbedPropertySheetWidgetFactory wf = getWidgetFactory();
textEditorComposite = wf.createComposite(editorComposite,SWT.BORDER);
textEditorComposite.setLayout(new FillLayout());
@@ -240,8 +235,6 @@ public class XPathExpressionEditor extends AbstractExpressionEditor {
return dateTimeEditorComposite;
}
- TabbedPropertySheetWidgetFactory wf = getWidgetFactory();
-
dateTimeEditorComposite = wf.createComposite(editorComposite, SWT.NONE);
FormLayout layout = new FormLayout();
@@ -283,10 +276,7 @@ public class XPathExpressionEditor extends AbstractExpressionEditor {
int[] values = dateTimeSelector.getValues();
textEditorInput.setEditorContent ( BPELDateTimeHelpers.createXPathDateTime(values, false) , getModelObject() );
}
-
- if (!((TextSection) fSection).isExecutingStoreCommand()) {
- notifyChanged();
- }
+ notifyChanged();
}
public void widgetDefaultSelected(SelectionEvent e) {
@@ -312,7 +302,6 @@ public class XPathExpressionEditor extends AbstractExpressionEditor {
return durationEditorComposite;
}
- TabbedPropertySheetWidgetFactory wf = getWidgetFactory();
durationEditorComposite = wf.createComposite(editorComposite, SWT.NONE);
FormLayout layout = new FormLayout();
layout.marginWidth = layout.marginHeight = 0;
@@ -345,10 +334,6 @@ public class XPathExpressionEditor extends AbstractExpressionEditor {
textEditorInput.setEditorContent( BPELDateTimeHelpers.createXPathDuration(duration) , getModelObject() );
}
- //
- if (!((TextSection)fSection).isExecutingStoreCommand() ) {
- notifyChanged();
- }
}
public void widgetDefaultSelected(SelectionEvent e) { }
});
diff --git a/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/properties/DateTimeSelector.java b/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/properties/DateTimeSelector.java
index becd8a6..9426c0b 100644
--- a/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/properties/DateTimeSelector.java
+++ b/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/properties/DateTimeSelector.java
@@ -29,7 +29,7 @@ import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.TypedListener;
-import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory;
+import org.eclipse.ui.forms.widgets.FormToolkit;
/**
@@ -84,12 +84,12 @@ public class DateTimeSelector extends Composite {
private static String[] MONTH_NAMES;
- private TabbedPropertySheetWidgetFactory wf;
+ private FormToolkit wf;
- public DateTimeSelector(TabbedPropertySheetWidgetFactory factory, Composite parent, int style, int yearMin, int yearMax) {
+ public DateTimeSelector(FormToolkit toolkit, Composite parent, int style, int yearMin, int yearMax) {
super(parent, style);
combo = new Combo[6];
- this.wf = factory;
+ this.wf = toolkit;
this.yearMin = yearMin;
this.yearMax = yearMax;
if (MONTH_NAMES == null) {
diff --git a/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/properties/DurationSelector.java b/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/properties/DurationSelector.java
index 61910f1..cb5186f 100644
--- a/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/properties/DurationSelector.java
+++ b/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/properties/DurationSelector.java
@@ -27,7 +27,7 @@ import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Text;
import org.eclipse.swt.widgets.TypedListener;
-import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory;
+import org.eclipse.ui.forms.widgets.FormToolkit;
@@ -62,11 +62,11 @@ public class DurationSelector extends Composite {
// protected String dateSepText = "/";
// protected String timeSepText = ":";
- private TabbedPropertySheetWidgetFactory wf;
+ private FormToolkit wf;
- public DurationSelector(TabbedPropertySheetWidgetFactory factory, Composite parent, int style) {
+ public DurationSelector(FormToolkit toolkit, Composite parent, int style) {
super(parent, style);
- this.wf = factory;
+ this.wf = toolkit;
setLayout(new FillLayout());
createControls(this);
}
diff --git a/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/properties/ExpressionSection.java b/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/properties/ExpressionSection.java
index 1b179c1..2f10d3f 100644
--- a/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/properties/ExpressionSection.java
+++ b/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/properties/ExpressionSection.java
@@ -679,7 +679,7 @@ public abstract class ExpressionSection extends TextSection {
}
editorLanguage = language;
- fEditor.createControls(parent, this);
+ fEditor.createControls(parent, getWidgetFactory());
fEditor.addListener(new IExpressionEditor.Listener() {
public void notifyChanged() {
diff --git a/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/properties/TextSection.java b/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/properties/TextSection.java
index 2711d65..9dfab13 100644
--- a/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/properties/TextSection.java
+++ b/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/properties/TextSection.java
@@ -262,8 +262,4 @@ public abstract class TextSection extends BPELPropertySection implements IGetExp
}
editor.gotoTextMarker(marker, useType, fModelObject);
}
-
- public boolean isExecutingStoreCommand() {
- return false; // isExecutingStoreCommand;
- }
}