use of org.eclipse.ui.handlers.IHandlerService in project tdq-studio-se by Talend.
the class PatternTestView method activateContext.
/**
* Activate a context that this view uses. It will be tied to this view activation events and will be removed when
* the view is disposed.
*/
private void activateContext() {
IContextService contextService = (IContextService) getSite().getService(IContextService.class);
contextService.activateContext(VIEW_CONTEXT_ID);
TestRegularAction testRegularAction = new TestRegularAction();
IHandlerService service = (IHandlerService) getViewSite().getService(IHandlerService.class);
service.activateHandler(testRegularAction.getActionDefinitionId(), new ActionHandler(testRegularAction));
}
use of org.eclipse.ui.handlers.IHandlerService in project polymap4-core by Polymap4.
the class CommonNavigatorActionGroup method makeActions.
/**
*/
private void makeActions() {
FrameList frameList = commonViewer.getFrameList();
backAction = new BackAction(frameList);
forwardAction = new ForwardAction(frameList);
upAction = new UpAction(frameList);
frameList.addPropertyChangeListener(new IPropertyChangeListener() {
public void propertyChange(PropertyChangeEvent event) {
if (event.getProperty().equals(FrameList.P_RESET)) {
upAction.setEnabled(false);
backAction.setEnabled(false);
forwardAction.setEnabled(false);
}
commonNavigator.updateTitle();
IActionBars actionBars = commonNavigator.getViewSite().getActionBars();
updateToolBar(actionBars.getToolBarManager());
}
});
IHandlerService service = (IHandlerService) commonNavigator.getSite().getService(IHandlerService.class);
INavigatorViewerDescriptor viewerDescriptor = commonViewer.getNavigatorContentService().getViewerDescriptor();
boolean hideLinkWithEditorAction = viewerDescriptor.getBooleanConfigProperty(INavigatorViewerDescriptor.PROP_HIDE_LINK_WITH_EDITOR_ACTION);
if (!hideLinkWithEditorAction) {
toggleLinkingAction = new LinkEditorAction(commonNavigator, commonViewer, linkHelperService);
// $NON-NLS-1$
ImageDescriptor syncIcon = getImageDescriptor("elcl16/synced.gif");
toggleLinkingAction.setImageDescriptor(syncIcon);
toggleLinkingAction.setHoverImageDescriptor(syncIcon);
service.activateHandler(toggleLinkingAction.getActionDefinitionId(), new ActionHandler(toggleLinkingAction));
}
boolean hideCollapseAllAction = viewerDescriptor.getBooleanConfigProperty(INavigatorViewerDescriptor.PROP_HIDE_COLLAPSE_ALL_ACTION);
if (!hideCollapseAllAction) {
collapseAllAction = new CollapseAllAction(commonViewer);
// $NON-NLS-1$
ImageDescriptor collapseAllIcon = getImageDescriptor("elcl16/collapseall.gif");
collapseAllAction.setImageDescriptor(collapseAllIcon);
collapseAllAction.setHoverImageDescriptor(collapseAllIcon);
collapseAllHandler = new CollapseAllHandler(commonViewer);
service.activateHandler(CollapseAllHandler.COMMAND_ID, collapseAllHandler);
}
filterGroup = new FilterActionGroup(commonViewer);
}
use of org.eclipse.ui.handlers.IHandlerService in project netxms by netxms.
the class AbstractTraceWidget method createActions.
/**
* Create actions
*/
protected void createActions() {
final IHandlerService handlerService = (IHandlerService) PlatformUI.getWorkbench().getService(IHandlerService.class);
actionPause = new Action(Messages.get().AbstractTraceView_Pause, Action.AS_CHECK_BOX) {
@Override
public void run() {
setPaused(actionPause.isChecked());
}
};
// $NON-NLS-1$
actionPause.setImageDescriptor(Activator.getImageDescriptor("icons/pause.png"));
// $NON-NLS-1$
actionPause.setActionDefinitionId("org.netxms.ui.eclipse.library.commands.pause_trace");
final ActionHandler pauseHandler = new ActionHandler(actionPause);
handlerService.activateHandler(actionPause.getActionDefinitionId(), pauseHandler);
}
use of org.eclipse.ui.handlers.IHandlerService in project netxms by netxms.
the class RepositoryManager method createActions.
/**
* Create actions
*/
private void createActions() {
final IHandlerService handlerService = (IHandlerService) getSite().getService(IHandlerService.class);
actionRefresh = new RefreshAction(this) {
@Override
public void run() {
refreshRepositoryList();
}
};
actionShowFilter = new Action("Show &filter", Action.AS_CHECK_BOX) {
@Override
public void run() {
enableFilter(!filterEnabled);
actionShowFilter.setChecked(filterEnabled);
}
};
actionShowFilter.setChecked(filterEnabled);
// $NON-NLS-1$
actionShowFilter.setActionDefinitionId("org.netxms.ui.eclipse.market.commands.showFilter");
handlerService.activateHandler(actionShowFilter.getActionDefinitionId(), new ActionHandler(actionShowFilter));
actionAddRepository = new Action("&Add repository...", SharedIcons.ADD_OBJECT) {
@Override
public void run() {
addRepository();
}
};
actionDelete = new Action("&Delete", SharedIcons.DELETE_OBJECT) {
@Override
public void run() {
deleteRepository();
}
};
actionMark = new Action("&Mark for installation") {
@Override
public void run() {
markForInstallation(true);
}
};
// $NON-NLS-1$
actionMark.setActionDefinitionId("org.netxms.ui.eclipse.market.commands.mark");
handlerService.activateHandler(actionMark.getActionDefinitionId(), new ActionHandler(actionMark));
actionUnmark = new Action("&Unmark for installation") {
@Override
public void run() {
markForInstallation(false);
}
};
// $NON-NLS-1$
actionUnmark.setActionDefinitionId("org.netxms.ui.eclipse.market.commands.unmark");
handlerService.activateHandler(actionUnmark.getActionDefinitionId(), new ActionHandler(actionUnmark));
actionInstall = new Action("&Install", Activator.getImageDescriptor("icons/install.gif")) {
@Override
public void run() {
install();
}
};
// $NON-NLS-1$
actionInstall.setActionDefinitionId("org.netxms.ui.eclipse.market.commands.install");
handlerService.activateHandler(actionInstall.getActionDefinitionId(), new ActionHandler(actionInstall));
}
use of org.eclipse.ui.handlers.IHandlerService in project netxms by netxms.
the class TunnelManager method createActions.
/**
* Create actions
*/
private void createActions() {
actionRefresh = new RefreshAction(this) {
@Override
public void run() {
refresh();
}
};
actionCreateNode = new Action("&Create node and bind...") {
@Override
public void run() {
createNode();
}
};
actionBind = new Action("&Bind to...") {
@Override
public void run() {
bindTunnel();
}
};
actionUnbind = new Action("&Unbind") {
@Override
public void run() {
unbindTunnel();
}
};
actionShowFilter = new Action("&Show filter") {
/*
* (non-Javadoc)
*
* @see org.eclipse.jface.action.Action#run()
*/
@Override
public void run() {
enableFilter(actionShowFilter.isChecked());
}
};
actionShowFilter.setImageDescriptor(SharedIcons.FILTER);
actionShowFilter.setChecked(initShowfilter);
// $NON-NLS-1$
actionShowFilter.setActionDefinitionId("org.netxms.ui.eclipse.agentmanager.commands.show_filter");
final IHandlerService handlerService = (IHandlerService) getSite().getService(IHandlerService.class);
handlerService.activateHandler(actionShowFilter.getActionDefinitionId(), new ActionHandler(actionShowFilter));
}
Aggregations