Author: koen.aers(a)jboss.com
Date: 2008-12-01 21:33:11 -0500 (Mon, 01 Dec 2008)
New Revision: 12194
Added:
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/wizard/
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/wizard/NewJpdl4FileWizard.java
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/wizard/NewJpdl4FileWizardPage.java
Modified:
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/META-INF/MANIFEST.MF
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/build.properties
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/plugin.xml
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editor/JpdlEditor.java
Log:
added new file wizard
Modified: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/META-INF/MANIFEST.MF
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/META-INF/MANIFEST.MF 2008-12-02 02:19:45
UTC (rev 12193)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/META-INF/MANIFEST.MF 2008-12-02 02:33:11
UTC (rev 12194)
@@ -6,10 +6,11 @@
Bundle-Vendor: JBoss, a Division of Red Hat
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Require-Bundle: org.jboss.tools.flow.common;bundle-version="1.0.0",
- org.eclipse.core.resources;bundle-version="3.4.0",
- org.eclipse.gef;bundle-version="3.4.0",
- org.eclipse.ui;bundle-version="3.4.0",
- org.eclipse.core.runtime;bundle-version="3.4.0"
+ org.eclipse.core.resources;bundle-version="3.4.1",
+ org.eclipse.gef;bundle-version="3.4.1",
+ org.eclipse.ui;bundle-version="3.4.1",
+ org.eclipse.core.runtime;bundle-version="3.4.0",
+ org.eclipse.ui.ide;bundle-version="3.4.1"
Bundle-ActivationPolicy: lazy
Bundle-Activator: org.jboss.tools.flow.jpdl4.Activator
Export-Package: org.jboss.tools.flow.jpdl4.model
Modified: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/build.properties
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/build.properties 2008-12-02 02:19:45 UTC
(rev 12193)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/build.properties 2008-12-02 02:33:11 UTC
(rev 12194)
@@ -2,4 +2,5 @@
output.. = bin/
bin.includes = META-INF/,\
.,\
- plugin.xml
+ plugin.xml,\
+ icons/
Modified: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/plugin.xml
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/plugin.xml 2008-12-02 02:19:45 UTC (rev
12193)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/plugin.xml 2008-12-02 02:33:11 UTC (rev
12194)
@@ -2,14 +2,33 @@
<?eclipse version="3.2"?>
<plugin>
+ <extension
+ point="org.eclipse.core.contenttype.contentTypes">
+ <content-type
+ base-type="org.eclipse.core.runtime.xml"
+ file-extensions="xml"
+ id="org.jboss.tools.flow.jpdl4"
+ name="jPDL 4 File"
+ priority="normal">
+ <describer
+
class="org.eclipse.core.runtime.content.XMLRootElementContentDescriber">
+ <parameter
+ name="element"
+ value="process">
+ </parameter>
+ </describer>
+ </content-type>
+ </extension>
<extension point="org.eclipse.ui.editors">
<editor
name="jPDL4 Editor"
- extensions="jpdl4"
icon="icons/process.gif"
contributorClass="org.jboss.tools.flow.common.editor.GenericActionBarContributor"
class="org.jboss.tools.flow.jpdl4.editor.JpdlEditor"
id="org.jboss.tools.flow.jpdl4.editor">
+ <contentTypeBinding
+ contentTypeId="org.jboss.tools.flow.jpdl4">
+ </contentTypeBinding>
</editor>
</extension>
<extension
@@ -82,5 +101,18 @@
<connection></connection>
</element>
</extension>
+ <extension
+ point="org.eclipse.ui.newWizards">
+ <category
+ id="org.jboss.tools.flow.jpdl4"
+ name="jBPM">
+ </category>
+ <wizard
+ class="org.jboss.tools.flow.jpdl4.wizard.NewJpdl4FileWizard"
+ icon="icons/process.gif"
+ id="org.jboss.tools.flow.jpdl4.file"
+ name="jPDL4 File">
+ </wizard>
+ </extension>
</plugin>
Modified:
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editor/JpdlEditor.java
===================================================================
---
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editor/JpdlEditor.java 2008-12-02
02:19:45 UTC (rev 12193)
+++
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editor/JpdlEditor.java 2008-12-02
02:33:11 UTC (rev 12194)
@@ -33,7 +33,13 @@
}
protected void createModel(InputStream is) {
- setModel(JpdlDeserializer.deserialize(is));
+ boolean empty = true;
+ try {
+ empty = is.available() == 0;
+ } catch (IOException e) {
+ // ignored
+ }
+ setModel(empty ? createModel() : JpdlDeserializer.deserialize(is));
}
}
Added:
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/wizard/NewJpdl4FileWizard.java
===================================================================
---
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/wizard/NewJpdl4FileWizard.java
(rev 0)
+++
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/wizard/NewJpdl4FileWizard.java 2008-12-02
02:33:11 UTC (rev 12194)
@@ -0,0 +1,37 @@
+package org.jboss.tools.flow.jpdl4.wizard;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.wizard.Wizard;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.IWorkbenchWizard;
+
+public class NewJpdl4FileWizard extends Wizard implements IWorkbenchWizard {
+
+ private IStructuredSelection selection;
+ private NewJpdl4FileWizardPage newFileWizardPage;
+
+ public NewJpdl4FileWizard() {
+ setWindowTitle("New jPDL4 File");
+ }
+
+ @Override
+ public void addPages() {
+ newFileWizardPage = new NewJpdl4FileWizardPage(selection);
+ addPage(newFileWizardPage);
+ }
+
+ @Override
+ public boolean performFinish() {
+ IFile file = newFileWizardPage.createNewFile();
+ if (file != null)
+ return true;
+ else
+ return false;
+ }
+
+ public void init(IWorkbench workbench, IStructuredSelection selection) {
+ this.selection = selection;
+ }
+
+}
Added:
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/wizard/NewJpdl4FileWizardPage.java
===================================================================
---
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/wizard/NewJpdl4FileWizardPage.java
(rev 0)
+++
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/wizard/NewJpdl4FileWizardPage.java 2008-12-02
02:33:11 UTC (rev 12194)
@@ -0,0 +1,22 @@
+package org.jboss.tools.flow.jpdl4.wizard;
+
+import java.io.ByteArrayInputStream;
+import java.io.InputStream;
+
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.ui.dialogs.WizardNewFileCreationPage;
+
+public class NewJpdl4FileWizardPage extends WizardNewFileCreationPage {
+
+ public NewJpdl4FileWizardPage(IStructuredSelection selection) {
+ super("NewJpdl4FileWizardPage", selection);
+ setTitle("Jpdl4 File");
+ setDescription("Creates a new jpdl4 File");
+ setFileExtension("jpdl.xml");
+ }
+
+ @Override
+ protected InputStream getInitialContents() {
+ return new
ByteArrayInputStream("<process>\n</process>".getBytes());
+ }
+}
Show replies by date