use of org.eclipse.ui.IActionBars in project tdi-studio-se by Talend.
the class MultiPageEditorContributor method dispose.
/*
* (non-Javadoc)
*
* @see org.eclipse.ui.part.EditorActionBarContributor#dispose()
*/
@Override
public void dispose() {
super.dispose();
IActionBars actionBars = getActionBars();
if (actionBars != null) {
actionBars.clearGlobalActionHandlers();
}
for (RetargetAction action : retargetActions) {
getPage().removePartListener(action);
}
activeEditorPart = null;
designActionKeys = null;
retargetActions = null;
registry = null;
}
use of org.eclipse.ui.IActionBars in project tdi-studio-se by Talend.
the class TalendPaletteHelper method checkAndInitToolBar2.
private static void checkAndInitToolBar2() {
//
IWorkbenchWindow activeWorkbenchWindow = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
if (activeWorkbenchWindow == null || activeWorkbenchWindow.getActivePage() == null) {
return;
}
boolean isTalendEditor = false;
IWorkbenchPage activePage = activeWorkbenchWindow.getActivePage();
IEditorPart activePart = activePage.getActiveEditor();
if (activePart != null && activePart instanceof AbstractMultiPageTalendEditor) {
isTalendEditor = true;
}
IViewPart paletteViewPart = activePage.findView(PaletteView.ID);
if (paletteViewPart != null) {
// find existing or not, and add it.
IActionBars actionBars = paletteViewPart.getViewSite().getActionBars();
// ShowStandardAction showStandardAction = ShowStandardAction.getInstance();
// updatePaletteActions(actionBars, showStandardAction, isTalendEditor);
//
// ShowFavoriteAction showFavoriteAction = ShowFavoriteAction.getInstance();
// updatePaletteActions(actionBars, showFavoriteAction, isTalendEditor);
//
// if (ShowFavoriteAction.state) {
// showStandardAction.doSetEnable();
// }
OpenPaletteFilterAction openPaletteFilterAction = OpenPaletteFilterAction.getInstance();
updatePaletteActions(actionBars, openPaletteFilterAction, isTalendEditor);
actionBars.updateActionBars();
}
}
use of org.eclipse.ui.IActionBars in project tesb-studio-se by Talend.
the class ESBRuntimeConsolePageParticipant method init.
@Override
public void init(IPageBookViewPage page, IConsole console) {
if (page.getControl() instanceof StyledText) {
StyledText viewer = (StyledText) page.getControl();
AnsiConsoleStyleListener myListener = new AnsiConsoleStyleListener();
viewer.addLineStyleListener(myListener);
ESBRunContainerPlugin.getDefault().addViewer(viewer, this);
}
startRuntimeAction = new StartRuntimeAction(true, page.getControl().getShell());
haltRuntimeAction = new StopRuntimeAction(page.getControl().getShell());
openRuntimeInfoAction = new OpenRuntimeInfoAction();
openRuntimePrefsAction = new OpenRuntimePrefsAction();
serverListener = new RuntimeStatusChangeListener() {
@Override
public void stopRunning() {
Display.getDefault().asyncExec(new Runnable() {
@Override
public void run() {
startRuntimeAction.setEnabled(true);
haltRuntimeAction.setEnabled(false);
openRuntimeInfoAction.setEnabled(false);
}
});
}
@Override
public void startRunning() {
Display.getDefault().asyncExec(new Runnable() {
@Override
public void run() {
startRuntimeAction.setEnabled(false);
haltRuntimeAction.setEnabled(true);
openRuntimeInfoAction.setEnabled(true);
}
});
}
@Override
public void featureUninstalled(int id) {
}
@Override
public void featureInstalled(int id) {
}
};
RuntimeServerController.getInstance().addStatusChangeListener(serverListener);
IActionBars actionBars = page.getSite().getActionBars();
configureToolBar(actionBars.getToolBarManager());
}
use of org.eclipse.ui.IActionBars in project tdi-studio-se by Talend.
the class OverviewSection method createControls.
/*
* @see AbstractJvmPropertySection#createControls(Composite)
*/
@Override
protected void createControls(final Composite parent) {
Composite composite = new Composite(parent, SWT.NONE);
GridLayout layout = new GridLayout();
layout.marginHeight = 0;
layout.marginWidth = 0;
composite.setLayout(layout);
viewer = new PropertiesFilteredTree(composite, getActionBars()) {
private ShowInTimelineAction showInTimelineAction;
@Override
protected List<Action> createActions(IActionBars actionBars) {
List<Action> actions = new ArrayList<Action>();
CopyAction copyAction = CopyAction.createCopyAction(actionBars);
actions.add(copyAction);
showInTimelineAction = new MyShowInTimelineAction(OverviewSection.this);
actions.add(showInTimelineAction);
return actions;
}
@Override
public void menuAboutToshow() {
// do nothing
}
}.getViewer();
viewer.setContentProvider(new OverviewContentProvider(overviewProperties));
viewer.setLabelProvider(new OverviewLabelProvider());
((Tree) viewer.getControl()).addFocusListener(new FocusAdapter() {
@Override
public void focusLost(FocusEvent e) {
storeTreeExpansionState();
}
});
PlatformUI.getWorkbench().getHelpSystem().setHelp(parent, IHelpContextIds.OVERVIEW_PAGE);
}
use of org.eclipse.ui.IActionBars in project bndtools by bndtools.
the class JAREditorContributor method setActivePage.
/*
* (non-JavaDoc) Method declared in AbstractMultiPageEditorActionBarContributor.
*/
@Override
public void setActivePage(IEditorPart part) {
if (activeEditorPart == part)
return;
activeEditorPart = part;
IActionBars actionBars = getActionBars();
if (actionBars != null) {
ITextEditor editor = (part instanceof ITextEditor) ? (ITextEditor) part : null;
actionBars.setGlobalActionHandler(ActionFactory.DELETE.getId(), getAction(editor, ITextEditorActionConstants.DELETE));
actionBars.setGlobalActionHandler(ActionFactory.UNDO.getId(), getAction(editor, ITextEditorActionConstants.UNDO));
actionBars.setGlobalActionHandler(ActionFactory.REDO.getId(), getAction(editor, ITextEditorActionConstants.REDO));
actionBars.setGlobalActionHandler(ActionFactory.CUT.getId(), getAction(editor, ITextEditorActionConstants.CUT));
actionBars.setGlobalActionHandler(ActionFactory.COPY.getId(), getAction(editor, ITextEditorActionConstants.COPY));
actionBars.setGlobalActionHandler(ActionFactory.PASTE.getId(), getAction(editor, ITextEditorActionConstants.PASTE));
actionBars.setGlobalActionHandler(ActionFactory.SELECT_ALL.getId(), getAction(editor, ITextEditorActionConstants.SELECT_ALL));
actionBars.setGlobalActionHandler(ActionFactory.FIND.getId(), getAction(editor, ITextEditorActionConstants.FIND));
actionBars.setGlobalActionHandler(IDEActionFactory.BOOKMARK.getId(), getAction(editor, IDEActionFactory.BOOKMARK.getId()));
actionBars.updateActionBars();
}
}
Aggregations