Author: schor Date: Wed Aug 31 22:03:07 2016 New Revision: 1758686 URL: http://svn.apache.org/viewvc?rev=1758686&view=rev Log: [UIMA-5095]
Modified: uima/uima-as/trunk/uimaj-ep-deployeditor/src/main/java/org/apache/uima/dde/internal/page/AbstractHeaderPage.java uima/uima-as/trunk/uimaj-ep-deployeditor/src/main/java/org/apache/uima/dde/internal/page/MasterDetails.java Modified: uima/uima-as/trunk/uimaj-ep-deployeditor/src/main/java/org/apache/uima/dde/internal/page/AbstractHeaderPage.java URL: http://svn.apache.org/viewvc/uima/uima-as/trunk/uimaj-ep-deployeditor/src/main/java/org/apache/uima/dde/internal/page/AbstractHeaderPage.java?rev=1758686&r1=1758685&r2=1758686&view=diff ============================================================================== --- uima/uima-as/trunk/uimaj-ep-deployeditor/src/main/java/org/apache/uima/dde/internal/page/AbstractHeaderPage.java (original) +++ uima/uima-as/trunk/uimaj-ep-deployeditor/src/main/java/org/apache/uima/dde/internal/page/AbstractHeaderPage.java Wed Aug 31 22:03:07 2016 @@ -19,9 +19,12 @@ package org.apache.uima.dde.internal.page; +import java.net.URL; + import org.apache.uima.taeconfigurator.TAEConfiguratorPlugin; import org.apache.uima.tools.images.internal.ImageLoader; import org.eclipse.jface.action.Action; +import org.eclipse.jface.resource.ImageDescriptor; import org.eclipse.jface.viewers.TreeViewer; import org.eclipse.swt.SWT; import org.eclipse.swt.custom.SashForm; @@ -36,6 +39,7 @@ import org.eclipse.ui.forms.widgets.Form import org.eclipse.ui.forms.widgets.ImageHyperlink; import org.eclipse.ui.forms.widgets.ScrolledForm; import org.eclipse.ui.forms.widgets.Section; +import org.osgi.framework.BundleReference; /** @@ -121,9 +125,8 @@ public abstract class AbstractHeaderPage }; haction.setChecked(selectHorizontal); haction.setToolTipText("Horizontal Orientation"); - haction.setImageDescriptor(TAEConfiguratorPlugin.getImageDescriptor(TAEConfiguratorPlugin.IMAGE_TH_HORIZONTAL)); - haction.setDisabledImageDescriptor(TAEConfiguratorPlugin - .getImageDescriptor(TAEConfiguratorPlugin.IMAGE_TH_HORIZONTAL)); + haction.setImageDescriptor(getImageDescriptor(TAEConfiguratorPlugin.IMAGE_TH_HORIZONTAL)); + haction.setDisabledImageDescriptor(getImageDescriptor(TAEConfiguratorPlugin.IMAGE_TH_HORIZONTAL)); Action vaction = new Action("ver", Action.AS_RADIO_BUTTON) { //$NON-NLS-1$ public void run() { @@ -133,12 +136,19 @@ public abstract class AbstractHeaderPage }; vaction.setChecked(!selectHorizontal); vaction.setToolTipText("Vertical Orientation"); - vaction.setImageDescriptor(TAEConfiguratorPlugin.getImageDescriptor(TAEConfiguratorPlugin.IMAGE_TH_VERTICAL)); - vaction.setDisabledImageDescriptor(TAEConfiguratorPlugin - .getImageDescriptor(TAEConfiguratorPlugin.IMAGE_TH_VERTICAL)); + vaction.setImageDescriptor(getImageDescriptor(TAEConfiguratorPlugin.IMAGE_TH_VERTICAL)); + vaction.setDisabledImageDescriptor(getImageDescriptor(TAEConfiguratorPlugin.IMAGE_TH_VERTICAL)); form.getToolBarManager().add(haction); form.getToolBarManager().add(vaction); form.updateToolBar(); } + public static ImageDescriptor getImageDescriptor(String imageFile) { + ClassLoader cl = TAEConfiguratorPlugin.class.getClassLoader(); + if (cl instanceof BundleReference) { + URL url = ((BundleReference) cl).getBundle().getEntry("icons/" + imageFile); + return ImageDescriptor.createFromURL(url); + } + return null; + } } // AbstractHeaderPage Modified: uima/uima-as/trunk/uimaj-ep-deployeditor/src/main/java/org/apache/uima/dde/internal/page/MasterDetails.java URL: http://svn.apache.org/viewvc/uima/uima-as/trunk/uimaj-ep-deployeditor/src/main/java/org/apache/uima/dde/internal/page/MasterDetails.java?rev=1758686&r1=1758685&r2=1758686&view=diff ============================================================================== --- uima/uima-as/trunk/uimaj-ep-deployeditor/src/main/java/org/apache/uima/dde/internal/page/MasterDetails.java (original) +++ uima/uima-as/trunk/uimaj-ep-deployeditor/src/main/java/org/apache/uima/dde/internal/page/MasterDetails.java Wed Aug 31 22:03:07 2016 @@ -23,8 +23,8 @@ import org.apache.uima.aae.deployment.AE import org.apache.uima.dde.internal.DeploymentDescriptorEditor; import org.apache.uima.dde.internal.Messages; import org.apache.uima.dde.internal.details.DetailsPageProvider; -import org.apache.uima.dde.internal.hover.HoverManager; import org.apache.uima.dde.internal.hover.DDEInformationControl; +import org.apache.uima.dde.internal.hover.HoverManager; import org.apache.uima.dde.internal.provider.DDTreeContentProvider; import org.apache.uima.dde.internal.provider.DDTreeLabelProvider; import org.apache.uima.taeconfigurator.TAEConfiguratorPlugin; @@ -39,8 +39,6 @@ import org.eclipse.jface.viewers.Selecti import org.eclipse.jface.viewers.StructuredSelection; import org.eclipse.jface.viewers.TreeViewer; import org.eclipse.swt.SWT; -import org.eclipse.swt.events.ControlAdapter; -import org.eclipse.swt.events.ControlEvent; import org.eclipse.swt.graphics.Color; import org.eclipse.swt.layout.GridData; import org.eclipse.swt.layout.GridLayout; @@ -152,8 +150,8 @@ public class MasterDetails extends Maste }; haction.setChecked(true); haction.setToolTipText("Horizontal Orientation"); - haction.setImageDescriptor(TAEConfiguratorPlugin.getImageDescriptor(TAEConfiguratorPlugin.IMAGE_TH_HORIZONTAL)); - haction.setDisabledImageDescriptor(TAEConfiguratorPlugin + haction.setImageDescriptor(AbstractHeaderPage.getImageDescriptor(TAEConfiguratorPlugin.IMAGE_TH_HORIZONTAL)); + haction.setDisabledImageDescriptor(AbstractHeaderPage .getImageDescriptor(TAEConfiguratorPlugin.IMAGE_TH_HORIZONTAL)); Action vaction = new Action("ver", Action.AS_RADIO_BUTTON) { //$NON-NLS-1$ @@ -164,8 +162,8 @@ public class MasterDetails extends Maste }; vaction.setChecked(false); vaction.setToolTipText("Vertical Orientation"); - vaction.setImageDescriptor(TAEConfiguratorPlugin.getImageDescriptor(TAEConfiguratorPlugin.IMAGE_TH_VERTICAL)); - vaction.setDisabledImageDescriptor(TAEConfiguratorPlugin + vaction.setImageDescriptor(AbstractHeaderPage.getImageDescriptor(TAEConfiguratorPlugin.IMAGE_TH_VERTICAL)); + vaction.setDisabledImageDescriptor(AbstractHeaderPage .getImageDescriptor(TAEConfiguratorPlugin.IMAGE_TH_VERTICAL)); form.getToolBarManager().add(haction); form.getToolBarManager().add(vaction);