[jbosstools-commits] JBoss Tools SVN: r42585 - in trunk/vpe/plugins/org.jboss.tools.vpe: resources/org/jboss/tools/vpe/handlers and 1 other directories.

jbosstools-commits at lists.jboss.org jbosstools-commits at lists.jboss.org
Mon Jul 16 07:53:23 EDT 2012


Author: dmaliarevich
Date: 2012-07-16 07:53:22 -0400 (Mon, 16 Jul 2012)
New Revision: 42585

Added:
   trunk/vpe/plugins/org.jboss.tools.vpe/icons/source_left.gif
   trunk/vpe/plugins/org.jboss.tools.vpe/icons/source_top.gif
   trunk/vpe/plugins/org.jboss.tools.vpe/icons/visual_left.gif
   trunk/vpe/plugins/org.jboss.tools.vpe/icons/visual_top.gif
Removed:
   trunk/vpe/plugins/org.jboss.tools.vpe/resources/org/jboss/tools/vpe/handlers/icons/
Modified:
   trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/handlers/RotateEditorsHandler.java
Log:
https://issues.jboss.org/browse/JBIDE-12329 - icon was updated.

Added: trunk/vpe/plugins/org.jboss.tools.vpe/icons/source_left.gif
===================================================================
(Binary files differ)


Property changes on: trunk/vpe/plugins/org.jboss.tools.vpe/icons/source_left.gif
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Added: trunk/vpe/plugins/org.jboss.tools.vpe/icons/source_top.gif
===================================================================
(Binary files differ)


Property changes on: trunk/vpe/plugins/org.jboss.tools.vpe/icons/source_top.gif
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Added: trunk/vpe/plugins/org.jboss.tools.vpe/icons/visual_left.gif
===================================================================
(Binary files differ)


Property changes on: trunk/vpe/plugins/org.jboss.tools.vpe/icons/visual_left.gif
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Added: trunk/vpe/plugins/org.jboss.tools.vpe/icons/visual_top.gif
===================================================================
(Binary files differ)


Property changes on: trunk/vpe/plugins/org.jboss.tools.vpe/icons/visual_top.gif
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/handlers/RotateEditorsHandler.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/handlers/RotateEditorsHandler.java	2012-07-15 02:07:03 UTC (rev 42584)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/handlers/RotateEditorsHandler.java	2012-07-16 11:53:22 UTC (rev 42585)
@@ -29,6 +29,7 @@
 import org.jboss.tools.jst.jsp.JspEditorPlugin;
 import org.jboss.tools.jst.jsp.jspeditor.JSPMultiPageEditor;
 import org.jboss.tools.jst.jsp.preferences.IVpePreferencesPage;
+import org.jboss.tools.vpe.VpePlugin;
 import org.jboss.tools.vpe.editor.VpeController;
 import org.jboss.tools.vpe.messages.VpeUIMessages;
 
@@ -85,13 +86,10 @@
 	 * from the application context.
 	 */
 	public Object execute(ExecutionEvent event) throws ExecutionException {
-
-		IPreferenceStore preferences = JspEditorPlugin.getDefault()
-				.getPreferenceStore();
-		String orientation = preferences
-				.getString(IVpePreferencesPage.VISUAL_SOURCE_EDITORS_SPLITTING);
+		IPreferenceStore preferences = JspEditorPlugin.getDefault().getPreferenceStore();
+		String orientation = preferences.getString
+				(IVpePreferencesPage.VISUAL_SOURCE_EDITORS_SPLITTING);
 		int currentOrientationIndex = layoutValues.indexOf(orientation);
-
 		/*
 		 * Rotate editors orientation clockwise.
 		 */
@@ -105,8 +103,8 @@
 				IVpePreferencesPage.VISUAL_SOURCE_EDITORS_SPLITTING,
 				newOrientation);
 		IEditorReference[] openedEditors = PlatformUI.getWorkbench()
-		.getActiveWorkbenchWindow().getActivePage()
-		.getEditorReferences();
+				.getActiveWorkbenchWindow().getActivePage()
+				.getEditorReferences();
 		for (IEditorReference openedEditor : openedEditors) {
 			IEditorPart editor = openedEditor.getEditor(true);
 			rotateEditor(editor, newOrientation);
@@ -128,16 +126,17 @@
 					IVpePreferencesPage.VISUAL_SOURCE_EDITORS_SPLITTING,
 					orientation);
 		}
-
 		/*
-		 * Update icon and tooltip
+		 * https://issues.jboss.org/browse/JBIDE-12329
+		 * 1) MenuHelper.getIconURI(..) used from SlaveCommandService
+		 * to set the icon to the element cannot always find the path 
+		 * to the icon used in ImageDescriptor(esp. from FileImageDescriptor).
+		 * Thus ImageDescriptor should be of type URLImageDescriptor
+		 * 2) Text is not required, icon is enough. 
 		 */
-		element.setIcon(ImageDescriptor.createFromFile(this.getClass(),
-				layoutIcons.get(orientation)));
-		String orientationName = layoutNamesAndTooltips.get(orientation);
-		element.setTooltip(orientationName);
-		element.setText(orientationName);
-
+		element.setIcon(VpePlugin.imageDescriptorFromPlugin(
+				VpePlugin.PLUGIN_ID, layoutIcons.get(orientation)));
+		element.setTooltip(layoutNamesAndTooltips.get(orientation));
 	}
 
 	private void rotateEditor(IEditorPart editor, String orientation) {
@@ -154,6 +153,5 @@
 		if (vpeController != null)
 			vpeController.getPageContext().getEditPart()
 					.fillContainer(true, orientation);
-
 	}
 }



More information about the jbosstools-commits mailing list