use of org.eclipse.ui.IActionBars in project cubrid-manager by CUBRID.
the class XMLEditor method hookRetargetActions.
/**
* Add format action.
*/
protected void hookRetargetActions() {
super.hookRetargetActions();
IActionBars bar = this.getEditorSite().getActionBars();
bar.setGlobalActionHandler(ActionConstants.ACTION_FORMAT, actions.get(ActionConstants.ACTION_FORMAT));
bar.updateActionBars();
}
use of org.eclipse.ui.IActionBars in project cubrid-manager by CUBRID.
the class XMLEditor method unHookRetargetActions.
/**
*
* Unhook retartet actions
*
*/
protected void unHookRetargetActions() {
super.unHookRetargetActions();
IActionBars bar = this.getEditorSite().getActionBars();
bar.setGlobalActionHandler(ActionConstants.ACTION_FORMAT, null);
bar.updateActionBars();
}
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 tdi-studio-se by Talend.
the class ProblemsView method createPartControl.
@Override
public void createPartControl(Composite parent) {
this.parent = parent;
CorePlugin.getDefault().getRepositoryService().getProxyRepositoryFactory().addPropertyChangeListener(this);
parent.setLayout(new FillLayout());
viewer = new TreeViewer(parent, SWT.SINGLE | SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER | SWT.FULL_SELECTION);
final Tree tree = viewer.getTree();
tree.setHeaderVisible(true);
tree.setLinesVisible(true);
viewer.addSelectionChangedListener(new ISelectionChangedListener() {
@Override
public void selectionChanged(SelectionChangedEvent event) {
IStructuredSelection selection = (IStructuredSelection) event.getSelection();
Problem problem = (Problem) selection.getFirstElement();
if (problem != null && problem.isConcrete()) {
if (problem.getNodeName() != null) {
selectInDesigner(problem.getJobInfo(), problem.getNodeName());
} else if (problem instanceof TalendProblem) {
selectInRoutine((TalendProblem) problem);
}
}
}
});
TreeColumn column1 = new TreeColumn(tree, SWT.CENTER);
//$NON-NLS-1$
column1.setText(Messages.getString("ProblemsView.description"));
column1.setWidth(400);
column1.setAlignment(SWT.LEFT);
column1.setResizable(true);
TreeColumn column2 = new TreeColumn(tree, SWT.LEFT);
//$NON-NLS-1$
column2.setText(Messages.getString("ProblemsView.resource"));
column2.setWidth(400);
column2.setResizable(true);
ProblemViewProvider provider = new ProblemViewProvider();
viewer.setLabelProvider(provider);
viewer.setContentProvider(provider);
resetContent();
IActionBars actionBars = getViewSite().getActionBars();
initMenu(actionBars.getMenuManager());
}
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;
}
Aggregations