本文整理汇总了Java中com.alee.laf.menu.WebMenuItem类的典型用法代码示例。如果您正苦于以下问题:Java WebMenuItem类的具体用法?Java WebMenuItem怎么用?Java WebMenuItem使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
WebMenuItem类属于com.alee.laf.menu包,在下文中一共展示了WebMenuItem类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: createBuildPlanMenuItems
import com.alee.laf.menu.WebMenuItem; //导入依赖的package包/类
private void createBuildPlanMenuItems() {
for (String key : monitoredBuildsState.getFavoriteBuildStatus().keySet()) {
final Result result = monitoredBuildsState.getFavoriteBuildStatus().get(key);
Icon icon = resolveIcon(result);
ImageIcon stateIcon = new ImageIcon(icon.getImage());
String menuItemText = String.format("#%d - %s", result.getBuildNumber(), result.getPlan().getShortName());
WebMenuItem buildItem = new WebMenuItem(menuItemText, stateIcon);
buildItem.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
try {
Desktop.getDesktop().browse(new URI(result.getLink().getHref()));
} catch (Exception e1) {
logger.error("Failed to create uri from link " + result.getLink().getHref());
}
}
});
jpopup.add(buildItem);
}
}
开发者ID:MartinHatas,项目名称:bamboo-build-notifier,代码行数:20,代码来源:Application.java
示例2: createExitMenuItem
import com.alee.laf.menu.WebMenuItem; //导入依赖的package包/类
private void createExitMenuItem() {
ImageIcon exitIcon = new ImageIcon(this.getClass().getClassLoader().getResource("images/exit.png"));
WebMenuItem exitMI = new WebMenuItem("Exit", exitIcon);
exitMI.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
logger.info("Exiting application.");
System.exit(0);
}
});
jpopup.add(exitMI);
}
开发者ID:MartinHatas,项目名称:bamboo-build-notifier,代码行数:12,代码来源:Application.java
示例3: createMenu
import com.alee.laf.menu.WebMenuItem; //导入依赖的package包/类
private WebMenuBar createMenu() {
WebMenuBar result = new WebMenuBar();
result.add(new WebMenu(AppSettings.getLocalizedString("mainWindow.menu.file")) {
{
add(new WebMenuItem(AppSettings.getLocalizedString("mainWindow.menu.file.exit")));
}
});
return result;
}
开发者ID:DiscoElevator,项目名称:MyMediaList,代码行数:10,代码来源:MainWindow.java
示例4: getComponentPopupMenu
import com.alee.laf.menu.WebMenuItem; //导入依赖的package包/类
@Override
public JPopupMenu getComponentPopupMenu() {
WebPopupMenu menu = new WebPopupMenu();
if (mFile == null)
return null; // should never happen
WebMenuItem saveMenuItem = new WebMenuItem(Tr.tr("Save File As…"));
saveMenuItem.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent event) {
if (mFile == null)
return; // should never happen
File suggestedFile = new File(
mFileChooser.getCurrentDirectory(), mFile.getName());
mFileChooser.setSelectedFile(suggestedFile);
// fix WebLaf bug
mFileChooser.getFileChooserPanel().setSelectedFiles(new File[]{suggestedFile});
int option = mFileChooser.showSaveDialog(AttachmentPanel.this);
if (option == JFileChooser.APPROVE_OPTION) {
try {
Files.copy(mFile.toPath(), mFileChooser.getSelectedFile().toPath(),
StandardCopyOption.REPLACE_EXISTING);
} catch (IOException ex) {
LOGGER.log(Level.WARNING, "can't copy file", ex);
}
}
}
});
if (!mFile.exists()) {
saveMenuItem.setEnabled(false);
saveMenuItem.setToolTipText(Tr.tr("File does not exist"));
}
menu.add(saveMenuItem);
return menu;
}
开发者ID:kontalk,项目名称:desktopclient-java,代码行数:41,代码来源:ComponentUtils.java
示例5: showPopupMenu
import com.alee.laf.menu.WebMenuItem; //导入依赖的package包/类
private void showPopupMenu(MouseEvent e) {
WebPopupMenu menu = new WebPopupMenu();
WebMenuItem removeItem = new WebMenuItem(Tr.tr("Remove"));
removeItem.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent event) {
EditableAvatarImage.this.changeImage(null);
}
});
removeItem.setEnabled(EditableAvatarImage.this.canRemove());
menu.add(removeItem);
menu.show(this, e.getX(), e.getY());
}
开发者ID:kontalk,项目名称:desktopclient-java,代码行数:14,代码来源:ComponentUtils.java
示例6: Tool
import com.alee.laf.menu.WebMenuItem; //导入依赖的package包/类
public Tool(String name)
{
this.name = name;
WebPopup menu = new WebPopup();
menu.add(new WebMenuItem(name + " Settings"));
menu.add(new WebSeparator());
menu.setLayout(new BoxLayout(menu, BoxLayout.Y_AXIS));
menu.setPopupStyle(PopupStyle.bordered);
menu.setFocusable(false);
this.menu = menu;
}
开发者ID:Spade-Editor,项目名称:Spade,代码行数:14,代码来源:Tool.java
示例7: createMenuItem
import com.alee.laf.menu.WebMenuItem; //导入依赖的package包/类
public static JMenuItem createMenuItem(String text)
{
WebMenuItem c = new WebMenuItem(text);
return c;
}
开发者ID:Spade-Editor,项目名称:Spade,代码行数:6,代码来源:WeblafWrapper.java
示例8: asMenuItem
import com.alee.laf.menu.WebMenuItem; //导入依赖的package包/类
public static JMenuItem asMenuItem(JComponent comp)
{
WebMenuItem c = new WebMenuItem();
c.add(comp);
return c;
}
开发者ID:Spade-Editor,项目名称:Spade,代码行数:7,代码来源:WeblafWrapper.java
示例9: installMenu
import com.alee.laf.menu.WebMenuItem; //导入依赖的package包/类
void installMenu(String topMenu, String subMenu, WebMenuItem item);
开发者ID:CLARIN-PL,项目名称:WordnetLoom,代码行数:2,代码来源:Workbench.java
注:本文中的com.alee.laf.menu.WebMenuItem类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论