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


Java WSEditor.close方法代码示例

本文整理汇总了Java中ro.sync.exml.workspace.api.editor.WSEditor.close方法的典型用法代码示例。如果您正苦于以下问题:Java WSEditor.close方法的具体用法?Java WSEditor.close怎么用?Java WSEditor.close使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ro.sync.exml.workspace.api.editor.WSEditor的用法示例。


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

示例1: checkIn

import ro.sync.exml.workspace.api.editor.WSEditor; //导入方法依赖的package包/类
static void checkIn(URL url) {
    BaseXSource source = CustomProtocolURLHandlerExtension.sourceFromURL(url);
    String path = CustomProtocolURLHandlerExtension.pathFromURL(url);
    try (Connection connection = BaseXConnectionWrapper.getConnection()) {
        if (connection.lockedByUser(source, path)) {
            WSEditor editorAccess = PluginWorkspaceProvider.getPluginWorkspace().
                    getEditorAccess(url, StandalonePluginWorkspace.MAIN_EDITING_AREA);
            ArgonEditorsWatchMap.getInstance().setAskedForCheckIn(url, true);
            if (editorAccess != null)
                editorAccess.close(true);
            connection.unlock(source, path);
        }
    } catch (IOException ex) {
        logger.debug(ex);
    }
}
 
开发者ID:axxepta,项目名称:project-argon,代码行数:17,代码来源:CheckInAction.java

示例2: actionPerformed

import ro.sync.exml.workspace.api.editor.WSEditor; //导入方法依赖的package包/类
@Override
public void actionPerformed(ActionEvent e) {
    ArgonChooserDialog urlChooser = new ArgonChooserDialog((Frame)workspace.getParentFrame(),
            Lang.get(Lang.Keys.dlg_saveas), ArgonChooserDialog.Type.SAVE);
    URL[] url =  urlChooser.selectURLs();

    WSEditor editorAccess = workspace.getCurrentEditorAccess(PluginWorkspace.MAIN_EDITING_AREA);

    if (url != null) {
        BaseXSource source = CustomProtocolURLHandlerExtension.sourceFromURL(url[0]);
        String path = CustomProtocolURLHandlerExtension.pathFromURL(url[0]);
        if (WorkspaceUtils.newResourceOrOverwrite(source, path)) {
            if (!ConnectionWrapper.isLocked(source, path)) {
                try {
                    WorkspaceUtils.setCursor(WorkspaceUtils.WAIT_CURSOR);
                    ConnectionWrapper.lock(source, path);
                    WorkspaceUtils.saveEditorToBaseXURL(editorAccess, url[0]);
                    editorAccess.close(false);
                    workspace.open(url[0]);
                    WorkspaceUtils.setCursor(WorkspaceUtils.DEFAULT_CURSOR);
                } catch (IOException ioe) {
                    WorkspaceUtils.setCursor(WorkspaceUtils.DEFAULT_CURSOR);
                    workspace.showErrorMessage(Lang.get(Lang.Keys.warn_resource) + " " + url[0].toString()
                            + " " + Lang.get(Lang.Keys.warn_storing) + ": " + ioe.getMessage());
                }
            } else {
                workspace.showInformationMessage(Lang.get(Lang.Keys.warn_resource) + " " + url[0].toString() +
                        " " + Lang.get(Lang.Keys.warn_locked));
            }
        }
    }
}
 
开发者ID:axxepta,项目名称:project-argon,代码行数:33,代码来源:SaveFileToArgonAction.java

示例3: getCloseAL

import ro.sync.exml.workspace.api.editor.WSEditor; //导入方法依赖的package包/类
public ActionListener getCloseAL(final int askForSave){
		return new ActionListener() {
			@Override
			public void actionPerformed(ActionEvent arg0) {
				for (EditorItem item : EditorPanel.this.getSelectedItem()) {
					if(!item.isClosed()){
						WSEditor wse = EditorPanel.this.spw.getEditorAccess(item.getEditorNode().getUrl(), StandalonePluginWorkspace.MAIN_EDITING_AREA);
						if(wse == null){
							continue;
						}
						switch (askForSave) {
						case CLOSE_WITH_SAVE:
							wse.save();
							wse.close(true);
							break;
						case CLOSE_WO_SAVE:
							wse.close(false);
							break;
						default:
							wse.close(true);
							break;
						}
					}
//					EditorPanel.this.spw.getEditorAccess(item.getEditorNode().getUrl(), 0).cl
				}
			}
		};
	}
 
开发者ID:nkutsche,项目名称:opendocs,代码行数:29,代码来源:EditorPanel.java


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