• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java IEditorMatchingStrategy类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: performSaveAs

import org.eclipse.ui.IEditorMatchingStrategy; //导入依赖的package包/类
/**
 * @generated
 */
protected void performSaveAs(IProgressMonitor progressMonitor) {
	Shell shell = getSite().getShell();
	IEditorInput input = getEditorInput();
	SaveAsDialog dialog = new SaveAsDialog(shell);
	IFile original = input instanceof IFileEditorInput ? ((IFileEditorInput) input)
			.getFile() : null;
	if (original != null) {
		dialog.setOriginalFile(original);
	}
	dialog.create();
	IDocumentProvider provider = getDocumentProvider();
	if (provider == null) {
		// editor has been programmatically closed while the dialog was open
		return;
	}
	if (provider.isDeleted(input) && original != null) {
		String message = NLS.bind(
				Messages.StatemachineDiagramEditor_SavingDeletedFile,
				original.getName());
		dialog.setErrorMessage(null);
		dialog.setMessage(message, IMessageProvider.WARNING);
	}
	if (dialog.open() == Window.CANCEL) {
		if (progressMonitor != null) {
			progressMonitor.setCanceled(true);
		}
		return;
	}
	IPath filePath = dialog.getResult();
	if (filePath == null) {
		if (progressMonitor != null) {
			progressMonitor.setCanceled(true);
		}
		return;
	}
	IWorkspaceRoot workspaceRoot = ResourcesPlugin.getWorkspace().getRoot();
	IFile file = workspaceRoot.getFile(filePath);
	final IEditorInput newInput = new FileEditorInput(file);
	// Check if the editor is already open
	IEditorMatchingStrategy matchingStrategy = getEditorDescriptor()
			.getEditorMatchingStrategy();
	IEditorReference[] editorRefs = PlatformUI.getWorkbench()
			.getActiveWorkbenchWindow().getActivePage()
			.getEditorReferences();
	for (int i = 0; i < editorRefs.length; i++) {
		if (matchingStrategy.matches(editorRefs[i], newInput)) {
			MessageDialog.openWarning(shell,
					Messages.StatemachineDiagramEditor_SaveAsErrorTitle,
					Messages.StatemachineDiagramEditor_SaveAsErrorMessage);
			return;
		}
	}
	boolean success = false;
	try {
		provider.aboutToChange(newInput);
		getDocumentProvider(newInput).saveDocument(progressMonitor,
				newInput,
				getDocumentProvider().getDocument(getEditorInput()), true);
		success = true;
	} catch (CoreException x) {
		IStatus status = x.getStatus();
		if (status == null || status.getSeverity() != IStatus.CANCEL) {
			ErrorDialog.openError(shell,
					Messages.StatemachineDiagramEditor_SaveErrorTitle,
					Messages.StatemachineDiagramEditor_SaveErrorMessage,
					x.getStatus());
		}
	} finally {
		provider.changed(newInput);
		if (success) {
			setInput(newInput);
		}
	}
	if (progressMonitor != null) {
		progressMonitor.setCanceled(!success);
	}
}
 
开发者ID:spoenemann,项目名称:xtext-gef,代码行数:81,代码来源:StatemachineDiagramEditor.java


示例2: performSaveAs

import org.eclipse.ui.IEditorMatchingStrategy; //导入依赖的package包/类
/**
 * @generated
 */
protected void performSaveAs(IProgressMonitor progressMonitor) {
	Shell shell = getSite().getShell();
	IEditorInput input = getEditorInput();
	SaveAsDialog dialog = new SaveAsDialog(shell);
	IFile original = input instanceof IFileEditorInput ? ((IFileEditorInput) input)
			.getFile()
			: null;
	if (original != null) {
		dialog.setOriginalFile(original);
	}
	dialog.create();
	IDocumentProvider provider = getDocumentProvider();
	if (provider == null) {
		// editor has been programmatically closed while the dialog was open
		return;
	}
	if (provider.isDeleted(input) && original != null) {
		String message = NLS.bind(
				Messages.SmcDiagramEditor_SavingDeletedFile, original
						.getName());
		dialog.setErrorMessage(null);
		dialog.setMessage(message, IMessageProvider.WARNING);
	}
	if (dialog.open() == Window.CANCEL) {
		if (progressMonitor != null) {
			progressMonitor.setCanceled(true);
		}
		return;
	}
	IPath filePath = dialog.getResult();
	if (filePath == null) {
		if (progressMonitor != null) {
			progressMonitor.setCanceled(true);
		}
		return;
	}
	IWorkspaceRoot workspaceRoot = ResourcesPlugin.getWorkspace().getRoot();
	IFile file = workspaceRoot.getFile(filePath);
	final IEditorInput newInput = new FileEditorInput(file);
	// Check if the editor is already open
	IEditorMatchingStrategy matchingStrategy = getEditorDescriptor()
			.getEditorMatchingStrategy();
	IEditorReference[] editorRefs = PlatformUI.getWorkbench()
			.getActiveWorkbenchWindow().getActivePage()
			.getEditorReferences();
	for (int i = 0; i < editorRefs.length; i++) {
		if (matchingStrategy.matches(editorRefs[i], newInput)) {
			MessageDialog.openWarning(shell,
					Messages.SmcDiagramEditor_SaveAsErrorTitle,
					Messages.SmcDiagramEditor_SaveAsErrorMessage);
			return;
		}
	}
	boolean success = false;
	try {
		provider.aboutToChange(newInput);
		getDocumentProvider(newInput).saveDocument(progressMonitor,
				newInput,
				getDocumentProvider().getDocument(getEditorInput()), true);
		success = true;
	} catch (CoreException x) {
		IStatus status = x.getStatus();
		if (status == null || status.getSeverity() != IStatus.CANCEL) {
			ErrorDialog.openError(shell,
					Messages.SmcDiagramEditor_SaveErrorTitle,
					Messages.SmcDiagramEditor_SaveErrorMessage, x
							.getStatus());
		}
	} finally {
		provider.changed(newInput);
		if (success) {
			setInput(newInput);
		}
	}
	if (progressMonitor != null) {
		progressMonitor.setCanceled(!success);
	}
}
 
开发者ID:road-framework,项目名称:ROADDesigner,代码行数:82,代码来源:SmcDiagramEditor.java


示例3: performSaveAs

import org.eclipse.ui.IEditorMatchingStrategy; //导入依赖的package包/类
/**
 * @generated
 */
protected void performSaveAs(IProgressMonitor progressMonitor) {
	Shell shell = getSite().getShell();
	IEditorInput input = getEditorInput();
	SaveAsDialog dialog = new SaveAsDialog(shell);
	IFile original = input instanceof IFileEditorInput ? ((IFileEditorInput) input)
			.getFile() : null;
	if (original != null) {
		dialog.setOriginalFile(original);
	}
	dialog.create();
	IDocumentProvider provider = getDocumentProvider();
	if (provider == null) {
		// editor has been programmatically closed while the dialog was open
		return;
	}
	if (provider.isDeleted(input) && original != null) {
		String message = NLS.bind(
				Messages.Wc2014DiagramEditor_SavingDeletedFile,
				original.getName());
		dialog.setErrorMessage(null);
		dialog.setMessage(message, IMessageProvider.WARNING);
	}
	if (dialog.open() == Window.CANCEL) {
		if (progressMonitor != null) {
			progressMonitor.setCanceled(true);
		}
		return;
	}
	IPath filePath = dialog.getResult();
	if (filePath == null) {
		if (progressMonitor != null) {
			progressMonitor.setCanceled(true);
		}
		return;
	}
	IWorkspaceRoot workspaceRoot = ResourcesPlugin.getWorkspace().getRoot();
	IFile file = workspaceRoot.getFile(filePath);
	final IEditorInput newInput = new FileEditorInput(file);
	// Check if the editor is already open
	IEditorMatchingStrategy matchingStrategy = getEditorDescriptor()
			.getEditorMatchingStrategy();
	IEditorReference[] editorRefs = PlatformUI.getWorkbench()
			.getActiveWorkbenchWindow().getActivePage()
			.getEditorReferences();
	for (int i = 0; i < editorRefs.length; i++) {
		if (matchingStrategy.matches(editorRefs[i], newInput)) {
			MessageDialog.openWarning(shell,
					Messages.Wc2014DiagramEditor_SaveAsErrorTitle,
					Messages.Wc2014DiagramEditor_SaveAsErrorMessage);
			return;
		}
	}
	boolean success = false;
	try {
		provider.aboutToChange(newInput);
		getDocumentProvider(newInput).saveDocument(progressMonitor,
				newInput,
				getDocumentProvider().getDocument(getEditorInput()), true);
		success = true;
	} catch (CoreException x) {
		IStatus status = x.getStatus();
		if (status == null || status.getSeverity() != IStatus.CANCEL) {
			ErrorDialog.openError(shell,
					Messages.Wc2014DiagramEditor_SaveErrorTitle,
					Messages.Wc2014DiagramEditor_SaveErrorMessage,
					x.getStatus());
		}
	} finally {
		provider.changed(newInput);
		if (success) {
			setInput(newInput);
		}
	}
	if (progressMonitor != null) {
		progressMonitor.setCanceled(!success);
	}
}
 
开发者ID:ggxx,项目名称:HelloBrazil,代码行数:81,代码来源:Wc2014DiagramEditor.java


示例4: performSaveAs

import org.eclipse.ui.IEditorMatchingStrategy; //导入依赖的package包/类
/**
* @generated
*/
protected void performSaveAs(IProgressMonitor progressMonitor) {
	Shell shell = getSite().getShell();
	IEditorInput input = getEditorInput();
	SaveAsDialog dialog = new SaveAsDialog(shell);
	IFile original = input instanceof IFileEditorInput ? ((IFileEditorInput) input).getFile() : null;
	if (original != null) {
		dialog.setOriginalFile(original);
	}
	dialog.create();
	IDocumentProvider provider = getDocumentProvider();
	if (provider == null) {
		// editor has been programmatically closed while the dialog was open
		return;
	}
	if (provider.isDeleted(input) && original != null) {
		String message = NLS.bind(
				edu.toronto.cs.se.modelepedia.icse15_sequencediagram_mavo.diagram.part.Messages.ICSE15_SequenceDiagram_MAVODiagramEditor_SavingDeletedFile,
				original.getName());
		dialog.setErrorMessage(null);
		dialog.setMessage(message, IMessageProvider.WARNING);
	}
	if (dialog.open() == Window.CANCEL) {
		if (progressMonitor != null) {
			progressMonitor.setCanceled(true);
		}
		return;
	}
	IPath filePath = dialog.getResult();
	if (filePath == null) {
		if (progressMonitor != null) {
			progressMonitor.setCanceled(true);
		}
		return;
	}
	IWorkspaceRoot workspaceRoot = ResourcesPlugin.getWorkspace().getRoot();
	IFile file = workspaceRoot.getFile(filePath);
	final IEditorInput newInput = new FileEditorInput(file);
	// Check if the editor is already open
	IEditorMatchingStrategy matchingStrategy = getEditorDescriptor().getEditorMatchingStrategy();
	IEditorReference[] editorRefs = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage()
			.getEditorReferences();
	for (int i = 0; i < editorRefs.length; i++) {
		if (matchingStrategy.matches(editorRefs[i], newInput)) {
			MessageDialog.openWarning(shell,
					edu.toronto.cs.se.modelepedia.icse15_sequencediagram_mavo.diagram.part.Messages.ICSE15_SequenceDiagram_MAVODiagramEditor_SaveAsErrorTitle,
					edu.toronto.cs.se.modelepedia.icse15_sequencediagram_mavo.diagram.part.Messages.ICSE15_SequenceDiagram_MAVODiagramEditor_SaveAsErrorMessage);
			return;
		}
	}
	boolean success = false;
	try {
		provider.aboutToChange(newInput);
		getDocumentProvider(newInput).saveDocument(progressMonitor, newInput,
				getDocumentProvider().getDocument(getEditorInput()), true);
		success = true;
	} catch (CoreException x) {
		IStatus status = x.getStatus();
		if (status == null || status.getSeverity() != IStatus.CANCEL) {
			ErrorDialog.openError(shell,
					edu.toronto.cs.se.modelepedia.icse15_sequencediagram_mavo.diagram.part.Messages.ICSE15_SequenceDiagram_MAVODiagramEditor_SaveErrorTitle,
					edu.toronto.cs.se.modelepedia.icse15_sequencediagram_mavo.diagram.part.Messages.ICSE15_SequenceDiagram_MAVODiagramEditor_SaveErrorMessage,
					x.getStatus());
		}
	} finally {
		provider.changed(newInput);
		if (success) {
			setInput(newInput);
		}
	}
	if (progressMonitor != null) {
		progressMonitor.setCanceled(!success);
	}
}
 
开发者ID:adisandro,项目名称:MMINT,代码行数:77,代码来源:ICSE15_SequenceDiagram_MAVODiagramEditor.java


示例5: performSaveAs

import org.eclipse.ui.IEditorMatchingStrategy; //导入依赖的package包/类
/**
 * @generated
 */
protected void performSaveAs(IProgressMonitor progressMonitor) {
	Shell shell = getSite().getShell();
	IEditorInput input = getEditorInput();
	SaveAsDialog dialog = new SaveAsDialog(shell);
	IFile original = input instanceof IFileEditorInput ? ((IFileEditorInput) input).getFile() : null;
	if (original != null) {
		dialog.setOriginalFile(original);
	}
	dialog.create();
	IDocumentProvider provider = getDocumentProvider();
	if (provider == null) {
		// editor has been programmatically closed while the dialog was open
		return;
	}
	if (provider.isDeleted(input) && original != null) {
		String message = NLS.bind(Messages.MIDDiagramEditor_SavingDeletedFile, original.getName());
		dialog.setErrorMessage(null);
		dialog.setMessage(message, IMessageProvider.WARNING);
	}
	if (dialog.open() == Window.CANCEL) {
		if (progressMonitor != null) {
			progressMonitor.setCanceled(true);
		}
		return;
	}
	IPath filePath = dialog.getResult();
	if (filePath == null) {
		if (progressMonitor != null) {
			progressMonitor.setCanceled(true);
		}
		return;
	}
	IWorkspaceRoot workspaceRoot = ResourcesPlugin.getWorkspace().getRoot();
	IFile file = workspaceRoot.getFile(filePath);
	final IEditorInput newInput = new FileEditorInput(file);
	// Check if the editor is already open
	IEditorMatchingStrategy matchingStrategy = getEditorDescriptor().getEditorMatchingStrategy();
	IEditorReference[] editorRefs = PlatformUI
		.getWorkbench()
		.getActiveWorkbenchWindow()
		.getActivePage()
		.getEditorReferences();
	for (int i = 0; i < editorRefs.length; i++) {
		if (matchingStrategy.matches(editorRefs[i], newInput)) {
			MessageDialog.openWarning(
				shell,
				Messages.MIDDiagramEditor_SaveAsErrorTitle,
				Messages.MIDDiagramEditor_SaveAsErrorMessage);
			return;
		}
	}
	boolean success = false;
	try {
		provider.aboutToChange(newInput);
		getDocumentProvider(newInput)
			.saveDocument(progressMonitor, newInput, getDocumentProvider().getDocument(getEditorInput()), true);
		success = true;
	}
	catch (CoreException x) {
		IStatus status = x.getStatus();
		if (status == null || status.getSeverity() != IStatus.CANCEL) {
			ErrorDialog.openError(
				shell,
				Messages.MIDDiagramEditor_SaveErrorTitle,
				Messages.MIDDiagramEditor_SaveErrorMessage,
				x.getStatus());
		}
	}
	finally {
		provider.changed(newInput);
		if (success) {
			setInput(newInput);
		}
	}
	if (progressMonitor != null) {
		progressMonitor.setCanceled(!success);
	}
}
 
开发者ID:adisandro,项目名称:MMINT,代码行数:82,代码来源:MIDDiagramEditor.java


示例6: performSaveAs

import org.eclipse.ui.IEditorMatchingStrategy; //导入依赖的package包/类
/**
* @generated
*/
protected void performSaveAs(IProgressMonitor progressMonitor) {
	Shell shell = getSite().getShell();
	IEditorInput input = getEditorInput();
	SaveAsDialog dialog = new SaveAsDialog(shell);
	IFile original = input instanceof IFileEditorInput ? ((IFileEditorInput) input).getFile() : null;
	if (original != null) {
		dialog.setOriginalFile(original);
	}
	dialog.create();
	IDocumentProvider provider = getDocumentProvider();
	if (provider == null) {
		// editor has been programmatically closed while the dialog was open
		return;
	}
	if (provider.isDeleted(input) && original != null) {
		String message = NLS.bind(Messages.MIDDiagramEditor_SavingDeletedFile, original.getName());
		dialog.setErrorMessage(null);
		dialog.setMessage(message, IMessageProvider.WARNING);
	}
	if (dialog.open() == Window.CANCEL) {
		if (progressMonitor != null) {
			progressMonitor.setCanceled(true);
		}
		return;
	}
	IPath filePath = dialog.getResult();
	if (filePath == null) {
		if (progressMonitor != null) {
			progressMonitor.setCanceled(true);
		}
		return;
	}
	IWorkspaceRoot workspaceRoot = ResourcesPlugin.getWorkspace().getRoot();
	IFile file = workspaceRoot.getFile(filePath);
	final IEditorInput newInput = new FileEditorInput(file);
	// Check if the editor is already open
	IEditorMatchingStrategy matchingStrategy = getEditorDescriptor().getEditorMatchingStrategy();
	IEditorReference[] editorRefs = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage()
			.getEditorReferences();
	for (int i = 0; i < editorRefs.length; i++) {
		if (matchingStrategy.matches(editorRefs[i], newInput)) {
			MessageDialog.openWarning(shell, Messages.MIDDiagramEditor_SaveAsErrorTitle,
					Messages.MIDDiagramEditor_SaveAsErrorMessage);
			return;
		}
	}
	boolean success = false;
	try {
		provider.aboutToChange(newInput);
		getDocumentProvider(newInput).saveDocument(progressMonitor, newInput,
				getDocumentProvider().getDocument(getEditorInput()), true);
		success = true;
	} catch (CoreException x) {
		IStatus status = x.getStatus();
		if (status == null || status.getSeverity() != IStatus.CANCEL) {
			ErrorDialog.openError(shell, Messages.MIDDiagramEditor_SaveErrorTitle,
					Messages.MIDDiagramEditor_SaveErrorMessage, x.getStatus());
		}
	} finally {
		provider.changed(newInput);
		if (success) {
			setInput(newInput);
		}
	}
	if (progressMonitor != null) {
		progressMonitor.setCanceled(!success);
	}
}
 
开发者ID:adisandro,项目名称:MMINT,代码行数:72,代码来源:MIDDiagramEditor.java


示例7: performSaveAs

import org.eclipse.ui.IEditorMatchingStrategy; //导入依赖的package包/类
/**
* @generated
*/
protected void performSaveAs(IProgressMonitor progressMonitor) {
	Shell shell = getSite().getShell();
	IEditorInput input = getEditorInput();
	SaveAsDialog dialog = new SaveAsDialog(shell);
	IFile original = input instanceof IFileEditorInput ? ((IFileEditorInput) input).getFile() : null;
	if (original != null) {
		dialog.setOriginalFile(original);
	}
	dialog.create();
	IDocumentProvider provider = getDocumentProvider();
	if (provider == null) {
		// editor has been programmatically closed while the dialog was open
		return;
	}
	if (provider.isDeleted(input) && original != null) {
		String message = NLS.bind(
				edu.toronto.cs.se.modelepedia.relationaldatabase_mavo.diagram.part.Messages.RelationalDatabase_MAVODiagramEditor_SavingDeletedFile,
				original.getName());
		dialog.setErrorMessage(null);
		dialog.setMessage(message, IMessageProvider.WARNING);
	}
	if (dialog.open() == Window.CANCEL) {
		if (progressMonitor != null) {
			progressMonitor.setCanceled(true);
		}
		return;
	}
	IPath filePath = dialog.getResult();
	if (filePath == null) {
		if (progressMonitor != null) {
			progressMonitor.setCanceled(true);
		}
		return;
	}
	IWorkspaceRoot workspaceRoot = ResourcesPlugin.getWorkspace().getRoot();
	IFile file = workspaceRoot.getFile(filePath);
	final IEditorInput newInput = new FileEditorInput(file);
	// Check if the editor is already open
	IEditorMatchingStrategy matchingStrategy = getEditorDescriptor().getEditorMatchingStrategy();
	IEditorReference[] editorRefs = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage()
			.getEditorReferences();
	for (int i = 0; i < editorRefs.length; i++) {
		if (matchingStrategy.matches(editorRefs[i], newInput)) {
			MessageDialog.openWarning(shell,
					edu.toronto.cs.se.modelepedia.relationaldatabase_mavo.diagram.part.Messages.RelationalDatabase_MAVODiagramEditor_SaveAsErrorTitle,
					edu.toronto.cs.se.modelepedia.relationaldatabase_mavo.diagram.part.Messages.RelationalDatabase_MAVODiagramEditor_SaveAsErrorMessage);
			return;
		}
	}
	boolean success = false;
	try {
		provider.aboutToChange(newInput);
		getDocumentProvider(newInput).saveDocument(progressMonitor, newInput,
				getDocumentProvider().getDocument(getEditorInput()), true);
		success = true;
	} catch (CoreException x) {
		IStatus status = x.getStatus();
		if (status == null || status.getSeverity() != IStatus.CANCEL) {
			ErrorDialog.openError(shell,
					edu.toronto.cs.se.modelepedia.relationaldatabase_mavo.diagram.part.Messages.RelationalDatabase_MAVODiagramEditor_SaveErrorTitle,
					edu.toronto.cs.se.modelepedia.relationaldatabase_mavo.diagram.part.Messages.RelationalDatabase_MAVODiagramEditor_SaveErrorMessage,
					x.getStatus());
		}
	} finally {
		provider.changed(newInput);
		if (success) {
			setInput(newInput);
		}
	}
	if (progressMonitor != null) {
		progressMonitor.setCanceled(!success);
	}
}
 
开发者ID:adisandro,项目名称:MMINT,代码行数:77,代码来源:RelationalDatabase_MAVODiagramEditor.java


示例8: performSaveAs

import org.eclipse.ui.IEditorMatchingStrategy; //导入依赖的package包/类
/**
* @generated
*/
protected void performSaveAs(IProgressMonitor progressMonitor) {
	Shell shell = getSite().getShell();
	IEditorInput input = getEditorInput();
	SaveAsDialog dialog = new SaveAsDialog(shell);
	IFile original = input instanceof IFileEditorInput ? ((IFileEditorInput) input).getFile() : null;
	if (original != null) {
		dialog.setOriginalFile(original);
	}
	dialog.create();
	IDocumentProvider provider = getDocumentProvider();
	if (provider == null) {
		// editor has been programmatically closed while the dialog was open
		return;
	}
	if (provider.isDeleted(input) && original != null) {
		String message = NLS.bind(
				edu.toronto.cs.se.modelepedia.istar_mavo.diagram.part.Messages.IStar_MAVODiagramEditor_SavingDeletedFile,
				original.getName());
		dialog.setErrorMessage(null);
		dialog.setMessage(message, IMessageProvider.WARNING);
	}
	if (dialog.open() == Window.CANCEL) {
		if (progressMonitor != null) {
			progressMonitor.setCanceled(true);
		}
		return;
	}
	IPath filePath = dialog.getResult();
	if (filePath == null) {
		if (progressMonitor != null) {
			progressMonitor.setCanceled(true);
		}
		return;
	}
	IWorkspaceRoot workspaceRoot = ResourcesPlugin.getWorkspace().getRoot();
	IFile file = workspaceRoot.getFile(filePath);
	final IEditorInput newInput = new FileEditorInput(file);
	// Check if the editor is already open
	IEditorMatchingStrategy matchingStrategy = getEditorDescriptor().getEditorMatchingStrategy();
	IEditorReference[] editorRefs = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage()
			.getEditorReferences();
	for (int i = 0; i < editorRefs.length; i++) {
		if (matchingStrategy.matches(editorRefs[i], newInput)) {
			MessageDialog.openWarning(shell,
					edu.toronto.cs.se.modelepedia.istar_mavo.diagram.part.Messages.IStar_MAVODiagramEditor_SaveAsErrorTitle,
					edu.toronto.cs.se.modelepedia.istar_mavo.diagram.part.Messages.IStar_MAVODiagramEditor_SaveAsErrorMessage);
			return;
		}
	}
	boolean success = false;
	try {
		provider.aboutToChange(newInput);
		getDocumentProvider(newInput).saveDocument(progressMonitor, newInput,
				getDocumentProvider().getDocument(getEditorInput()), true);
		success = true;
	} catch (CoreException x) {
		IStatus status = x.getStatus();
		if (status == null || status.getSeverity() != IStatus.CANCEL) {
			ErrorDialog.openError(shell,
					edu.toronto.cs.se.modelepedia.istar_mavo.diagram.part.Messages.IStar_MAVODiagramEditor_SaveErrorTitle,
					edu.toronto.cs.se.modelepedia.istar_mavo.diagram.part.Messages.IStar_MAVODiagramEditor_SaveErrorMessage,
					x.getStatus());
		}
	} finally {
		provider.changed(newInput);
		if (success) {
			setInput(newInput);
		}
	}
	if (progressMonitor != null) {
		progressMonitor.setCanceled(!success);
	}
}
 
开发者ID:adisandro,项目名称:MMINT,代码行数:77,代码来源:IStar_MAVODiagramEditor.java


示例9: performSaveAs

import org.eclipse.ui.IEditorMatchingStrategy; //导入依赖的package包/类
/**
 * @generated
 */
protected void performSaveAs(IProgressMonitor progressMonitor) {
	Shell shell = getSite().getShell();
	IEditorInput input = getEditorInput();
	SaveAsDialog dialog = new SaveAsDialog(shell);
	IFile original = input instanceof IFileEditorInput ? ((IFileEditorInput) input)
			.getFile() : null;
	if (original != null) {
		dialog.setOriginalFile(original);
	}
	dialog.create();
	IDocumentProvider provider = getDocumentProvider();
	if (provider == null) {
		// editor has been programmatically closed while the dialog was open
		return;
	}
	if (provider.isDeleted(input) && original != null) {
		String message = NLS.bind(
				Messages.IStarDiagramEditor_SavingDeletedFile,
				original.getName());
		dialog.setErrorMessage(null);
		dialog.setMessage(message, IMessageProvider.WARNING);
	}
	if (dialog.open() == Window.CANCEL) {
		if (progressMonitor != null) {
			progressMonitor.setCanceled(true);
		}
		return;
	}
	IPath filePath = dialog.getResult();
	if (filePath == null) {
		if (progressMonitor != null) {
			progressMonitor.setCanceled(true);
		}
		return;
	}
	IWorkspaceRoot workspaceRoot = ResourcesPlugin.getWorkspace().getRoot();
	IFile file = workspaceRoot.getFile(filePath);
	final IEditorInput newInput = new FileEditorInput(file);
	// Check if the editor is already open
	IEditorMatchingStrategy matchingStrategy = getEditorDescriptor()
			.getEditorMatchingStrategy();
	IEditorReference[] editorRefs = PlatformUI.getWorkbench()
			.getActiveWorkbenchWindow().getActivePage()
			.getEditorReferences();
	for (int i = 0; i < editorRefs.length; i++) {
		if (matchingStrategy.matches(editorRefs[i], newInput)) {
			MessageDialog.openWarning(shell,
					Messages.IStarDiagramEditor_SaveAsErrorTitle,
					Messages.IStarDiagramEditor_SaveAsErrorMessage);
			return;
		}
	}
	boolean success = false;
	try {
		provider.aboutToChange(newInput);
		getDocumentProvider(newInput).saveDocument(progressMonitor,
				newInput,
				getDocumentProvider().getDocument(getEditorInput()), true);
		success = true;
	} catch (CoreException x) {
		IStatus status = x.getStatus();
		if (status == null || status.getSeverity() != IStatus.CANCEL) {
			ErrorDialog.openError(shell,
					Messages.IStarDiagramEditor_SaveErrorTitle,
					Messages.IStarDiagramEditor_SaveErrorMessage,
					x.getStatus());
		}
	} finally {
		provider.changed(newInput);
		if (success) {
			setInput(newInput);
		}
	}
	if (progressMonitor != null) {
		progressMonitor.setCanceled(!success);
	}
}
 
开发者ID:adisandro,项目名称:MMINT,代码行数:81,代码来源:IStarDiagramEditor.java


示例10: performSaveAs

import org.eclipse.ui.IEditorMatchingStrategy; //导入依赖的package包/类
/**
 * @generated
 */
protected void performSaveAs(IProgressMonitor progressMonitor) {
	Shell shell = getSite().getShell();
	IEditorInput input = getEditorInput();
	SaveAsDialog dialog = new SaveAsDialog(shell);
	IFile original = input instanceof IFileEditorInput ? ((IFileEditorInput) input)
			.getFile() : null;
	if (original != null) {
		dialog.setOriginalFile(original);
	}
	dialog.create();
	IDocumentProvider provider = getDocumentProvider();
	if (provider == null) {
		// editor has been programmatically closed while the dialog was open
		return;
	}
	if (provider.isDeleted(input) && original != null) {
		String message = NLS.bind(
				Messages.StateMachineDiagramEditor_SavingDeletedFile,
				original.getName());
		dialog.setErrorMessage(null);
		dialog.setMessage(message, IMessageProvider.WARNING);
	}
	if (dialog.open() == Window.CANCEL) {
		if (progressMonitor != null) {
			progressMonitor.setCanceled(true);
		}
		return;
	}
	IPath filePath = dialog.getResult();
	if (filePath == null) {
		if (progressMonitor != null) {
			progressMonitor.setCanceled(true);
		}
		return;
	}
	IWorkspaceRoot workspaceRoot = ResourcesPlugin.getWorkspace().getRoot();
	IFile file = workspaceRoot.getFile(filePath);
	final IEditorInput newInput = new FileEditorInput(file);
	// Check if the editor is already open
	IEditorMatchingStrategy matchingStrategy = getEditorDescriptor()
			.getEditorMatchingStrategy();
	IEditorReference[] editorRefs = PlatformUI.getWorkbench()
			.getActiveWorkbenchWindow().getActivePage()
			.getEditorReferences();
	for (int i = 0; i < editorRefs.length; i++) {
		if (matchingStrategy.matches(editorRefs[i], newInput)) {
			MessageDialog.openWarning(shell,
					Messages.StateMachineDiagramEditor_SaveAsErrorTitle,
					Messages.StateMachineDiagramEditor_SaveAsErrorMessage);
			return;
		}
	}
	boolean success = false;
	try {
		provider.aboutToChange(newInput);
		getDocumentProvider(newInput).saveDocument(progressMonitor,
				newInput,
				getDocumentProvider().getDocument(getEditorInput()), true);
		success = true;
	} catch (CoreException x) {
		IStatus status = x.getStatus();
		if (status == null || status.getSeverity() != IStatus.CANCEL) {
			ErrorDialog.openError(shell,
					Messages.StateMachineDiagramEditor_SaveErrorTitle,
					Messages.StateMachineDiagramEditor_SaveErrorMessage,
					x.getStatus());
		}
	} finally {
		provider.changed(newInput);
		if (success) {
			setInput(newInput);
		}
	}
	if (progressMonitor != null) {
		progressMonitor.setCanceled(!success);
	}
}
 
开发者ID:adisandro,项目名称:MMINT,代码行数:81,代码来源:StateMachineDiagramEditor.java


示例11: performSaveAs

import org.eclipse.ui.IEditorMatchingStrategy; //导入依赖的package包/类
/**
* @generated
*/
protected void performSaveAs(IProgressMonitor progressMonitor) {
	Shell shell = getSite().getShell();
	IEditorInput input = getEditorInput();
	SaveAsDialog dialog = new SaveAsDialog(shell);
	IFile original = input instanceof IFileEditorInput ? ((IFileEditorInput) input).getFile() : null;
	if (original != null) {
		dialog.setOriginalFile(original);
	}
	dialog.create();
	IDocumentProvider provider = getDocumentProvider();
	if (provider == null) {
		// editor has been programmatically closed while the dialog was open
		return;
	}
	if (provider.isDeleted(input) && original != null) {
		String message = NLS.bind(
				edu.toronto.cs.se.modelepedia.statemachine_mavo.diagram.part.Messages.StateMachine_MAVODiagramEditor_SavingDeletedFile,
				original.getName());
		dialog.setErrorMessage(null);
		dialog.setMessage(message, IMessageProvider.WARNING);
	}
	if (dialog.open() == Window.CANCEL) {
		if (progressMonitor != null) {
			progressMonitor.setCanceled(true);
		}
		return;
	}
	IPath filePath = dialog.getResult();
	if (filePath == null) {
		if (progressMonitor != null) {
			progressMonitor.setCanceled(true);
		}
		return;
	}
	IWorkspaceRoot workspaceRoot = ResourcesPlugin.getWorkspace().getRoot();
	IFile file = workspaceRoot.getFile(filePath);
	final IEditorInput newInput = new FileEditorInput(file);
	// Check if the editor is already open
	IEditorMatchingStrategy matchingStrategy = getEditorDescriptor().getEditorMatchingStrategy();
	IEditorReference[] editorRefs = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage()
			.getEditorReferences();
	for (int i = 0; i < editorRefs.length; i++) {
		if (matchingStrategy.matches(editorRefs[i], newInput)) {
			MessageDialog.openWarning(shell,
					edu.toronto.cs.se.modelepedia.statemachine_mavo.diagram.part.Messages.StateMachine_MAVODiagramEditor_SaveAsErrorTitle,
					edu.toronto.cs.se.modelepedia.statemachine_mavo.diagram.part.Messages.StateMachine_MAVODiagramEditor_SaveAsErrorMessage);
			return;
		}
	}
	boolean success = false;
	try {
		provider.aboutToChange(newInput);
		getDocumentProvider(newInput).saveDocument(progressMonitor, newInput,
				getDocumentProvider().getDocument(getEditorInput()), true);
		success = true;
	} catch (CoreException x) {
		IStatus status = x.getStatus();
		if (status == null || status.getSeverity() != IStatus.CANCEL) {
			ErrorDialog.openError(shell,
					edu.toronto.cs.se.modelepedia.statemachine_mavo.diagram.part.Messages.StateMachine_MAVODiagramEditor_SaveErrorTitle,
					edu.toronto.cs.se.modelepedia.statemachine_mavo.diagram.part.Messages.StateMachine_MAVODiagramEditor_SaveErrorMessage,
					x.getStatus());
		}
	} finally {
		provider.changed(newInput);
		if (success) {
			setInput(newInput);
		}
	}
	if (progressMonitor != null) {
		progressMonitor.setCanceled(!success);
	}
}
 
开发者ID:adisandro,项目名称:MMINT,代码行数:77,代码来源:StateMachine_MAVODiagramEditor.java


示例12: performSaveAs

import org.eclipse.ui.IEditorMatchingStrategy; //导入依赖的package包/类
/**
 * @generated
 */
protected void performSaveAs(IProgressMonitor progressMonitor) {
	Shell shell = getSite().getShell();
	IEditorInput input = getEditorInput();
	SaveAsDialog dialog = new SaveAsDialog(shell);
	IFile original = input instanceof IFileEditorInput ? ((IFileEditorInput) input)
			.getFile() : null;
	if (original != null) {
		dialog.setOriginalFile(original);
	}
	dialog.create();
	IDocumentProvider provider = getDocumentProvider();
	if (provider == null) {
		// editor has been programmatically closed while the dialog was open
		return;
	}
	if (provider.isDeleted(input) && original != null) {
		String message = NLS.bind(
				Messages.StateDiagramEditor_SavingDeletedFile,
				original.getName());
		dialog.setErrorMessage(null);
		dialog.setMessage(message, IMessageProvider.WARNING);
	}
	if (dialog.open() == Window.CANCEL) {
		if (progressMonitor != null) {
			progressMonitor.setCanceled(true);
		}
		return;
	}
	IPath filePath = dialog.getResult();
	if (filePath == null) {
		if (progressMonitor != null) {
			progressMonitor.setCanceled(true);
		}
		return;
	}
	IWorkspaceRoot workspaceRoot = ResourcesPlugin.getWorkspace().getRoot();
	IFile file = workspaceRoot.getFile(filePath);
	final IEditorInput newInput = new FileEditorInput(file);
	// Check if the editor is already open
	IEditorMatchingStrategy matchingStrategy = getEditorDescriptor()
			.getEditorMatchingStrategy();
	IEditorReference[] editorRefs = PlatformUI.getWorkbench()
			.getActiveWorkbenchWindow().getActivePage()
			.getEditorReferences();
	for (int i = 0; i < editorRefs.length; i++) {
		if (matchingStrategy.matches(editorRefs[i], newInput)) {
			MessageDialog.openWarning(shell,
					Messages.StateDiagramEditor_SaveAsErrorTitle,
					Messages.StateDiagramEditor_SaveAsErrorMessage);
			return;
		}
	}
	boolean success = false;
	try {
		provider.aboutToChange(newInput);
		getDocumentProvider(newInput).saveDocument(progressMonitor,
				newInput,
				getDocumentProvider().getDocument(getEditorInput()), true);
		success = true;
	} catch (CoreException x) {
		IStatus status = x.getStatus();
		if (status == null || status.getSeverity() != IStatus.CANCEL) {
			ErrorDialog.openError(shell,
					Messages.StateDiagramEditor_SaveErrorTitle,
					Messages.StateDiagramEditor_SaveErrorMessage,
					x.getStatus());
		}
	} finally {
		provider.changed(newInput);
		if (success) {
			setInput(newInput);
		}
	}
	if (progressMonitor != null) {
		progressMonitor.setCanceled(!success);
	}
}
 
开发者ID:adisandro,项目名称:MMINT,代码行数:81,代码来源:StateDiagramEditor.java


示例13: performSaveAs

import org.eclipse.ui.IEditorMatchingStrategy; //导入依赖的package包/类
/**
 * @generated
 */
protected void performSaveAs(IProgressMonitor progressMonitor) {
	Shell shell = getSite().getShell();
	IEditorInput input = getEditorInput();
	SaveAsDialog dialog = new SaveAsDialog(shell);
	IFile original = input instanceof IFileEditorInput ? ((IFileEditorInput) input)
			.getFile() : null;
	if (original != null) {
		dialog.setOriginalFile(original);
	}
	dialog.create();
	IDocumentProvider provider = getDocumentProvider();
	if (provider == null) {
		// editor has been programmatically closed while the dialog was open
		return;
	}
	if (provider.isDeleted(input) && original != null) {
		String message = NLS.bind(
				Messages.ArmyDiagramEditor_SavingDeletedFile,
				original.getName());
		dialog.setErrorMessage(null);
		dialog.setMessage(message, IMessageProvider.WARNING);
	}
	if (dialog.open() == Window.CANCEL) {
		if (progressMonitor != null) {
			progressMonitor.setCanceled(true);
		}
		return;
	}
	IPath filePath = dialog.getResult();
	if (filePath == null) {
		if (progressMonitor != null) {
			progressMonitor.setCanceled(true);
		}
		return;
	}
	IWorkspaceRoot workspaceRoot = ResourcesPlugin.getWorkspace().getRoot();
	IFile file = workspaceRoot.getFile(filePath);
	final IEditorInput newInput = new FileEditorInput(file);
	// Check if the editor is already open
	IEditorMatchingStrategy matchingStrategy = getEditorDescriptor()
			.getEditorMatchingStrategy();
	IEditorReference[] editorRefs = PlatformUI.getWorkbench()
			.getActiveWorkbenchWindow().getActivePage()
			.getEditorReferences();
	for (int i = 0; i < editorRefs.length; i++) {
		if (matchingStrategy.matches(editorRefs[i], newInput)) {
			MessageDialog.openWarning(shell,
					Messages.ArmyDiagramEditor_SaveAsErrorTitle,
					Messages.ArmyDiagramEditor_SaveAsErrorMessage);
			return;
		}
	}
	boolean success = false;
	try {
		provider.aboutToChange(newInput);
		getDocumentProvider(newInput).saveDocument(progressMonitor,
				newInput,
				getDocumentProvider().getDocument(getEditorInput()), true);
		success = true;
	} catch (CoreException x) {
		IStatus status = x.getStatus();
		if (status == null || status.getSeverity() != IStatus.CANCEL) {
			ErrorDialog.openError(shell,
					Messages.ArmyDiagramEditor_SaveErrorTitle,
					Messages.ArmyDiagramEditor_SaveErrorMessage,
					x.getStatus());
		}
	} finally {
		provider.changed(newInput);
		if (success) {
			setInput(newInput);
		}
	}
	if (progressMonitor != null) {
		progressMonitor.setCanceled(!success);
	}
}
 
开发者ID:adisandro,项目名称:MMINT,代码行数:81,代码来源:ArmyDiagramEditor.java


示例14: performSaveAs

import org.eclipse.ui.IEditorMatchingStrategy; //导入依赖的package包/类
/**
 * @generated
 */
protected void performSaveAs(IProgressMonitor progressMonitor) {
	Shell shell = getSite().getShell();
	IEditorInput input = getEditorInput();
	SaveAsDialog dialog = new SaveAsDialog(shell);
	IFile original = input instanceof IFileEditorInput ? ((IFileEditorInput) input)
			.getFile() : null;
	if (original != null) {
		dialog.setOriginalFile(original);
	}
	dialog.create();
	IDocumentProvider provider = getDocumentProvider();
	if (provider == null) {
		// editor has been programmatically closed while the dialog was open
		return;
	}
	if (provider.isDeleted(input) && original != null) {
		String message = NLS.bind(
				Messages.EconomyDiagramEditor_SavingDeletedFile,
				original.getName());
		dialog.setErrorMessage(null);
		dialog.setMessage(message, IMessageProvider.WARNING);
	}
	if (dialog.open() == Window.CANCEL) {
		if (progressMonitor != null) {
			progressMonitor.setCanceled(true);
		}
		return;
	}
	IPath filePath = dialog.getResult();
	if (filePath == null) {
		if (progressMonitor != null) {
			progressMonitor.setCanceled(true);
		}
		return;
	}
	IWorkspaceRoot workspaceRoot = ResourcesPlugin.getWorkspace().getRoot();
	IFile file = workspaceRoot.getFile(filePath);
	final IEditorInput newInput = new FileEditorInput(file);
	// Check if the editor is already open
	IEditorMatchingStrategy matchingStrategy = getEditorDescriptor()
			.getEditorMatchingStrategy();
	IEditorReference[] editorRefs = PlatformUI.getWorkbench()
			.getActiveWorkbenchWindow().getActivePage()
			.getEditorReferences();
	for (int i = 0; i < editorRefs.length; i++) {
		if (matchingStrategy.matches(editorRefs[i], newInput)) {
			MessageDialog.openWarning(shell,
					Messages.EconomyDiagramEditor_SaveAsErrorTitle,
					Messages.EconomyDiagramEditor_SaveAsErrorMessage);
			return;
		}
	}
	boolean success = false;
	try {
		provider.aboutToChange(newInput);
		getDocumentProvider(newInput).saveDocument(progressMonitor,
				newInput,
				getDocumentProvider().getDocument(getEditorInput()), true);
		success = true;
	} catch (CoreException x) {
		IStatus status = x.getStatus();
		if (status == null || status.getSeverity() != IStatus.CANCEL) {
			ErrorDialog.openError(shell,
					Messages.EconomyDiagramEditor_SaveErrorTitle,
					Messages.EconomyDiagramEditor_SaveErrorMessage,
					x.getStatus());
		}
	} finally {
		provider.changed(newInput);
		if (success) {
			setInput(newInput);
		}
	}
	if (progressMonitor != null) {
		progressMonitor.setCanceled(!success);
	}
}
 
开发者ID:adisandro,项目名称:MMINT,代码行数:81,代码来源:EconomyDiagramEditor.java


示例15: performSaveAs

import org.eclipse.ui.IEditorMatchingStrategy; //导入依赖的package包/类
/**
* @generated
*/
protected void performSaveAs(IProgressMonitor progressMonitor) {
	Shell shell = getSite().getShell();
	IEditorInput input = getEditorInput();
	SaveAsDialog dialog = new SaveAsDialog(shell);
	IFile original = input instanceof IFileEditorInput ? ((IFileEditorInput) input).getFile() : null;
	if (original != null) {
		dialog.setOriginalFile(original);
	}
	dialog.create();
	IDocumentProvider provider = getDocumentProvider();
	if (provider == null) {
		// editor has been programmatically closed while the dialog was open
		return;
	}
	if (provider.isDeleted(input) && original != null) {
		String message = NLS.bind(Messages.ClassDiagramDiagramEditor_SavingDeletedFile, original.getName());
		dialog.setErrorMessage(null);
		dialog.setMessage(message, IMessageProvider.WARNING);
	}
	if (dialog.open() == Window.CANCEL) {
		if (progressMonitor != null) {
			progressMonitor.setCanceled(true);
		}
		return;
	}
	IPath filePath = dialog.getResult();
	if (filePath == null) {
		if (progressMonitor != null) {
			progressMonitor.setCanceled(true);
		}
		return;
	}
	IWorkspaceRoot workspaceRoot = ResourcesPlugin.getWorkspace().getRoot();
	IFile file = workspaceRoot.getFile(filePath);
	final IEditorInput newInput = new FileEditorInput(file);
	// Check if the editor is already open
	IEditorMatchingStrategy matchingStrategy = getEditorDescriptor().getEditorMatchingStrategy();
	IEditorReference[] editorRefs = PlatformUI
		.getWorkbench()
		.getActiveWorkbenchWindow()
		.getActivePage()
		.getEditorReferences();
	for (int i = 0; i < editorRefs.length; i++) {
		if (matchingStrategy.matches(editorRefs[i], newInput)) {
			MessageDialog.openWarning(
				shell,
				Messages.ClassDiagramDiagramEditor_SaveAsErrorTitle,
				Messages.ClassDiagramDiagramEditor_SaveAsErrorMessage);
			return;
		}
	}
	boolean success = false;
	try {
		provider.aboutToChange(newInput);
		getDocumentProvider(newInput)
			.saveDocument(progressMonitor, newInput, getDocumentProvider().getDocument(getEditorInput()), true);
		success = true;
	}
	catch (CoreException x) {
		IStatus status = x.getStatus();
		if (status == null || status.getSeverity() != IStatus.CANCEL) {
			ErrorDialog.openError(
				shell,
				Messages.ClassDiagramDiagramEditor_SaveErrorTitle,
				Messages.ClassDiagramDiagramEditor_SaveErrorMessage,
				x.getStatus());
		}
	}
	finally {
		provider.changed(newInput);
		if (success) {
			setInput(newInput);
		}
	}
	if (progressMonitor != null) {
		progressMonitor.setCanceled(!success);
	}
}
 
开发者ID:adisandro,项目名称:MMINT,代码行数:82,代码来源:ClassDiagramDiagramEditor.java


示例16: performSaveAs

import org.eclipse.ui.IEditorMatchingStrategy; //导入依赖的package包/类
/**
* @generated
*/
protected void performSaveAs(IProgressMonitor progressMonitor) {
	Shell shell = getSite().getShell();
	IEditorInput input = getEditorInput();
	SaveAsDialog dialog = new SaveAsDialog(shell);
	IFile original = input instanceof IFileEditorInput ? ((IFileEditorInput) input).getFile() : null;
	if (original != null) {
		dialog.setOriginalFile(original);
	}
	dialog.create();
	IDocumentProvider provider = getDocumentProvider();
	if (provider == null) {
		// editor has been programmatically closed while the dialog was open
		return;
	}
	if (provider.isDeleted(input) && original != null) {
		String message = NLS.bind(
				edu.toronto.cs.se.modelepedia.classdiagram_mavo.diagram.part.Messages.ClassDiagram_MAVODiagramEditor_SavingDeletedFile,
				original.getName());
		dialog.setErrorMessage(null);
		dialog.setMessage(message, IMessageProvider.WARNING);
	}
	if (dialog.open() == Window.CANCEL) {
		if (progressMonitor != null) {
			progressMonitor.setCanceled(true);
		}
		return;
	}
	IPath filePath = dialog.getResult();
	if (filePath == null) {
		if (progressMonitor != null) {
			progressMonitor.setCanceled(true);
		}
		return;
	}
	IWorkspaceRoot workspaceRoot = ResourcesPlugin.getWorkspace().getRoot();
	IFile file = workspaceRoot.getFile(filePath);
	final IEditorInput newInput = new FileEditorInput(file);
	// Check if the editor is already open
	IEditorMatchingStrategy matchingStrategy = getEditorDescriptor().getEditorMatchingStrategy();
	IEditorReference[] editorRefs = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage()
			.getEditorReferences();
	for (int i = 0; i < editorRefs 

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java TrustManagerUtils类代码示例发布时间:2022-05-22
下一篇:
Java ReportedBlockInfo类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap