use of org.eclipse.jface.action.Separator in project tdi-studio-se by Talend.
the class CpuSection method addToolBarActions.
/*
* @see AbstractJvmPropertySection#addToolBarActions(IToolBarManager)
*/
@Override
protected void addToolBarActions(IToolBarManager manager) {
suspendCpuProfilingAction.setEnabled(false);
resumeCpuProfilingAction.setEnabled(false);
clearCpuProfilingDataAction.setEnabled(false);
if (manager.find("separator") == null) {
//$NON-NLS-1$
//$NON-NLS-1$ //$NON-NLS-2$
manager.insertAfter("defaults", new Separator("separator"));
}
if (manager.find(clearCpuProfilingDataAction.getId()) == null) {
//$NON-NLS-1$
manager.insertAfter("defaults", clearCpuProfilingDataAction);
}
if (manager.find(suspendCpuProfilingAction.getId()) == null) {
//$NON-NLS-1$
manager.insertAfter("defaults", suspendCpuProfilingAction);
}
if (manager.find(resumeCpuProfilingAction.getId()) == null) {
//$NON-NLS-1$
manager.insertAfter("defaults", resumeCpuProfilingAction);
}
if (manager.find(dumpCpuProfilingDataAction.getId()) == null) {
//$NON-NLS-1$
manager.insertAfter("defaults", dumpCpuProfilingDataAction);
}
}
use of org.eclipse.jface.action.Separator in project tdi-studio-se by Talend.
the class ErDiagramMenuProvider method buildContextMenu.
@Override
public void buildContextMenu(IMenuManager menu) {
menu.add(new Separator(RELATION));
menu.add(new Separator(GEFActionConstants.GROUP_EDIT));
IAction action;
action = getAction(ActionFactory.DELETE.getId());
((ErDiagramItemDeleteAction) action).update();
if (action.isEnabled()) {
menu.appendToGroup(GEFActionConstants.GROUP_EDIT, action);
}
CreateRelationAction createRelation;
createRelation = new CreateRelationAction(part);
createRelation.update();
if (createRelation.isEnabled()) {
menu.add(createRelation);
}
TableAddAction addAction = new TableAddAction(part);
addAction.update();
menu.add(addAction);
}
use of org.eclipse.jface.action.Separator in project MonjaDB by Kanatoko.
the class MSavedActionsView method init2.
//--------------------------------------------------------------------------------
public void init2() {
parent.setLayout(new FormLayout());
tree = new Tree(parent, SWT.BORDER);
tree.addListener(SWT.KeyDown, this);
tree.addListener(SWT.MouseDoubleClick, this);
/*
tree.addKeyListener(new KeyAdapter() {
public void keyPressed(KeyEvent e) {
onKeyPressed( e );
}
});
*/
tree.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
onTreeSelect();
}
});
tree.addDisposeListener(new DisposeListener() {
public void widgetDisposed(DisposeEvent e) {
saveSavedActions();
}
});
tree.setHeaderVisible(true);
FormData fd_tree_1 = new FormData();
fd_tree_1.bottom = new FormAttachment(100, 0);
fd_tree_1.right = new FormAttachment(100, -1);
fd_tree_1.top = new FormAttachment(0, 0);
fd_tree_1.left = new FormAttachment(0, 0);
tree.setLayoutData(fd_tree_1);
loadSavedActions();
menuManager = new MenuManager();
Menu contextMenu = menuManager.createContextMenu(tree);
tree.setMenu(contextMenu);
executeAction = new Action() {
public void run() {
//-----------
onExecute();
}
};
//-----------
executeAction.setToolTipText("Execute Saved Actions");
executeAction.setText("Execute\tShift+Enter");
initAction(executeAction, "cog_go.png", menuManager);
editAction = new Action() {
public void run() {
//-----------
onEdit();
}
};
//-----------
editAction.setToolTipText("Edit Saved Actions");
editAction.setText("Edit");
initAction(editAction, "cog_edit.png", menuManager);
menuManager.add(new Separator());
newAction = new Action() {
public void run() {
//-----------
onNewSavedAction();
}
};
//-----------
newAction.setToolTipText("New");
newAction.setText("New");
initAction(newAction, "cog_add.png", menuManager);
newFolderAction = new Action() {
public void run() {
//-----------
onNewFolder();
}
};
//-----------
newFolderAction.setToolTipText("Create A New Folder");
newFolderAction.setText("New Folder");
initAction(newFolderAction, "folder_add.png", menuManager);
menuManager.add(new Separator());
removeAction = new Action() {
public void run() {
//-----------
onRemove();
}
};
//-----------
removeAction.setToolTipText("Remove Selected Item");
removeAction.setText("Remove");
initAction(removeAction, "cog_delete.png", menuManager);
executeAction.setEnabled(false);
editAction.setEnabled(false);
newAction.setEnabled(false);
newFolderAction.setEnabled(false);
removeAction.setEnabled(false);
display = shell.getDisplay();
setupDnd();
if (tree.getItemCount() > 0) {
tree.setSelection(tree.getItems()[0]);
onTreeSelect();
}
/*
tree = new Tree( parent, SWT.BORDER );
tree.setHeaderVisible( true );
FormData d1 = new FormData();
d1.top = new FormAttachment( 0, 1 );
d1.left = new FormAttachment( 0, 1 );
d1.right = new FormAttachment( 100, -1 );
d1.bottom = new FormAttachment( 100, -1 );
tree.setLayoutData( d1 );
*/
/*
tree = new Tree( sashForm, SWT.BORDER );
*/
}
use of org.eclipse.jface.action.Separator in project cubrid-manager by CUBRID.
the class SchemaContextMenuProvider method buildPublicMenuItems.
/**
* Add public menu items
*
* @param menu
*/
private void buildPublicMenuItems(IMenuManager menu) {
IAction action;
GEFActionConstants.addStandardActionGroups(menu);
menu.add(new Separator(AbstractSelectionAction.MANAGE_GROUP_ID));
menu.add(new Separator(AbstractSelectionAction.GLOBAL_GROUP_ID));
action = getActionRegistry().getAction(ImportERwinDataAction.ID);
menu.appendToGroup(AbstractSelectionAction.MANAGE_GROUP_ID, action);
}
use of org.eclipse.jface.action.Separator in project cubrid-manager by CUBRID.
the class ApplicationActionBarAdvisor method fillCoolBar.
/**
* Fills the cool bar with the main toolbars for the window.
*
* @param coolBar the cool bar manager
*/
protected void fillCoolBar(ICoolBarManager coolBarManager) {
ActionManager manager = ActionManager.getInstance();
coolBarManager.setLockLayout(true);
IToolBarManager toolbarManager = new ToolBarManager(SWT.FLAT | SWT.WRAP | SWT.BOTTOM);
coolBarManager.add(new ToolBarContributionItem(toolbarManager, IActionConstants.TOOL_NEW1));
Bundle cqbBundle = Platform.getBundle(ApplicationUtil.CQB_PLUGIN_ID);
/* Active the CQB plugin */
if (cqbBundle != null) {
try {
cqbBundle.start();
} catch (Exception e) {
LOGGER.error(e.getMessage());
}
}
Bundle cmBundle = Platform.getBundle(ApplicationUtil.CM_PLUGIN_ID);
/* Active the CM plugin */
if (cmBundle != null) {
try {
cmBundle.start();
} catch (Exception e) {
LOGGER.error(e.getMessage());
}
}
// Change view actions
if (cqbBundle != null) {
DropDownAction viewAction = new DropDownAction(Messages.modeActionBig, IAction.AS_DROP_DOWN_MENU, CubridManagerAppPlugin.getImageDescriptor("icons/cubridmanager32.gif"));
viewAction.setDisabledImageDescriptor(CubridManagerAppPlugin.getImageDescriptor("icons/cubridmanager32.gif"));
MenuManager viewActionManager = viewAction.getMenuManager();
viewActionManager.add(manager.getAction(OpenCMPerspectiveAction.ID));
viewActionManager.add(manager.getAction(OpenCQBPerspectiveAction.ID));
ActionContributionItem viewItems = new ActionContributionItem(viewAction);
viewItems.setMode(ActionContributionItem.MODE_FORCE_TEXT);
viewItems.setId(IPerspectiveConstance.PERSPECTIVE_ACTION_CONTRIBUTION_ID);
toolbarManager.add(viewItems);
toolbarManager.add(new Separator());
}
/*TOOLS-3988 There still is the install option after installing cmt plugin.*/
Bundle bundle = Platform.getBundle(ApplicationUtil.CMT_PLUGIN_ID);
if (bundle == null) {
toolbarManager.add(new Separator());
IAction action = ActionManager.getInstance().getAction(InstallMigrationToolkitAction.ID);
if (action != null) {
ActionContributionItem item = new ActionContributionItem(action);
item.setMode(ActionContributionItem.MODE_FORCE_TEXT);
toolbarManager.add(item);
item.setId(IPerspectiveConstance.MIGRATION_ACTION_CONTRIBUTION_ID);
}
} else {
/*Active the CMT plugin */
try {
bundle.start();
} catch (Exception e) {
LOGGER.error(e.getMessage());
}
}
// Help
toolbarManager.add(new Separator());
DropDownAction helpDropAction = new DropDownAction(Messages.helpActionNameBig, IAction.AS_DROP_DOWN_MENU, CubridManagerUIPlugin.getImageDescriptor("icons/action/help_big.png"));
helpDropAction.setDisabledImageDescriptor(CubridManagerUIPlugin.getImageDescriptor("icons/action/help_big.png"));
MenuManager helpActionManager = helpDropAction.getMenuManager();
helpActionManager.add(manager.getAction(HelpDocumentAction.ID));
if ("ko".equals(Messages.language)) {
helpActionManager.add(newFeatureAction);
}
helpActionManager.add(new Separator());
helpActionManager.add(createItem(ReportBugAction.ID));
helpActionManager.add(new Separator());
helpActionManager.add(manager.getAction(ViewServerVersionAction.ID));
helpActionManager.add(clientVersionAction);
ActionContributionItem helpItems = new ActionContributionItem(helpDropAction);
helpItems.setMode(ActionContributionItem.MODE_FORCE_TEXT);
helpItems.setId(IPerspectiveConstance.HELP_ACTION_CONTRIBUTION_ID);
toolbarManager.add(helpItems);
ControlContribution searchContribution = new ControlContribution(SearchContributionComposite.class.getName()) {
protected Control createControl(Composite parent) {
return new SearchContributionComposite(parent, SWT.None);
}
};
searchContribution.setId(IPerspectiveConstance.SEARCH_ACTION_CONTRIBUTION_ID);
toolbarManager.add(new Separator());
toolbarManager.add(searchContribution);
}
Aggregations