use of org.eclipse.ui.ISharedImages in project translationstudio8 by heartsome.
the class EditActionGroup method makeActions.
protected void makeActions() {
clipboard = new Clipboard(shell.getDisplay());
pasteAction = new PasteAction(shell, clipboard);
pasteAction.setText(WorkbenchNavigatorMessages.actions_EditActionGroup_pasteAction);
ISharedImages images = PlatformUI.getWorkbench().getSharedImages();
pasteAction.setDisabledImageDescriptor(images.getImageDescriptor(ISharedImages.IMG_TOOL_PASTE_DISABLED));
pasteAction.setImageDescriptor(images.getImageDescriptor(ISharedImages.IMG_TOOL_PASTE));
pasteAction.setActionDefinitionId(IWorkbenchCommandConstants.EDIT_PASTE);
copyAction = new CopyAction(shell, clipboard, pasteAction);
copyAction.setText(WorkbenchNavigatorMessages.actions_EditActionGroup_copyAction);
copyAction.setDisabledImageDescriptor(images.getImageDescriptor(ISharedImages.IMG_TOOL_COPY_DISABLED));
copyAction.setImageDescriptor(images.getImageDescriptor(ISharedImages.IMG_TOOL_COPY));
copyAction.setActionDefinitionId(IWorkbenchCommandConstants.EDIT_COPY);
IShellProvider sp = new IShellProvider() {
public Shell getShell() {
return shell;
}
};
deleteAction = new DeleteResourceAndCloseEditorAction(sp);
deleteAction.setText(WorkbenchNavigatorMessages.actions_EditActionGroup_deleteAction);
deleteAction.setDisabledImageDescriptor(images.getImageDescriptor(ISharedImages.IMG_TOOL_DELETE_DISABLED));
deleteAction.setImageDescriptor(images.getImageDescriptor(ISharedImages.IMG_TOOL_DELETE));
deleteAction.setActionDefinitionId(IWorkbenchCommandConstants.EDIT_DELETE);
}
use of org.eclipse.ui.ISharedImages in project translationstudio8 by heartsome.
the class WorkingSetRootModeActionGroup method createActions.
private IAction[] createActions() {
ISharedImages sharedImages = PlatformUI.getWorkbench().getSharedImages();
projectsAction = new TopLevelContentAction(false);
projectsAction.setText(WorkbenchNavigatorMessages.actions_WorkingSetRootModeActionGroup_Project_);
projectsAction.setImageDescriptor(sharedImages.getImageDescriptor(IDE.SharedImages.IMG_OBJ_PROJECT));
workingSetsAction = new TopLevelContentAction(true);
workingSetsAction.setText(WorkbenchNavigatorMessages.actions_WorkingSetRootModeActionGroup_Working_Set_);
workingSetsAction.setImageDescriptor(WorkbenchNavigatorPlugin.getDefault().getImageRegistry().getDescriptor(//$NON-NLS-1$
"full/obj16/workingsets.gif"));
return new IAction[] { projectsAction, workingSetsAction };
}
use of org.eclipse.ui.ISharedImages in project tdi-studio-se by Talend.
the class ReconcilerViewer method addMenu.
/**
* DOC nrousseau Comment method "addMenu".
*/
private void addMenu() {
ISharedImages sharedImages = PlatformUI.getWorkbench().getSharedImages();
Image image = ImageProvider.getImage(sharedImages.getImageDescriptor(ISharedImages.IMG_TOOL_UNDO));
Menu popupMenu = new Menu(this.getTextWidget());
MenuItem undoItem = new MenuItem(popupMenu, SWT.PUSH);
//$NON-NLS-1$
undoItem.setText("Undo");
undoItem.setImage(image);
undoItem.addListener(SWT.Selection, new Listener() {
@Override
public void handleEvent(Event event) {
doOperation(ITextOperationTarget.UNDO);
event.doit = false;
}
});
image = ImageProvider.getImage(sharedImages.getImageDescriptor(ISharedImages.IMG_TOOL_REDO));
MenuItem redoItem = new MenuItem(popupMenu, SWT.PUSH);
//$NON-NLS-1$
redoItem.setText("Redo");
redoItem.setData(this);
redoItem.setImage(image);
redoItem.addListener(SWT.Selection, new Listener() {
@Override
public void handleEvent(Event event) {
doOperation(ITextOperationTarget.REDO);
event.doit = false;
}
});
// add separator
new MenuItem(popupMenu, SWT.SEPARATOR);
image = ImageProvider.getImage(sharedImages.getImageDescriptor(ISharedImages.IMG_TOOL_COPY));
MenuItem copyItem = new MenuItem(popupMenu, SWT.PUSH);
//$NON-NLS-1$
copyItem.setText("Copy");
copyItem.setImage(image);
copyItem.addListener(SWT.Selection, new Listener() {
@Override
public void handleEvent(Event event) {
getTextWidget().copy();
}
});
image = ImageProvider.getImage(sharedImages.getImageDescriptor(ISharedImages.IMG_TOOL_PASTE));
MenuItem pasteItem = new MenuItem(popupMenu, SWT.PUSH);
//$NON-NLS-1$
pasteItem.setText("Paste");
pasteItem.setData(this);
pasteItem.setImage(image);
pasteItem.addListener(SWT.Selection, new Listener() {
@Override
public void handleEvent(Event event) {
getTextWidget().paste();
}
});
MenuItem selectAllItem = new MenuItem(popupMenu, SWT.PUSH);
//$NON-NLS-1$
selectAllItem.setText("Select All");
selectAllItem.addListener(SWT.Selection, new Listener() {
@Override
public void handleEvent(Event event) {
getTextWidget().selectAll();
}
});
getTextWidget().setMenu(popupMenu);
Listener selectAllListener = new Listener() {
@Override
public void handleEvent(Event event) {
if (event.character == '') {
// CTRL + A
getTextWidget().selectAll();
}
}
};
getTextWidget().addListener(SWT.KeyDown, selectAllListener);
}
Aggregations