本文整理汇总了Java中com.trollworks.toolkit.ui.menu.file.RecentFilesMenu类的典型用法代码示例。如果您正苦于以下问题:Java RecentFilesMenu类的具体用法?Java RecentFilesMenu怎么用?Java RecentFilesMenu使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
RecentFilesMenu类属于com.trollworks.toolkit.ui.menu.file包,在下文中一共展示了RecentFilesMenu类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createMenu
import com.trollworks.toolkit.ui.menu.file.RecentFilesMenu; //导入依赖的package包/类
@Override
public JMenu createMenu() {
JMenu menu = new JMenu(FILE);
menu.setName(NAME);
menu.add(new DynamicMenuItem(NewCharacterSheetCommand.INSTANCE));
menu.add(new DynamicMenuItem(NewCharacterTemplateCommand.INSTANCE));
menu.add(new DynamicMenuItem(NewAdvantagesLibraryCommand.INSTANCE));
menu.add(new DynamicMenuItem(NewEquipmentLibraryCommand.INSTANCE));
menu.add(new DynamicMenuItem(NewNoteLibraryCommand.INSTANCE));
menu.add(new DynamicMenuItem(NewSkillsLibraryCommand.INSTANCE));
menu.add(new DynamicMenuItem(NewSpellsLibraryCommand.INSTANCE));
menu.addSeparator();
menu.add(new DynamicMenuItem(OpenCommand.INSTANCE));
menu.add(new RecentFilesMenu());
menu.add(new DynamicMenuItem(CloseCommand.INSTANCE));
menu.addSeparator();
menu.add(new DynamicMenuItem(SaveCommand.INSTANCE));
menu.add(new DynamicMenuItem(SaveAsCommand.INSTANCE));
menu.add(new DynamicMenuItem(ExportToGurpsCalculatorCommand.INSTANCE));
menu.addSeparator();
menu.add(new DynamicMenuItem(PageSetupCommand.INSTANCE));
menu.add(new DynamicMenuItem(PrintCommand.INSTANCE));
if (!Platform.isMacintosh()) {
menu.addSeparator();
menu.add(new DynamicMenuItem(QuitCommand.INSTANCE));
}
DynamicMenuEnabler.add(menu);
return menu;
}
示例2: open
import com.trollworks.toolkit.ui.menu.file.RecentFilesMenu; //导入依赖的package包/类
public FileProxy open(Path path) {
// See if it is already open
FileProxy proxy = (FileProxy) getDockableFor(path);
if (proxy == null) {
// If it wasn't, load it and put it into the dock
try {
switch (PathUtils.getExtension(path)) {
case AdvantageList.EXTENSION:
proxy = openAdvantageList(path);
break;
case EquipmentList.EXTENSION:
proxy = openEquipmentList(path);
break;
case SkillList.EXTENSION:
proxy = openSkillList(path);
break;
case SpellList.EXTENSION:
proxy = openSpellList(path);
break;
case LibraryFile.EXTENSION:
proxy = openLibrary(path);
break;
case GURPSCharacter.EXTENSION:
proxy = dockSheet(new SheetDockable(new GURPSCharacter(path.toFile())));
break;
case Template.EXTENSION:
proxy = dockTemplate(new TemplateDockable(new Template(path.toFile())));
break;
case FileType.PDF_EXTENSION:
proxy = dockPdf(new PdfDockable(new PdfRef(null, path.toFile(), 0), 1, null));
break;
default:
break;
}
} catch (Throwable throwable) {
StdFileDialog.showCannotOpenMsg(this, PathUtils.getLeafName(path, true), throwable);
proxy = null;
}
} else {
Dockable dockable = (Dockable) proxy;
dockable.getDockContainer().setCurrentDockable(dockable);
}
if (proxy != null) {
File file = proxy.getBackingFile();
if (file != null) {
RecentFilesMenu.addRecent(file);
}
}
return proxy;
}