本文整理汇总了Java中org.eclipse.swt.SWT.CASCADE属性的典型用法代码示例。如果您正苦于以下问题:Java SWT.CASCADE属性的具体用法?Java SWT.CASCADE怎么用?Java SWT.CASCADE使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.eclipse.swt.SWT
的用法示例。
在下文中一共展示了SWT.CASCADE属性的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createUploadLimitMenu
/**
* Creates the global upload limit context menu item
* @param parent The system tray contextual menu
*/
private final void createUploadLimitMenu(final Menu parent) {
if ( gm == null ){
return;
}
final MenuItem uploadSpeedItem = new MenuItem(parent, SWT.CASCADE);
uploadSpeedItem.setText(MessageText.getString("GeneralView.label.maxuploadspeed"));
final Menu uploadSpeedMenu = new Menu(uiFunctions.getMainShell(),
SWT.DROP_DOWN);
uploadSpeedMenu.addListener(SWT.Show, new Listener() {
@Override
public void handleEvent(Event event) {
SelectableSpeedMenu.generateMenuItems(uploadSpeedMenu, core, gm, true);
}
});
uploadSpeedItem.setMenu(uploadSpeedMenu);
}
示例2: createDownloadLimitMenu
/**
* Creates the global download limit context menu item
* @param parent The system tray contextual menu
*/
private final void createDownloadLimitMenu(final Menu parent) {
if ( gm == null ){
return;
}
final MenuItem downloadSpeedItem = new MenuItem(parent, SWT.CASCADE);
downloadSpeedItem.setText(MessageText.getString("GeneralView.label.maxdownloadspeed"));
final Menu downloadSpeedMenu = new Menu(uiFunctions.getMainShell(),
SWT.DROP_DOWN);
downloadSpeedMenu.addListener(SWT.Show, new Listener() {
@Override
public void handleEvent(Event event) {
SelectableSpeedMenu.generateMenuItems(downloadSpeedMenu, core, gm, false);
}
});
downloadSpeedItem.setMenu(downloadSpeedMenu);
}
示例3: createApplicationMenu
private void createApplicationMenu() {
Menu menuBar = new Menu(getShell(), SWT.BAR);
MenuItem helpMenuHeader = new MenuItem(menuBar, SWT.CASCADE);
helpMenuHeader.setText("&pgSqlBlocks");
Menu helpMenu = new Menu(getShell(), SWT.DROP_DOWN);
helpMenuHeader.setMenu(helpMenu);
MenuItem helpGetHelpItem = new MenuItem(helpMenu, SWT.PUSH);
helpGetHelpItem.setText(resourceBundle.getString("about"));
helpGetHelpItem.addListener(SWT.Selection, e -> new AboutDlg(getShell()).open());
getShell().setMenuBar(menuBar);
MenuItem exitMenuItem = new MenuItem(helpMenu, SWT.PUSH);
exitMenuItem.setText(resourceBundle.getString("exit"));
exitMenuItem.addListener(SWT.Selection, e -> getShell().close());
getShell().setMenuBar(menuBar);
}
示例4: addMenuItemListener
protected void addMenuItemListener(Menu menu, Listener l) {
for (MenuItem item : menu.getItems()) {
if (item.getStyle() == SWT.CASCADE) {
addMenuItemListener(item.getMenu(), l);
} else {
item.addListener(SWT.Selection, l);
}
}
}
示例5: createTopLevelMenuItem
public static MenuItem createTopLevelMenuItem(Menu menuParent,
String localizationKey) {
Menu menu = new Menu(Utils.findAnyShell(), SWT.DROP_DOWN);
MenuItem menuItem = new MenuItem(menuParent, SWT.CASCADE);
Messages.setLanguageText(menuItem, localizationKey);
menuItem.setMenu(menu);
/*
* A top level menu and its menu item has the same ID; this is used to locate them at runtime
*/
menu.setData(KEY_MENU_ID, localizationKey);
menuItem.setData(KEY_MENU_ID, localizationKey);
return menuItem;
}
示例6: newMenu
private Menu newMenu(String name) {
name = Translate.getInstance().menuName(name);
final MenuItem am = new MenuItem(mbar, SWT.CASCADE);
am.setText(name);
Menu m = newMenu(SWT.DROP_DOWN);
am.setMenu(m);
return m;
}
示例7: addSpeedMenu
public static void
addSpeedMenu(
final Shell shell,
Menu menuAdvanced,
boolean doUpMenu,
boolean doDownMenu,
boolean isTorrentContext,
boolean hasSelection,
boolean downSpeedDisabled,
boolean downSpeedUnlimited,
long totalDownSpeed,
long downSpeedSetMax,
long maxDownload,
boolean upSpeedDisabled,
boolean upSpeedUnlimited,
long totalUpSpeed,
long upSpeedSetMax,
long maxUpload,
final int num_entries,
Map<String,Object> _properties,
final SpeedAdapter adapter )
{
if (doDownMenu) {
// advanced > Download Speed Menu //
final MenuItem itemDownSpeed = new MenuItem(menuAdvanced, SWT.CASCADE);
Messages.setLanguageText(itemDownSpeed,
"MyTorrentsView.menu.setDownSpeed"); //$NON-NLS-1$
Utils.setMenuItemImage(itemDownSpeed, "speed");
Menu menuDownSpeed = new Menu(shell, SWT.DROP_DOWN);
itemDownSpeed.setMenu(menuDownSpeed);
addSpeedMenuDown(shell, menuDownSpeed, isTorrentContext, hasSelection,
downSpeedDisabled, downSpeedUnlimited, totalDownSpeed,
downSpeedSetMax, maxDownload, num_entries, _properties, adapter);
}
if (doUpMenu) {
// advanced >Upload Speed Menu //
final MenuItem itemUpSpeed = new MenuItem(menuAdvanced, SWT.CASCADE);
Messages.setLanguageText(itemUpSpeed, "MyTorrentsView.menu.setUpSpeed"); //$NON-NLS-1$
Utils.setMenuItemImage(itemUpSpeed, "speed");
Menu menuUpSpeed = new Menu(shell, SWT.DROP_DOWN);
itemUpSpeed.setMenu(menuUpSpeed);
addSpeedMenuUp(shell, menuUpSpeed, isTorrentContext, hasSelection,
upSpeedDisabled, upSpeedUnlimited, totalUpSpeed, upSpeedSetMax,
maxUpload, num_entries, _properties, adapter);
}
}
示例8: fillMenu
@Override
public void
fillMenu(
String sColumnName, final Menu menu)
{
Shell shell = menu.getShell();
/*
final MenuItem itemStart = new MenuItem(menu, SWT.PUSH);
Messages.setLanguageText(itemStart, "MySharesView.menu.start"); //$NON-NLS-1$
itemStart.setImage(ImageRepository.getImage("start"));
final MenuItem itemStop = new MenuItem(menu, SWT.PUSH);
Messages.setLanguageText(itemStop, "MySharesView.menu.stop"); //$NON-NLS-1$
itemStop.setImage(ImageRepository.getImage("stop"));
*/
menuCategory = new Menu(shell, SWT.DROP_DOWN);
final MenuItem itemCategory = new MenuItem(menu, SWT.CASCADE);
Messages.setLanguageText(itemCategory, "MyTorrentsView.menu.setCategory"); //$NON-NLS-1$
//itemCategory.setImage(ImageRepository.getImage("speed"));
itemCategory.setMenu(menuCategory);
addCategorySubMenu();
new MenuItem(menu, SWT.SEPARATOR);
final MenuItem itemRemove = new MenuItem(menu, SWT.PUSH);
Messages.setLanguageText(itemRemove, "MySharesView.menu.remove"); //$NON-NLS-1$
Utils.setMenuItemImage(itemRemove, "delete");
Object[] shares = tv.getSelectedDataSources().toArray();
itemRemove.setEnabled(shares.length > 0);
itemRemove.addListener(SWT.Selection, new Listener() {
@Override
public void handleEvent(Event e) {
removeSelectedShares();
}
});
new MenuItem(menu, SWT.SEPARATOR);
}
示例9: fillDropDownMenu
/**
* @param menuDropDown
*
* @since 3.1.1.1
*/
protected void fillDropDownMenu(Menu menuDropDown, TreeItem[] items,
int indent) {
String s = "";
for (int i = 0; i < indent; i++) {
s += " ";
}
for (int i = 0; i < items.length; i++) {
TreeItem treeItem = items[i];
SideBarEntrySWT entry = (SideBarEntrySWT) treeItem.getData("MdiEntry");
if (entry == null) {
continue;
}
org.eclipse.swt.widgets.MenuItem menuItem = new org.eclipse.swt.widgets.MenuItem(
menuDropDown, entry.isSelectable() ? SWT.RADIO : SWT.CASCADE);
String id = entry.getId();
menuItem.setData("Plugin.viewID", id);
ViewTitleInfo titleInfo = entry.getViewTitleInfo();
String ind = "";
if (titleInfo != null) {
String o = (String) titleInfo.getTitleInfoProperty(ViewTitleInfo.TITLE_INDICATOR_TEXT);
if (o != null) {
ind = " (" + o + ")";
//ind = "\t" + o;
}
}
menuItem.setText(s + entry.getTitle() + ind);
menuItem.addSelectionListener(dropDownSelectionListener);
if (currentEntry != null && currentEntry.getId().equals(id)) {
menuItem.setSelection(true);
}
TreeItem[] subItems = treeItem.getItems();
if (subItems.length > 0) {
Menu parent = menuDropDown;
if (!entry.isSelectable()) {
parent = new Menu(menuDropDown.getParent().getShell(), SWT.DROP_DOWN);
menuItem.setMenu(parent);
}
fillDropDownMenu(parent, subItems, indent + 1);
}
}
}