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


Java IEditorPart.doSave方法代码示例

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


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

示例1: doSave

import org.eclipse.ui.IEditorPart; //导入方法依赖的package包/类
@Override
public void doSave(final IProgressMonitor monitor) {
  final IEditorPart editor = this.getActiveEditor();
  if (editor instanceof KodKodEditor) {
    editor.doSave(monitor);
  } else {
    // do nothing
  }
}
 
开发者ID:ModelWriter,项目名称:Tarski,代码行数:10,代码来源:RelationModelEditor.java

示例2: doSave

import org.eclipse.ui.IEditorPart; //导入方法依赖的package包/类
@Override
public void doSave(final IProgressMonitor monitor) {
  final IEditorPart editor = this.getActiveEditor();
  if (editor instanceof Editor) {
    editor.doSave(monitor);
  } else {
    // do nothing
  }
}
 
开发者ID:ModelWriter,项目名称:Tarski,代码行数:10,代码来源:MetaModelEditor.java

示例3: execute

import org.eclipse.ui.IEditorPart; //导入方法依赖的package包/类
@Override
public Object execute(final ExecutionEvent event) throws ExecutionException {
  final String filePath = getFilePath();
  if (filePath == null) {
    return null;
  }

  final IEditorPart editor = Activator.getDefault().getWorkbench().getActiveWorkbenchWindow()
      .getActivePage().getActiveEditor();;

  if (editor == null) {
    return null;
  }

  if (editor.isDirty()) {
    final IFile file = ResourceUtil.getFile(editor.getEditorInput());
    final MessageDialog warningdialog =
        new MessageDialog(MarkerActivator.getShell(), "Save Specification", null,
            file.getName()
                + " has been modified. You must save file for update the specification. Do you want to save now?",
            MessageDialog.WARNING, new String[] {"Yes", "No"}, 0);
    if (warningdialog.open() != 0) {
      return null;
    }

    AlloyOtherSolutionReasoning.getInstance().finish();
    editor.doSave(new NullProgressMonitor());
  }

  final String content = getContent(filePath);
  if (content == null) {
    return null;
  }

  AlloyUtilities.updateSpec(filePath, content);

  try {
    TraceManager.get().loadSpec(filePath);
  } catch (final TraceException e) {
    e.printStackTrace();
  }

  final MessageDialog dialog = new MessageDialog(MarkerActivator.getShell(), "Status Information",
      null, "Specification has been updated.", MessageDialog.INFORMATION, new String[] {"OK"}, 0);
  dialog.open();

  return null;
}
 
开发者ID:ModelWriter,项目名称:Tarski,代码行数:49,代码来源:UpdateSpecificationHandler.java


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