Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[bpel-dev] patch10=editor-starts-with-the-tab-active-when-closing

Hi again Simon,

 

Please find attached the 10th patch. It is independent from the 9th patch.

Now, if you closed the last bpel file with the source tab active then all the next bpel files will be also opened with the source tab active. Same for the design tab.

 

This behavior is similar to WSDL editor behavior.

 

Thanks,

            Vitaly.

 

 

### Eclipse Workspace Patch 1.0
#P org.eclipse.bpel.ui
Index: src/org/eclipse/bpel/ui/IBPELUIConstants.java
===================================================================
RCS file: /cvsroot/technology/org.eclipse.bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/IBPELUIConstants.java,v
retrieving revision 1.16.2.1
diff -u -r1.16.2.1 IBPELUIConstants.java
--- src/org/eclipse/bpel/ui/IBPELUIConstants.java	8 Jun 2007 08:58:50 -0000	1.16.2.1
+++ src/org/eclipse/bpel/ui/IBPELUIConstants.java	3 Aug 2007 14:09:54 -0000
@@ -39,6 +39,9 @@
 
 	// ID of editor
 	public final String BPEL_EDITOR_ID = "org.eclipse.bpel.ui.bpeleditor"; //$NON-NLS-1$
+	public final String DEFAULT_EDITOR_PAGE = "org.eclipse.bpel.ui.bpeleditor.defaultpage"; //$NON-NLS-1$
+	public static final String DESIGN_PAGE = "org.eclipse.bpel.ui.bpeleditor.designpage"; //$NON-NLS-1$
+	public static final String SOURCE_PAGE = "org.eclipse.bpel.ui.bpeleditor.sourcepage"; //$NON-NLS-1$
 
 	// Namespace for model extension set
 	public final String MODEL_EXTENSIONS_NAMESPACE = "http://org.eclipse.bpel.ui/";; //$NON-NLS-1$
Index: src/org/eclipse/bpel/ui/BPELUIPlugin.java
===================================================================
RCS file: /cvsroot/technology/org.eclipse.bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/BPELUIPlugin.java,v
retrieving revision 1.11
diff -u -r1.11 BPELUIPlugin.java
--- src/org/eclipse/bpel/ui/BPELUIPlugin.java	21 Dec 2006 00:18:34 -0000	1.11
+++ src/org/eclipse/bpel/ui/BPELUIPlugin.java	3 Aug 2007 14:09:53 -0000
@@ -73,6 +73,19 @@
 		return getPlugin();
 	}
 
+	public String getDefaultPage() {
+		return getPreferenceStore().getString(IBPELUIConstants.DEFAULT_EDITOR_PAGE);
+	}
+
+	/**
+	 * setDefaultPage
+	 * Set the default page to open when the editor starts. 
+	 * @param page
+	 */
+	public void setDefaultPage(String page) {
+		getPreferenceStore().setValue(IBPELUIConstants.DEFAULT_EDITOR_PAGE, page);
+	}
+
 	/**
 	 * Creates an image descriptor and places it in the image registry.
 	 */
Index: src/org/eclipse/bpel/ui/BPELMultipageEditorPart.java
===================================================================
RCS file: /cvsroot/technology/org.eclipse.bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/Attic/BPELMultipageEditorPart.java,v
retrieving revision 1.1.2.7
diff -u -r1.1.2.7 BPELMultipageEditorPart.java
--- src/org/eclipse/bpel/ui/BPELMultipageEditorPart.java	31 Jul 2007 09:15:41 -0000	1.1.2.7
+++ src/org/eclipse/bpel/ui/BPELMultipageEditorPart.java	3 Aug 2007 14:09:53 -0000
@@ -107,6 +107,7 @@
 import org.eclipse.wst.sse.ui.StructuredTextEditor;
 import org.eclipse.wst.wsdl.Definition;
 import org.eclipse.wst.wsdl.XSDSchemaExtensibilityElement;
+import org.eclipse.wst.wsdl.ui.internal.WSDLEditorPlugin;
 import org.eclipse.wst.wsdl.ui.internal.adapters.basic.W11Description;
 import org.eclipse.wst.wsdl.ui.internal.util.WSDLAdapterFactoryHelper;
 import org.eclipse.wst.wsdl.ui.internal.util.WSDLEditorUtil;
@@ -309,6 +310,8 @@
 	
 	private StructuredTextEditor fTextEditor = null;
 	private BPELEditor fDesignViewer = null;
+	private int currentPage = -1;
+
 	
 	protected TextEditorSelectionListener textEditorSelectionListener;
 	protected DesignViewerSelectionListener designViewerSelectionListener;
@@ -415,6 +418,12 @@
 			throw new RuntimeException(e);
 		} 
 		
+		if (BPELUIPlugin.getPlugin().getDefaultPage().equals(IBPELUIConstants.SOURCE_PAGE)) {
+			setActivePage(SOURCE_PAGE_INDEX);
+		} else {
+			setActivePage(DESIGN_PAGE_INDEX);
+		}
+		
 		//updateTitle();
 	}
 
@@ -423,6 +432,12 @@
 		/*if (outlinePage != null && outlinePage.getViewer() != null) {
 			outlinePage.getViewer().setContents(null);
 		}*/
+		if (currentPage == SOURCE_PAGE_INDEX) {
+			BPELUIPlugin.getPlugin().setDefaultPage(IBPELUIConstants.SOURCE_PAGE);
+		} else {
+			BPELUIPlugin.getPlugin().setDefaultPage(IBPELUIConstants.DESIGN_PAGE);
+		}
+
 		outlinePage = null;
  		process = null;
  		
@@ -591,6 +606,15 @@
 	public CommandStack getCommandStack() {
 		return getEditDomain().getCommandStack();
 	}
+
+	protected int getDefaultPageTypeIndex() {
+		int pageIndex = DESIGN_PAGE_INDEX;
+		if (BPELUIPlugin.getPlugin().getDefaultPage().equals(IBPELUIConstants.SOURCE_PAGE)) {
+			pageIndex = SOURCE_PAGE_INDEX;
+		}
+		return pageIndex;
+	}
+
 	
 	/**
 	 * Returns the design viewer
@@ -973,6 +997,11 @@
 		fDesignViewer.getTrayViewer().setContents(getProcess());
 	}
 	
+	protected void pageChange(int newPageIndex) {
+		currentPage = newPageIndex;
+		super.pageChange(newPageIndex);
+	}
+
 
 	/**
 	 * Sets the EditDomain for this EditorPart.

Back to the top