Author: koen.aers(a)jboss.com
Date: 2009-05-29 21:34:31 -0400 (Fri, 29 May 2009)
New Revision: 15612
Added:
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/properties/JavaTaskArgumentsSection.java
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/properties/JavaTaskFieldsSection.java
Modified:
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/plugin.xml
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/Activator.java
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/preferences/Jbpm4LocationsPage.java
Log:
- allow for configurations of jbpm 4 runtimes (GPD-346)
- fields and method arguments configuration pages
Modified: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/plugin.xml
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/plugin.xml 2009-05-29 20:58:15 UTC (rev
15611)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/plugin.xml 2009-05-30 01:34:31 UTC (rev
15612)
@@ -315,6 +315,16 @@
category="general"
id="org.jboss.tools.jpdl4.subprocess"
label="Subprocess"/>
+ <propertyTab
+ afterTab="org.jboss.tools.jpdl4.general"
+ category="general"
+ id="org.jboss.tools.jpdl4.javaTask.fields"
+ label="Fields"/>
+ <propertyTab
+ afterTab="org.jboss.tools.jpdl4.javaTask.fields"
+ category="general"
+ id="org.jboss.tools.jpdl4.javaTask.arguments"
+ label="Arguments"/>
<!-- <propertyTab
afterTab="org.jboss.tools.jpdl4.general"
category="details"
@@ -561,6 +571,18 @@
tab="org.jboss.tools.jpdl4.general">
<input
type="org.jboss.tools.flow.jpdl4.model.OutputParameter"/>
</propertySection>
+ <propertySection
+
class="org.jboss.tools.flow.jpdl4.properties.JavaTaskFieldsSection"
+ id="org.jboss.tools.jpdl4.javaTask.fields"
+ tab="org.jboss.tools.jpdl4.javaTask.fields">
+ <input type="org.jboss.tools.flow.jpdl4.model.JavaTask"/>
+ </propertySection>
+ <propertySection
+
class="org.jboss.tools.flow.jpdl4.properties.JavaTaskArgumentsSection"
+ id="org.jboss.tools.jpdl4.javaTask.arguments"
+ tab="org.jboss.tools.jpdl4.javaTask.arguments">
+ <input type="org.jboss.tools.flow.jpdl4.model.JavaTask"/>
+ </propertySection>
</propertySections>
</extension>
<extension
Modified:
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/Activator.java
===================================================================
---
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/Activator.java 2009-05-29
20:58:15 UTC (rev 15611)
+++
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/Activator.java 2009-05-30
01:34:31 UTC (rev 15612)
@@ -17,6 +17,7 @@
*/
import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.jboss.tools.jbpm.preferences.PreferencesManager;
import org.osgi.framework.BundleContext;
public class Activator extends AbstractUIPlugin {
@@ -27,6 +28,10 @@
public Activator() {
}
+
+ public PreferencesManager getPreferencesManager() {
+ return PreferencesManager.getPreferencesManager(this);
+ }
public void start(BundleContext context) throws Exception {
super.start(context);
Modified:
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/preferences/Jbpm4LocationsPage.java
===================================================================
---
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/preferences/Jbpm4LocationsPage.java 2009-05-29
20:58:15 UTC (rev 15611)
+++
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/preferences/Jbpm4LocationsPage.java 2009-05-30
01:34:31 UTC (rev 15612)
@@ -21,15 +21,24 @@
*/
package org.jboss.tools.flow.jpdl4.preferences;
+import org.eclipse.core.runtime.Path;
import org.eclipse.swt.widgets.Shell;
+import org.jboss.tools.flow.jpdl4.Activator;
import org.jboss.tools.jbpm.preferences.AddJbpmInstallationDialog;
import org.jboss.tools.jbpm.preferences.JbpmLocationsPage;
public class Jbpm4LocationsPage extends JbpmLocationsPage {
+ public Jbpm4LocationsPage() {
+ super(Activator.getDefault());
+ }
+
protected AddJbpmInstallationDialog createAddJbpmInstallationDialog(Shell shell) {
- return new AddJbpmInstallationDialog(getShell()) {
- public String getVersion() {
+ return new AddJbpmInstallationDialog(getShell(), Activator.getDefault()) {
+ protected boolean isValidJbpmInstallation() {
+ return new Path(getLocation()).append("/jbpm.jar").toFile().exists();
+ }
+ protected String getVersion() {
return "4.0";
}
};
Added:
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/properties/JavaTaskArgumentsSection.java
===================================================================
---
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/properties/JavaTaskArgumentsSection.java
(rev 0)
+++
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/properties/JavaTaskArgumentsSection.java 2009-05-30
01:34:31 UTC (rev 15612)
@@ -0,0 +1,88 @@
+package org.jboss.tools.flow.jpdl4.properties;
+
+import org.eclipse.swt.custom.CLabel;
+import org.eclipse.swt.layout.FormAttachment;
+import org.eclipse.swt.layout.FormData;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetPage;
+import org.jboss.tools.flow.common.properties.IPropertyId;
+
+public class JavaTaskArgumentsSection extends JpdlPropertySection implements IPropertyId
{
+
+ private final static String NO_FIELDS = "The configured class has no fields that
can be configured.";
+ private final static String CONFIGURE_FIELDS = "Configure the value of the
supported fields as needed.";
+
+ private CLabel infoLabel;
+
+// private ModifyListener nameTextModifyListener = new ModifyListener() {
+// public void modifyText(ModifyEvent arg0) {
+// IPropertySource input = getInput();
+// if (input != null) {
+// RenameElementCommand rec = new RenameElementCommand();
+// rec.setSource(input);
+// rec.setOldName((String)input.getPropertyValue(NAME));
+// rec.setName(nameText.getText());
+// getCommandStack().execute(rec);
+// }
+// }
+// };
+//
+// private CommandStackListener commandStackListener = new CommandStackListener() {
+// public void commandStackChanged(EventObject event) {
+// refresh();
+// }
+// };
+//
+// public void dispose() {
+// if (getCommandStack() != null) {
+// getCommandStack().removeCommandStackListener(commandStackListener);
+// }
+// super.dispose();
+// }
+
+ public void createControls(Composite parent,
+ TabbedPropertySheetPage aTabbedPropertySheetPage) {
+ super.createControls(parent, aTabbedPropertySheetPage);
+ Composite composite = getFlatFormComposite();
+ createInfoLabel(composite);
+ createFieldsComposite(composite);
+ }
+
+
+ private void createInfoLabel(Composite parent) {
+ infoLabel = getWidgetFactory().createCLabel(parent, NO_FIELDS);
+ FormData data = new FormData();
+ data.left = new FormAttachment(0, 0);
+ data.top = new FormAttachment(0, 5);
+ data.right = new FormAttachment(100, 0);
+ infoLabel.setLayoutData(data);
+ }
+
+ private void createFieldsComposite(Composite parent) {
+ Composite fieldsComposite = getWidgetFactory().createComposite(parent);
+ FormData data = new FormData();
+ data.top = new FormAttachment(0, 0);
+ data.left = new FormAttachment(JpdlPropertySection.SECOND_COLUMN_LEFT_LIMIT, 0);
+ data.right = new FormAttachment(100, 0);
+ fieldsComposite.setLayoutData(data);
+ }
+
+ protected void hookListeners() {
+// nameText.addModifyListener(nameTextModifyListener);
+ }
+
+ protected void unhookListeners() {
+// nameText.removeModifyListener(nameTextModifyListener);
+ }
+
+ protected void updateValues() {
+// IPropertySource input = getInput();
+// if (input != null) {
+// nameText.setText(getValueNotNull((String)input.getPropertyValue(NAME)));
+// } else {
+// nameText.setText("");
+// }
+ }
+
+}
Property changes on:
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/properties/JavaTaskArgumentsSection.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/properties/JavaTaskFieldsSection.java
===================================================================
---
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/properties/JavaTaskFieldsSection.java
(rev 0)
+++
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/properties/JavaTaskFieldsSection.java 2009-05-30
01:34:31 UTC (rev 15612)
@@ -0,0 +1,124 @@
+package org.jboss.tools.flow.jpdl4.properties;
+
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.gef.EditPart;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.swt.custom.CLabel;
+import org.eclipse.swt.layout.FormAttachment;
+import org.eclipse.swt.layout.FormData;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.ui.views.properties.IPropertySource;
+import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetPage;
+import org.jboss.tools.flow.common.properties.IPropertyId;
+import org.jboss.tools.flow.common.wrapper.ModelEvent;
+import org.jboss.tools.flow.common.wrapper.ModelListener;
+import org.jboss.tools.flow.common.wrapper.Wrapper;
+import org.jboss.tools.flow.jpdl4.model.JavaTask;
+
+public class JavaTaskFieldsSection extends JpdlPropertySection implements IPropertyId {
+
+ private final static String NO_FIELDS = "The configured class has no fields that
can be configured.";
+ private final static String CONFIGURE_FIELDS = "Configure the value of the
supported fields as needed.";
+
+ private Wrapper input;
+
+ private CLabel infoLabel;
+
+ private ModelListener modelListener = new ModelListener() {
+ public void modelChanged(ModelEvent event) {
+ System.out.println("changeDiscriminator; " +
event.getChangeDiscriminator());
+ System.out.println("changeType " + event.getChangeType());
+ }
+
+ };
+
+// private ModifyListener nameTextModifyListener = new ModifyListener() {
+// public void modifyText(ModifyEvent arg0) {
+// IPropertySource input = getInput();
+// if (input != null) {
+// RenameElementCommand rec = new RenameElementCommand();
+// rec.setSource(input);
+// rec.setOldName((String)input.getPropertyValue(NAME));
+// rec.setName(nameText.getText());
+// getCommandStack().execute(rec);
+// }
+// }
+// };
+//
+// private CommandStackListener commandStackListener = new CommandStackListener() {
+// public void commandStackChanged(EventObject event) {
+// refresh();
+// }
+// };
+//
+ public void dispose() {
+ if (input != null) {
+ input.removeListener(modelListener);
+ }
+ super.dispose();
+ }
+
+ public void createControls(Composite parent,
+ TabbedPropertySheetPage aTabbedPropertySheetPage) {
+ super.createControls(parent, aTabbedPropertySheetPage);
+ Composite composite = getFlatFormComposite();
+ createInfoLabel(composite);
+ createFieldsComposite(composite);
+ }
+
+
+ private void createInfoLabel(Composite parent) {
+ infoLabel = getWidgetFactory().createCLabel(parent, NO_FIELDS);
+ FormData data = new FormData();
+ data.left = new FormAttachment(0, 0);
+ data.top = new FormAttachment(0, 5);
+ data.right = new FormAttachment(100, 0);
+ infoLabel.setLayoutData(data);
+ }
+
+ private void createFieldsComposite(Composite parent) {
+ Composite fieldsComposite = getWidgetFactory().createComposite(parent);
+ FormData data = new FormData();
+ data.top = new FormAttachment(0, 0);
+ data.left = new FormAttachment(JpdlPropertySection.SECOND_COLUMN_LEFT_LIMIT, 0);
+ data.right = new FormAttachment(100, 0);
+ fieldsComposite.setLayoutData(data);
+ }
+
+ public void setInput(IWorkbenchPart part, ISelection selection) {
+ if (input != null) {
+ input.removeListener(modelListener);
+ }
+ super.setInput(part, selection);
+ if (selection instanceof IStructuredSelection) {
+ Object object = ((IStructuredSelection)selection).getFirstElement();
+ if (object instanceof EditPart && ((EditPart)object).getModel() instanceof
Wrapper) {
+ input = (Wrapper)((EditPart)object).getModel();
+ input.addListener(modelListener);
+ return;
+ }
+ }
+ input = null;
+ }
+
+ protected void hookListeners() {
+// nameText.addModifyListener(nameTextModifyListener);
+ }
+
+ protected void unhookListeners() {
+// nameText.removeModifyListener(nameTextModifyListener);
+ }
+
+ protected void updateValues() {
+// IPropertySource input = getInput();
+// if (input != null) {
+// nameText.setText(getValueNotNull((String)input.getPropertyValue(NAME)));
+// } else {
+// nameText.setText("");
+// }
+ }
+
+}
Property changes on:
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/properties/JavaTaskFieldsSection.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Show replies by date