Java 类org.eclipse.gef.ui.parts.GraphicalEditorWithFlyoutPalette 实例源码

项目:Open_Source_ECOA_Toolset_AS5    文件:ExportImageAction.java   
@Override
public void run() {
    if (part instanceof GraphicalEditorWithFlyoutPalette) {
        GraphicalEditorWithFlyoutPalette edPart = (GraphicalEditorWithFlyoutPalette) part;
        ImageSaveUtil.save(edPart, getViewer(edPart));
    }
}
项目:Open_Source_ECOA_Toolset_AS5    文件:ExportImageAction.java   
private GraphicalViewer getViewer(GraphicalEditorWithFlyoutPalette edPart) {
    if (edPart instanceof InitAssemblyEditor) {
        return ((InitAssemblyEditor) edPart).getViewer();
    } else if (edPart instanceof IntFinalAssemblyEditor) {
        return ((IntFinalAssemblyEditor) edPart).getViewer();
    } else if (edPart instanceof IntLogicalSysEditor) {
        return ((IntLogicalSysEditor) edPart).getViewer();
    } else if (edPart instanceof IntDeploymentEditor) {
        return ((IntDeploymentEditor) edPart).getViewer();
    } else if (edPart instanceof CompImplEditor) {
        return ((CompImplEditor) edPart).getViewer();
    }
    return null;
}
项目:Open_Source_ECOA_Toolset_AS5    文件:ExportAction.java   
@Override
public void run() {
    if (part instanceof GraphicalEditorWithFlyoutPalette) {
        GraphicalEditorWithFlyoutPalette edPart = (GraphicalEditorWithFlyoutPalette) part;
        ExportCommand cmd = new ExportCommand(containerName, getFileName(edPart), getFileType(edPart), getContent(edPart));
        execute(cmd);
    }
}
项目:Open_Source_ECOA_Toolset_AS5    文件:ExportAction.java   
private String getContent(GraphicalEditorWithFlyoutPalette edPart) {
    try {
        FileEditorInput inp = (FileEditorInput) edPart.getEditorInput();
        String path = inp.getFile().getLocation().toOSString();
        String text = FileUtils.readFileToString(new File(path));
        return text;
    } catch (Exception e) {
        EclipseUtil.writeStactTraceToConsole(e);
    }
    return null;
}
项目:Open_Source_ECOA_Toolset_AS5    文件:ExportAction.java   
private String getFileType(GraphicalEditorWithFlyoutPalette edPart) {
    if (edPart instanceof InitAssemblyEditor) {
        return "assmbl";
    } else if (edPart instanceof IntFinalAssemblyEditor) {
        return "fassmbl";
    } else if (edPart instanceof IntLogicalSysEditor) {
        return "lsys";
    } else if (edPart instanceof IntDeploymentEditor) {
        return "deploy";
    } else if (edPart instanceof CompImplEditor) {
        return "cimpl";
    }
    return null;
}
项目:Open_Source_ECOA_Toolset_AS5    文件:ExportAction.java   
private String getFileName(GraphicalEditorWithFlyoutPalette edPart) {
    FileEditorInput inp = (FileEditorInput) edPart.getEditorInput();
    return inp.getFile().getLocation().toOSString();
}