use of org.eclipse.jface.action.Separator in project translationstudio8 by heartsome.
the class ApplicationActionBarAdvisor method createFileMenu.
/**
* 创建文件菜单
* @return 返回文件菜单的 menu manager;
*/
private MenuManager createFileMenu() {
MenuManager menu = new MenuManager(Messages.getString("ts.ApplicationActionBarAdvisor.menu.file"), // &File
IWorkbenchActionConstants.M_FILE);
menu.add(new GroupMarker(IWorkbenchActionConstants.FILE_START));
// 添加 new.ext group,这样 IDE 中定义的 Open File... 可以显示在最顶端
// menu.add(newAction);
menu.add(new GroupMarker(IWorkbenchActionConstants.NEW_EXT));
menu.add(new Separator());
menu.add(closeAction);
menu.add(closeAllAction);
menu.add(refreshAction);
// menu.add(new Separator("net.heartsome.cat.ts.ui.menu.file.separator"));
menu.add(new GroupMarker("xliff.switch"));
menu.add(new GroupMarker("rtf.switch"));
menu.add(new GroupMarker("xliff.split"));
menu.add(new Separator());
// 设置保存文件记录条数为 5 条
WorkbenchPlugin.getDefault().getPreferenceStore().setValue(IPreferenceConstants.RECENT_FILES, 5);
// 添加文件访问列表
ContributionItemFactory REOPEN_EDITORS = new //$NON-NLS-1$
ContributionItemFactory(//$NON-NLS-1$
"reopenEditors") {
/* (non-javadoc) method declared on ContributionItemFactory */
public IContributionItem create(IWorkbenchWindow window) {
if (window == null) {
throw new IllegalArgumentException();
}
return new ReopenEditorMenu(window, getId(), false);
}
};
menu.add(REOPEN_EDITORS.create(window));
menu.add(exitAction);
menu.add(new GroupMarker(IWorkbenchActionConstants.FILE_END));
return menu;
}
use of org.eclipse.jface.action.Separator in project translationstudio8 by heartsome.
the class PortingActionProvider method addImportMenu.
private void addImportMenu(IMenuManager aMenu) {
importWizardActionGroup.setContext(getContext());
if (importWizardActionGroup.getWizardActionIds().length == 0) {
aMenu.appendToGroup(ICommonMenuConstants.GROUP_PORT, importAction);
return;
}
IMenuManager submenu = new MenuManager(WorkbenchNavigatorMessages.PortingActionProvider_ImportResourcesMenu_label, COMMON_NAVIGATOR_IMPORT_MENU);
importWizardActionGroup.fillContextMenu(submenu);
submenu.add(new Separator(ICommonMenuConstants.GROUP_ADDITIONS));
submenu.add(new Separator());
submenu.add(importAction);
aMenu.appendToGroup(ICommonMenuConstants.GROUP_PORT, submenu);
}
use of org.eclipse.jface.action.Separator in project translationstudio8 by heartsome.
the class WorkingSetRootModeActionGroup method addActions.
/**
* Adds the actions to the given menu manager.
*/
protected void addActions(IMenuManager viewMenu) {
if (actions == null)
actions = createActions();
viewMenu.add(new Separator());
items = new MenuItem[actions.length];
for (int i = 0; i < actions.length; i++) {
final int j = i;
viewMenu.add(new ContributionItem() {
public void fill(Menu menu, int index) {
int style = SWT.CHECK;
if ((actions[j].getStyle() & IAction.AS_RADIO_BUTTON) != 0)
style = SWT.RADIO;
final MenuItem mi = new MenuItem(menu, style, index);
items[j] = mi;
mi.setText(actions[j].getText());
mi.setSelection(currentSelection == j);
mi.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
if (currentSelection == j) {
items[currentSelection].setSelection(true);
return;
}
actions[j].run();
// Update checked state
items[currentSelection].setSelection(false);
currentSelection = j;
items[currentSelection].setSelection(true);
}
});
}
public boolean isDynamic() {
return false;
}
});
}
}
use of org.eclipse.jface.action.Separator in project azure-tools-for-java by Microsoft.
the class ServiceExplorerView method fillLocalToolBar.
private void fillLocalToolBar(IToolBarManager manager) {
manager.add(refreshAction);
manager.add(signInOutAction);
manager.add(selectSubscriptionAction);
manager.add(new Separator());
}
use of org.eclipse.jface.action.Separator in project tdi-studio-se by Talend.
the class JobHierarchyViewPart method createPartControl.
@Override
public void createPartControl(Composite container) {
fParent = container;
addResizeListener(fParent);
fPagebook = new PageBook(container, SWT.NONE);
// page 1 of page book (no hierarchy label)
fNoHierarchyShownLabel = new Label(fPagebook, SWT.TOP + SWT.LEFT + SWT.WRAP);
fNoHierarchyShownLabel.setText(showEmptyLabel);
// page 2 of page book (viewers)
fTypeMethodsSplitter = new SashForm(fPagebook, SWT.VERTICAL);
fTypeMethodsSplitter.setVisible(false);
fTypeViewerViewForm = new ViewForm(fTypeMethodsSplitter, SWT.NONE);
Control typeViewerControl = createTypeViewerControl(fTypeViewerViewForm);
fTypeViewerViewForm.setContent(typeViewerControl);
dependencyViewerViewForm = new ViewForm(fTypeMethodsSplitter, SWT.NONE);
fTypeMethodsSplitter.setWeights(new int[] { 65, 35 });
Control dependencyViewerPart = createMethodViewerControl(dependencyViewerViewForm);
dependencyViewerViewForm.setContent(dependencyViewerPart);
dependencyViewerPaneLabel = new CLabel(dependencyViewerViewForm, SWT.NONE);
dependencyViewerViewForm.setTopLeft(dependencyViewerPaneLabel);
ToolBar methodViewerToolBar = new ToolBar(dependencyViewerViewForm, SWT.FLAT | SWT.WRAP);
dependencyViewerViewForm.setTopCenter(methodViewerToolBar);
initDragAndDrop();
MenuManager menu = new MenuManager();
menu.add(focusOnTypeAction);
fNoHierarchyShownLabel.setMenu(menu.createContextMenu(fNoHierarchyShownLabel));
fPagebook.showPage(fNoHierarchyShownLabel);
int layout;
try {
layout = fDialogSettings.getInt(DIALOGSTORE_VIEWLAYOUT);
if (layout < 0 || layout > 3) {
layout = VIEW_LAYOUT_AUTOMATIC;
}
} catch (NumberFormatException e) {
layout = VIEW_LAYOUT_AUTOMATIC;
}
// force the update
fCurrentLayout = -1;
// will fill the main tool bar
setViewLayout(layout);
// set the filter menu items
IActionBars actionBars = getViewSite().getActionBars();
IMenuManager viewMenu = actionBars.getMenuManager();
// for (int i = 0; i < fViewActions.length; i++) {
// ToggleViewAction action = fViewActions[i];
// viewMenu.add(action);
// action.setEnabled(false);
// }
// viewMenu.add(new Separator());
// IMenuManager layoutSubMenu = new MenuManager(TypeHierarchyMessages.TypeHierarchyViewPart_layout_submenu);
//$NON-NLS-1$
IMenuManager layoutSubMenu = new MenuManager(Messages.getString("FocusOnJobAction.TypeHierarchyViewPart_layout_submenu"));
viewMenu.add(layoutSubMenu);
for (int i = 0; i < fToggleOrientationActions.length; i++) {
layoutSubMenu.add(fToggleOrientationActions[i]);
}
viewMenu.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
// selection provider
int nHierarchyViewers = fAllViewers.length;
StructuredViewer[] trackedViewers = new StructuredViewer[nHierarchyViewers + 1];
for (int i = 0; i < nHierarchyViewers; i++) {
trackedViewers[i] = fAllViewers[i];
}
trackedViewers[nHierarchyViewers] = dependencyViewer;
fSelectionProviderMediator = new SelectionProviderMediator(trackedViewers, getCurrentViewer());
getSite().setSelectionProvider(fSelectionProviderMediator);
ActionGroup[] actionGroups = new ActionGroup[] { new JobActionGroup() };
fActionGroups = new CompositeActionGroup(actionGroups);
fActionGroups.fillActionBars(actionBars);
}
Aggregations