当前位置: 首页>>代码示例>>Java>>正文


Java FileProxy类代码示例

本文整理汇总了Java中com.trollworks.toolkit.utility.FileProxy的典型用法代码示例。如果您正苦于以下问题:Java FileProxy类的具体用法?Java FileProxy怎么用?Java FileProxy使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


FileProxy类属于com.trollworks.toolkit.utility包,在下文中一共展示了FileProxy类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getDockableFor

import com.trollworks.toolkit.utility.FileProxy; //导入依赖的package包/类
public Dockable getDockableFor(Path path) {
    for (Dockable dockable : getDockContainer().getDock().getDockables()) {
        if (dockable instanceof FileProxy) {
            File file = ((FileProxy) dockable).getBackingFile();
            if (file != null) {
                try {
                    if (Files.isSameFile(path, file.toPath())) {
                        return dockable;
                    }
                } catch (IOException ioe) {
                    Log.error(ioe);
                }
            }
        }
    }
    return null;
}
 
开发者ID:richardwilkes,项目名称:gcs,代码行数:18,代码来源:LibraryExplorerDockable.java

示例2: openLibrary

import com.trollworks.toolkit.utility.FileProxy; //导入依赖的package包/类
private FileProxy openLibrary(Path path) throws IOException {
    FileProxy proxy = null;
    LibraryFile library = new LibraryFile(path.toFile());
    SpellList spells = library.getSpellList();
    if (!spells.isEmpty()) {
        spells.setModified(true);
        proxy = dockLibrary(new SpellsDockable(spells));
    }
    SkillList skills = library.getSkillList();
    if (!skills.isEmpty()) {
        skills.setModified(true);
        proxy = dockLibrary(new SkillsDockable(skills));
    }
    EquipmentList equipment = library.getEquipmentList();
    if (!equipment.isEmpty()) {
        equipment.setModified(true);
        proxy = dockLibrary(new EquipmentDockable(equipment));
    }
    AdvantageList adq = library.getAdvantageList();
    if (!adq.isEmpty()) {
        adq.setModified(true);
        proxy = dockLibrary(new AdvantagesDockable(adq));
    }
    return proxy;
}
 
开发者ID:richardwilkes,项目名称:gcs,代码行数:26,代码来源:LibraryExplorerDockable.java

示例3: create

import com.trollworks.toolkit.utility.FileProxy; //导入依赖的package包/类
@Override
public FileProxy create(File file) throws IOException {
    LibraryExplorerDockable library = LibraryExplorerDockable.get();
    if (library != null) {
        FileProxy proxy = library.open(file.toPath());
        proxy.toFrontAndFocus();
        return proxy;
    }
    return null;
}
 
开发者ID:richardwilkes,项目名称:gcs,代码行数:11,代码来源:GCSFileProxyCreator.java

示例4: run

import com.trollworks.toolkit.utility.FileProxy; //导入依赖的package包/类
@Override
public void run() {
	FileProxy proxy = AppWindow.findFileProxy(mFile);
	if (proxy != null) {
		PrintCommand.print(proxy.getPrintProxy());
	} else if (System.currentTimeMillis() - mStart < TimeUnit.MILLISECONDS.convert(2, TimeUnit.MINUTES)) {
		EventQueue.invokeLater(this);
	}
}
 
开发者ID:Ayutac,项目名称:toolkit,代码行数:10,代码来源:PrintCommand.java

示例5: open

import com.trollworks.toolkit.utility.FileProxy; //导入依赖的package包/类
/** @param file The file to open. */
public static void open(File file) {
	if (file != null) {
		try {
			String name = file.getName();
			FileProxy proxy = AppWindow.findFileProxy(file);
			if (proxy == null) {
				for (FileType type : FileType.getOpenable()) {
					if (name.matches(StdFileDialog.createExtensionMatcher(type.getExtension()))) {
						proxy = type.getFileProxyCreator().create(file);
						break;
					}
				}
			} else {
				proxy.toFrontAndFocus();
			}
			if (proxy != null) {
				RecentFilesMenu.addRecent(file);
			} else {
				throw new IOException("Unknown file extension"); //$NON-NLS-1$
			}
		} catch (Exception exception) {
			Log.error(exception);
			StdFileDialog.showCannotOpenMsg(getFocusOwner(), file.getName(), exception);
		}
	}
}
 
开发者ID:Ayutac,项目名称:toolkit,代码行数:28,代码来源:OpenCommand.java

示例6: open

import com.trollworks.toolkit.utility.FileProxy; //导入依赖的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;
}
 
开发者ID:richardwilkes,项目名称:gcs,代码行数:51,代码来源:LibraryExplorerDockable.java

示例7: openAdvantageList

import com.trollworks.toolkit.utility.FileProxy; //导入依赖的package包/类
private FileProxy openAdvantageList(Path path) throws IOException {
    AdvantageList list = new AdvantageList();
    list.load(path.toFile());
    list.getModel().setLocked(true);
    return dockLibrary(new AdvantagesDockable(list));
}
 
开发者ID:richardwilkes,项目名称:gcs,代码行数:7,代码来源:LibraryExplorerDockable.java

示例8: openEquipmentList

import com.trollworks.toolkit.utility.FileProxy; //导入依赖的package包/类
private FileProxy openEquipmentList(Path path) throws IOException {
    EquipmentList list = new EquipmentList();
    list.load(path.toFile());
    list.getModel().setLocked(true);
    return dockLibrary(new EquipmentDockable(list));
}
 
开发者ID:richardwilkes,项目名称:gcs,代码行数:7,代码来源:LibraryExplorerDockable.java

示例9: openSkillList

import com.trollworks.toolkit.utility.FileProxy; //导入依赖的package包/类
private FileProxy openSkillList(Path path) throws IOException {
    SkillList list = new SkillList();
    list.load(path.toFile());
    list.getModel().setLocked(true);
    return dockLibrary(new SkillsDockable(list));
}
 
开发者ID:richardwilkes,项目名称:gcs,代码行数:7,代码来源:LibraryExplorerDockable.java

示例10: openSpellList

import com.trollworks.toolkit.utility.FileProxy; //导入依赖的package包/类
private FileProxy openSpellList(Path path) throws IOException {
    SpellList list = new SpellList();
    list.load(path.toFile());
    list.getModel().setLocked(true);
    return dockLibrary(new SpellsDockable(list));
}
 
开发者ID:richardwilkes,项目名称:gcs,代码行数:7,代码来源:LibraryExplorerDockable.java


注:本文中的com.trollworks.toolkit.utility.FileProxy类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。