Author: koen.aers(a)jboss.com
Date: 2009-05-11 11:54:17 -0400 (Mon, 11 May 2009)
New Revision: 15171
Added:
tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.jpdl4.multipage/
tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.jpdl4.multipage/META-INF/MANIFEST.MF
tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.jpdl4.multipage/plugin.xml
tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.jpdl4.multipage/src/org/jboss/tools/flow/jpdl4/multipage/editors/MultiPageEditor.java
Removed:
tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.jpdl4.multipage/META-INF/MANIFEST.MF
tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.jpdl4.multipage/plugin.xml
tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.jpdl4.multipage/src/org/jboss/tools/flow/jpdl4/multipage/editors/MultiPageEditor.java
Log:
4.0.0.beta2 release
Copied: tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.jpdl4.multipage (from rev 14456,
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4.multipage)
Deleted:
tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.jpdl4.multipage/META-INF/MANIFEST.MF
===================================================================
---
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4.multipage/META-INF/MANIFEST.MF 2009-04-02
12:41:29 UTC (rev 14456)
+++
tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.jpdl4.multipage/META-INF/MANIFEST.MF 2009-05-11
15:54:17 UTC (rev 15171)
@@ -1,21 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %pluginName
-Bundle-SymbolicName: org.jboss.tools.flow.jpdl4.multipage;singleton:=true
-Bundle-Version: 1.0.0.beta1
-Bundle-Activator: org.jboss.tools.flow.jpdl4.multipage.MultiPageEditorPlugin
-Bundle-Vendor: %providerName
-Bundle-Localization: plugin
-Require-Bundle: org.eclipse.ui,
- org.eclipse.core.runtime,
- org.eclipse.jface.text,
- org.eclipse.core.resources,
- org.eclipse.ui.editors,
- org.eclipse.ui.ide,
- org.jboss.tools.flow.jpdl4;bundle-version="1.0.0",
- org.eclipse.wst.sse.ui;bundle-version="1.1.3",
- org.eclipse.ui.views.properties.tabbed;bundle-version="3.4.1",
- org.jboss.tools.flow.common;bundle-version="1.0.0",
- org.eclipse.gef;bundle-version="3.4.1"
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
-Bundle-ActivationPolicy: lazy
Copied:
tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.jpdl4.multipage/META-INF/MANIFEST.MF (from
rev 14991, trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4.multipage/META-INF/MANIFEST.MF)
===================================================================
--- tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.jpdl4.multipage/META-INF/MANIFEST.MF
(rev 0)
+++
tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.jpdl4.multipage/META-INF/MANIFEST.MF 2009-05-11
15:54:17 UTC (rev 15171)
@@ -0,0 +1,21 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %pluginName
+Bundle-SymbolicName: org.jboss.tools.flow.jpdl4.multipage;singleton:=true
+Bundle-Version: 1.0.0.beta2
+Bundle-Activator: org.jboss.tools.flow.jpdl4.multipage.MultiPageEditorPlugin
+Bundle-Vendor: %providerName
+Bundle-Localization: plugin
+Require-Bundle: org.eclipse.ui,
+ org.eclipse.core.runtime,
+ org.eclipse.jface.text,
+ org.eclipse.core.resources,
+ org.eclipse.ui.editors,
+ org.eclipse.ui.ide,
+ org.jboss.tools.flow.jpdl4;bundle-version="1.0.0",
+ org.eclipse.wst.sse.ui;bundle-version="1.1.3",
+ org.eclipse.ui.views.properties.tabbed;bundle-version="3.4.1",
+ org.jboss.tools.flow.common;bundle-version="1.0.0",
+ org.eclipse.gef;bundle-version="3.4.1"
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Bundle-ActivationPolicy: lazy
Deleted: tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.jpdl4.multipage/plugin.xml
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4.multipage/plugin.xml 2009-04-02 12:41:29
UTC (rev 14456)
+++ tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.jpdl4.multipage/plugin.xml 2009-05-11
15:54:17 UTC (rev 15171)
@@ -1,21 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.2"?>
-<plugin>
-
-
- <extension
- point="org.eclipse.ui.editors">
- <editor
-
class="org.jboss.tools.flow.jpdl4.multipage.editors.MultiPageEditor"
-
contributorClass="org.jboss.tools.flow.jpdl4.multipage.editors.MultiPageEditorContributor"
- extensions="xml"
- icon="icons/process.gif"
- id="org.jboss.tools.flow.jpdl4.multipage.editors.MultiPageEditor"
- name="jBPM jPDL4 Editor">
- <contentTypeBinding
- contentTypeId="org.jboss.tools.flow.jpdl4">
- </contentTypeBinding>
- </editor>
- </extension>
-
-</plugin>
Copied: tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.jpdl4.multipage/plugin.xml (from
rev 15168, trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4.multipage/plugin.xml)
===================================================================
--- tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.jpdl4.multipage/plugin.xml
(rev 0)
+++ tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.jpdl4.multipage/plugin.xml 2009-05-11
15:54:17 UTC (rev 15171)
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.2"?>
+<plugin>
+
+
+ <extension
+ point="org.eclipse.ui.editors">
+ <editor
+
class="org.jboss.tools.flow.jpdl4.multipage.editors.MultiPageEditor"
+
contributorClass="org.jboss.tools.flow.jpdl4.multipage.editors.MultiPageEditorContributor"
+ icon="icons/process.gif"
+ id="org.jboss.tools.flow.jpdl4.multipage.editors.MultiPageEditor"
+ name="jBPM jPDL4 Editor">
+ <contentTypeBinding
+ contentTypeId="org.jboss.tools.flow.jpdl4">
+ </contentTypeBinding>
+ </editor>
+ </extension>
+
+</plugin>
Deleted:
tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.jpdl4.multipage/src/org/jboss/tools/flow/jpdl4/multipage/editors/MultiPageEditor.java
===================================================================
---
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4.multipage/src/org/jboss/tools/flow/jpdl4/multipage/editors/MultiPageEditor.java 2009-04-02
12:41:29 UTC (rev 14456)
+++
tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.jpdl4.multipage/src/org/jboss/tools/flow/jpdl4/multipage/editors/MultiPageEditor.java 2009-05-11
15:54:17 UTC (rev 15171)
@@ -1,161 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at
http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-
-package org.jboss.tools.flow.jpdl4.multipage.editors;
-
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-
-import org.eclipse.core.resources.IResourceChangeEvent;
-import org.eclipse.core.resources.IResourceChangeListener;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.gef.GraphicalViewer;
-import org.eclipse.jface.dialogs.ErrorDialog;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IEditorSite;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.part.MultiPageEditorPart;
-import org.eclipse.wst.sse.ui.StructuredTextEditor;
-import org.jboss.tools.flow.common.wrapper.Wrapper;
-import org.jboss.tools.flow.jpdl4.editor.JpdlDeserializer;
-import org.jboss.tools.flow.jpdl4.multipage.message.MultiPageMessages;
-
-/**
- * @author Grid Qian
- */
-public class MultiPageEditor extends MultiPageEditorPart implements
- IResourceChangeListener{
-
- private InnerJpdlEditor jpdlEditor;
-
- private StructuredTextEditor xmlEditor;
-
- /**
- * Creates a multi-page editor.
- */
- public MultiPageEditor() {
- super();
- ResourcesPlugin.getWorkspace().addResourceChangeListener(this);
- }
-
- public void init(IEditorSite site, IEditorInput input)throws PartInitException{
- super.init(site, input);
- }
-
- void createJpdl4EditorPage() {
- try {
- jpdlEditor = new InnerJpdlEditor();
- int pageNum = addPage((IEditorPart) jpdlEditor, getEditorInput());
- super.setPageText(pageNum, MultiPageMessages.Jpdl_Page_Name);
- } catch (PartInitException e) {
- ErrorDialog.openError(getSite().getShell(),
- "Error creating Jpdl editor", null, e.getStatus());
- }
- }
-
- void createXmlEditorPage() {
- try {
- xmlEditor = new StructuredTextEditor();
- int pageNum = addPage((IEditorPart) xmlEditor, getEditorInput());
- super.setPageText(pageNum, MultiPageMessages.Xml_Page_Name);
- } catch (PartInitException e) {
- ErrorDialog.openError(getSite().getShell(),
- "Error creating xml editor", null, e.getStatus());
- }
- }
-
- protected void createPages() {
- createJpdl4EditorPage();
- createXmlEditorPage();
- super.setPartName(jpdlEditor.getPartName());
- }
-
- public void pageChange(int newPageIndex) {
- if(this.isDirty()){
- if(this.getActiveEditor() instanceof StructuredTextEditor){
- doPageChangeFromJpdlToXml();
- } else {
- doPageChangeFromXmlToJpdl();
- }
- }
- super.pageChange(newPageIndex);
- }
-
- private void doPageChangeFromXmlToJpdl() {
- String xmlText =
xmlEditor.getDocumentProvider().getDocument(xmlEditor.getEditorInput()).get();
- ByteArrayInputStream in = new ByteArrayInputStream(xmlText.getBytes());
- Wrapper model = new JpdlDeserializer().deserialize(in);
- if(model != null && model.getElement() != null) {
- jpdlEditor.setModel(model);
- ((GraphicalViewer) jpdlEditor.getAdapter(GraphicalViewer.class)).setContents(model);
- } else {
- System.out.println("Ha!");
- }
-
- try {
- in.close();
- } catch (IOException e) {
- e.printStackTrace();
- }
-
- }
-
- private void doPageChangeFromJpdlToXml() {
- ByteArrayOutputStream out = new ByteArrayOutputStream();
- try {
- jpdlEditor.writeModel(out);
- xmlEditor.getDocumentProvider().getDocument(xmlEditor.getEditorInput()).set(out.toString());
- out.close();
- } catch (IOException e) {
- e.printStackTrace();
- }
- }
-
- /*
- * return the active editor of the multipage editor
- */
- public IEditorPart getActiveInnerEditor(){
- return getActiveEditor();
- }
-
- @Override
- public void doSave(IProgressMonitor monitor) {
- if(this.getActiveEditor() instanceof StructuredTextEditor){
- doPageChangeFromXmlToJpdl();
- }
- jpdlEditor.doSave(monitor);
- xmlEditor.doSave(monitor);
- }
-
- @Override
- public void doSaveAs() {
- if(this.getActiveEditor() instanceof StructuredTextEditor){
- doPageChangeFromXmlToJpdl();
- }
- jpdlEditor.doSaveAs();
- xmlEditor.doSave(null);
-
- }
-
- @Override
- public boolean isSaveAsAllowed() {
- return jpdlEditor.isSaveAsAllowed();
- }
-
- public void resourceChanged(IResourceChangeEvent event) {
- // TODO Auto-generated method stub
-
- }
-
-}
Copied:
tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.jpdl4.multipage/src/org/jboss/tools/flow/jpdl4/multipage/editors/MultiPageEditor.java
(from rev 14991,
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4.multipage/src/org/jboss/tools/flow/jpdl4/multipage/editors/MultiPageEditor.java)
===================================================================
---
tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.jpdl4.multipage/src/org/jboss/tools/flow/jpdl4/multipage/editors/MultiPageEditor.java
(rev 0)
+++
tags/jbpm-jpdl-4.0.0.beta2/org.jboss.tools.flow.jpdl4.multipage/src/org/jboss/tools/flow/jpdl4/multipage/editors/MultiPageEditor.java 2009-05-11
15:54:17 UTC (rev 15171)
@@ -0,0 +1,158 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at
http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+
+package org.jboss.tools.flow.jpdl4.multipage.editors;
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+
+import org.eclipse.core.resources.IResourceChangeEvent;
+import org.eclipse.core.resources.IResourceChangeListener;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.gef.GraphicalViewer;
+import org.eclipse.jface.dialogs.ErrorDialog;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IEditorSite;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.part.MultiPageEditorPart;
+import org.eclipse.wst.sse.ui.StructuredTextEditor;
+import org.jboss.tools.flow.common.wrapper.Wrapper;
+import org.jboss.tools.flow.jpdl4.editor.JpdlDeserializer;
+import org.jboss.tools.flow.jpdl4.multipage.message.MultiPageMessages;
+
+/**
+ * @author Grid Qian
+ */
+public class MultiPageEditor extends MultiPageEditorPart implements
+ IResourceChangeListener{
+
+ private InnerJpdlEditor jpdlEditor;
+
+ private StructuredTextEditor xmlEditor;
+
+ /**
+ * Creates a multi-page editor.
+ */
+ public MultiPageEditor() {
+ super();
+ ResourcesPlugin.getWorkspace().addResourceChangeListener(this);
+ }
+
+ public void init(IEditorSite site, IEditorInput input)throws PartInitException{
+ super.init(site, input);
+ }
+
+ void createJpdl4EditorPage() {
+ try {
+ jpdlEditor = new InnerJpdlEditor();
+ int pageNum = addPage((IEditorPart) jpdlEditor, getEditorInput());
+ super.setPageText(pageNum, MultiPageMessages.Jpdl_Page_Name);
+ } catch (PartInitException e) {
+ ErrorDialog.openError(getSite().getShell(),
+ "Error creating Jpdl editor", null, e.getStatus());
+ }
+ }
+
+ void createXmlEditorPage() {
+ try {
+ xmlEditor = new StructuredTextEditor();
+ int pageNum = addPage((IEditorPart) xmlEditor, getEditorInput());
+ super.setPageText(pageNum, MultiPageMessages.Xml_Page_Name);
+ } catch (PartInitException e) {
+ ErrorDialog.openError(getSite().getShell(),
+ "Error creating xml editor", null, e.getStatus());
+ }
+ }
+
+ protected void createPages() {
+ createJpdl4EditorPage();
+ createXmlEditorPage();
+ super.setPartName(jpdlEditor.getPartName());
+ }
+
+ public void pageChange(int newPageIndex) {
+ if(this.isDirty()){
+ if(this.getActiveEditor() instanceof StructuredTextEditor){
+ doPageChangeFromJpdlToXml();
+ } else {
+ doPageChangeFromXmlToJpdl();
+ }
+ }
+ super.pageChange(newPageIndex);
+ }
+
+ private void doPageChangeFromXmlToJpdl() {
+ String xmlText =
xmlEditor.getDocumentProvider().getDocument(xmlEditor.getEditorInput()).get();
+ ByteArrayInputStream in = new ByteArrayInputStream(xmlText.getBytes());
+ Wrapper model = new JpdlDeserializer().deserialize(in);
+ if(model != null && model.getElement() != null) {
+ jpdlEditor.setModel(model);
+ ((GraphicalViewer) jpdlEditor.getAdapter(GraphicalViewer.class)).setContents(model);
+ }
+ try {
+ in.close();
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+
+ }
+
+ private void doPageChangeFromJpdlToXml() {
+ ByteArrayOutputStream out = new ByteArrayOutputStream();
+ try {
+ jpdlEditor.writeModel(out);
+ xmlEditor.getDocumentProvider().getDocument(xmlEditor.getEditorInput()).set(out.toString());
+ out.close();
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
+
+ /*
+ * return the active editor of the multipage editor
+ */
+ public IEditorPart getActiveInnerEditor(){
+ return getActiveEditor();
+ }
+
+ @Override
+ public void doSave(IProgressMonitor monitor) {
+ if(this.getActiveEditor() instanceof StructuredTextEditor){
+ doPageChangeFromXmlToJpdl();
+ }
+ jpdlEditor.doSave(monitor);
+ xmlEditor.doSave(monitor);
+ }
+
+ @Override
+ public void doSaveAs() {
+ if(this.getActiveEditor() instanceof StructuredTextEditor){
+ doPageChangeFromXmlToJpdl();
+ }
+ jpdlEditor.doSaveAs();
+ xmlEditor.doSave(null);
+
+ }
+
+ @Override
+ public boolean isSaveAsAllowed() {
+ return jpdlEditor.isSaveAsAllowed();
+ }
+
+ public void resourceChanged(IResourceChangeEvent event) {
+ // TODO Auto-generated method stub
+
+ }
+
+}