Skip to content

Commit

Permalink
488167: ISharedImages in the e4 example
Browse files Browse the repository at this point in the history
Change-Id: I29294c681d87204f82762c5f88864a3dcb7bf78c
Task-Url: https://bugs.eclipse.org/bugs/show_bug.cgi?id=488167
  • Loading branch information
LorenzoBettini committed Feb 21, 2016
1 parent 5a8b988 commit ce10ada
Showing 1 changed file with 17 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,13 @@
import org.eclipse.emf.edit.ui.action.ControlAction;
import org.eclipse.emf.parsley.edit.domain.EditingDomainPresetStrategy;
import org.eclipse.jface.action.IMenuManager;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.swt.graphics.Image;
import org.eclipse.ui.IActionBars;
import org.eclipse.ui.ISharedImages;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.actions.ActionFactory;
import org.eclipse.ui.internal.WorkbenchImages;
import org.eclipse.ui.part.IPage;
import org.eclipse.ui.views.properties.IPropertySheetPage;

Expand All @@ -32,6 +34,7 @@
*
* @author Lorenzo Bettini - initial API and implementation
*/
@SuppressWarnings("restriction")
public class EditingActionManager {

@Inject
Expand Down Expand Up @@ -92,7 +95,19 @@ public void createActions() {
}

protected ISharedImages getSharedImages() {
return PlatformUI.getWorkbench().getSharedImages();
// we can't use PlatformUI.getWorkbench().getSharedImages();
// in an e4 application,
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=404727
return new ISharedImages() {
@Override
public Image getImage(String symbolicName) {
return getImageDescriptor(symbolicName).createImage();
}
@Override
public ImageDescriptor getImageDescriptor(String symbolicName) {
return WorkbenchImages.getImageDescriptor(symbolicName);
}
};
}

/**
Expand Down

0 comments on commit ce10ada

Please sign in to comment.