本文整理匯總了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;
}