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


Java ISetSelectionTarget类代码示例

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


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

示例1: selectFileInCurrentView

import org.eclipse.ui.part.ISetSelectionTarget; //导入依赖的package包/类
protected void selectFileInCurrentView(final IFile file, IWorkbenchPage page) {
	final IWorkbenchPart activePart = page.getActivePart();
	
	if (activePart instanceof ISetSelectionTarget) {
		final ISelection targetSelection = new StructuredSelection(file);
		Shell shell = getShell();
		Display display = shell.getDisplay();
		
		Runnable runnable = new Runnable() {
			 public void run() {
				 ISetSelectionTarget setSelectionTarget = (ISetSelectionTarget) activePart;
				 setSelectionTarget.selectReveal(targetSelection);
			 }
		};
		 
		display.asyncExec(runnable);
	}
}
 
开发者ID:DarwinSPL,项目名称:DarwinSPL,代码行数:19,代码来源:DwFeatureModelWizard.java

示例2: run

import org.eclipse.ui.part.ISetSelectionTarget; //导入依赖的package包/类
/**
 * Run.
 *
 * @param workbench the workbench
 * @param shell the shell
 */
public void run(IWorkbench workbench, Shell shell) {
	// Select the new file resource in the current view
	IWorkbenchWindow workbenchWindow = workbench.getActiveWorkbenchWindow();
	IWorkbenchPage page = workbenchWindow.getActivePage();
	final IWorkbenchPart activePart = page.getActivePart();
	
	// Open an editor on the new file
	try {
		if (activePart instanceof ISetSelectionTarget) {
			final ISelection targetSelection = new StructuredSelection(traceFile);
			shell.getDisplay().asyncExec(new Runnable() {
				public void run() {
					((ISetSelectionTarget)activePart).selectReveal(targetSelection);
				}
			});
		}
		page.openEditor(new FileEditorInput(traceFile), workbench.getEditorRegistry().getDefaultEditor(traceFile.getFullPath().toString()).getId());					 	 
	}
	catch (PartInitException exception) {
		MessageDialog.openError(workbenchWindow.getShell(), "Error opening the editor.", exception.getMessage());
		logger.error("Error opening the editor.",exception);
	}
	
}
 
开发者ID:germanattanasio,项目名称:traceability-assistant-eclipse-plugins,代码行数:31,代码来源:OpenFileWithEditorCommand.java

示例3: openFile

import org.eclipse.ui.part.ISetSelectionTarget; //导入依赖的package包/类
private void openFile(final IFile file) {
	fDisplay.asyncExec(new Runnable() {
		public void run() {
			IWorkbenchWindow ww = PlatformUI.getWorkbench()
					.getActiveWorkbenchWindow();
			if (ww == null) {
				return;
			}
			IWorkbenchPage page = ww.getActivePage();
			if (page == null || !file.exists())
				return;
			IWorkbenchPart focusPart = page.getActivePart();
			if (focusPart instanceof ISetSelectionTarget) {
				ISelection selection = new StructuredSelection(file);
				((ISetSelectionTarget) focusPart).selectReveal(selection);
			}
			try {
				page.openEditor(new FileEditorInput(file), EDITOR_ID);
			} catch (PartInitException e) {
			}
		}
	});
}
 
开发者ID:tmseidel,项目名称:commandline-hero,代码行数:24,代码来源:NewProjectCreationOperation.java

示例4: selectReveal

import org.eclipse.ui.part.ISetSelectionTarget; //导入依赖的package包/类
/**
 * Select the given element in the view of the given id
 * 
 * @param element
 */
public static void selectReveal(Object element, String viewId) {
	IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
	// Select in the Project Explorer the generated files.
	IViewPart view = page.findView(viewId);
	if (view instanceof ISetSelectionTarget) {
		((ISetSelectionTarget) view).selectReveal(new StructuredSelection(element));
	}
}
 
开发者ID:angelozerr,项目名称:typescript.java,代码行数:14,代码来源:UIInterpreterHelper.java

示例5: run

import org.eclipse.ui.part.ISetSelectionTarget; //导入依赖的package包/类
public void run(IResource resource) {
	if (resource == null)
		return;
	try {
		IWorkbenchPage page= getSite().getWorkbenchWindow().getActivePage();
		IViewPart view= page.showView(JavaPlugin.ID_RES_NAV);
		if (view instanceof ISetSelectionTarget) {
			ISelection selection= new StructuredSelection(resource);
			((ISetSelectionTarget)view).selectReveal(selection);
		}
	} catch(PartInitException e) {
		ExceptionHandler.handle(e, getShell(), getDialogTitle(), ActionMessages.ShowInNavigatorView_error_activation_failed);
	}
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:15,代码来源:ShowInNavigatorViewAction.java

示例6: AddArchiveToBuildpathAction

import org.eclipse.ui.part.ISetSelectionTarget; //导入依赖的package包/类
private AddArchiveToBuildpathAction(IWorkbenchSite site, ISetSelectionTarget selectionTarget, IRunnableContext context) {
	super(site, selectionTarget, BuildpathModifierAction.ADD_LIB_TO_BP);

	fContext= context;

	setText(NewWizardMessages.NewSourceContainerWorkbookPage_ToolBar_AddJarCP_label);
	setImageDescriptor(JavaPluginImages.DESC_OBJS_EXTJAR);
	setToolTipText(NewWizardMessages.NewSourceContainerWorkbookPage_ToolBar_AddJarCP_tooltip);
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:10,代码来源:AddArchiveToBuildpathAction.java

示例7: ExcludeFromBuildpathAction

import org.eclipse.ui.part.ISetSelectionTarget; //导入依赖的package包/类
private ExcludeFromBuildpathAction(IWorkbenchSite site, ISetSelectionTarget selectionTarget, IRunnableContext context) {
	super(site, selectionTarget, BuildpathModifierAction.EXCLUDE);

	fContext= context;

	setText(NewWizardMessages.NewSourceContainerWorkbookPage_ToolBar_Exclude_label);
	setImageDescriptor(JavaPluginImages.DESC_ELCL_EXCLUDE_FROM_BUILDPATH);
	setToolTipText(NewWizardMessages.NewSourceContainerWorkbookPage_ToolBar_Exclude_tooltip);
	setDisabledImageDescriptor(JavaPluginImages.DESC_DLCL_EXCLUDE_FROM_BUILDPATH);
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:11,代码来源:ExcludeFromBuildpathAction.java

示例8: CreateLinkedSourceFolderAction

import org.eclipse.ui.part.ISetSelectionTarget; //导入依赖的package包/类
private CreateLinkedSourceFolderAction(IWorkbenchSite site, ISetSelectionTarget selectionTarget, IRunnableContext context) {
	super(site, selectionTarget, BuildpathModifierAction.CREATE_LINK);

	setText(NewWizardMessages.NewSourceContainerWorkbookPage_ToolBar_Link_label);
	setToolTipText(NewWizardMessages.NewSourceContainerWorkbookPage_ToolBar_Link_tooltip);
	setImageDescriptor(JavaPluginImages.DESC_ELCL_ADD_LINKED_SOURCE_TO_BUILDPATH);
	setDescription(NewWizardMessages.PackageExplorerActionGroup_FormText_createLinkedFolder);
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:9,代码来源:CreateLinkedSourceFolderAction.java

示例9: CreateSourceFolderAction

import org.eclipse.ui.part.ISetSelectionTarget; //导入依赖的package包/类
private CreateSourceFolderAction(IWorkbenchSite site, ISetSelectionTarget selectionTarget, IRunnableContext context) {
	super(site, selectionTarget, BuildpathModifierAction.CREATE_FOLDER);

	setText(ActionMessages.OpenNewSourceFolderWizardAction_text2);
	setDescription(ActionMessages.OpenNewSourceFolderWizardAction_description);
	setToolTipText(ActionMessages.OpenNewSourceFolderWizardAction_tooltip);
	setImageDescriptor(JavaPluginImages.DESC_TOOL_NEWPACKROOT);

	PlatformUI.getWorkbench().getHelpSystem().setHelp(this, IJavaHelpContextIds.OPEN_SOURCEFOLDER_WIZARD_ACTION);
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:11,代码来源:CreateSourceFolderAction.java

示例10: BuildpathModifierAction

import org.eclipse.ui.part.ISetSelectionTarget; //导入依赖的package包/类
public BuildpathModifierAction(IWorkbenchSite site, ISetSelectionTarget selectionTarget, int id, int style) {
super("", style); //$NON-NLS-1$

fSite= site;
fSelectionTarget= selectionTarget;
fSelectedElements= new ArrayList<Object>();
fListeners= new ArrayList<IBuildpathModifierListener>();

setId(Integer.toString(id));
  }
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:11,代码来源:BuildpathModifierAction.java

示例11: EditFilterAction

import org.eclipse.ui.part.ISetSelectionTarget; //导入依赖的package包/类
private EditFilterAction(IWorkbenchSite site, ISetSelectionTarget selectionTarget, IRunnableContext context) {
	super(site, selectionTarget, BuildpathModifierAction.EDIT_FILTERS);

	setText(NewWizardMessages.NewSourceContainerWorkbookPage_ToolBar_Edit_label);
	setImageDescriptor(JavaPluginImages.DESC_ELCL_CONFIGURE_BUILDPATH_FILTERS);
	setToolTipText(NewWizardMessages.NewSourceContainerWorkbookPage_ToolBar_Edit_tooltip);
	setDescription(NewWizardMessages.PackageExplorerActionGroup_FormText_Edit);
	setDisabledImageDescriptor(JavaPluginImages.DESC_DLCL_CONFIGURE_BUILDPATH_FILTERS);
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:10,代码来源:EditFilterAction.java

示例12: AddSelectedLibraryToBuildpathAction

import org.eclipse.ui.part.ISetSelectionTarget; //导入依赖的package包/类
private AddSelectedLibraryToBuildpathAction(IWorkbenchSite site, ISetSelectionTarget selectionTarget, IRunnableContext context) {
super(site, selectionTarget, BuildpathModifierAction.ADD_SEL_LIB_TO_BP);

fContext= context;

setText(NewWizardMessages.NewSourceContainerWorkbookPage_ToolBar_AddSelLibToCP_label);
setImageDescriptor(JavaPluginImages.DESC_OBJS_EXTJAR);
setToolTipText(NewWizardMessages.NewSourceContainerWorkbookPage_ToolBar_AddSelLibToCP_tooltip);
  }
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:10,代码来源:AddSelectedLibraryToBuildpathAction.java

示例13: AddFolderToBuildpathAction

import org.eclipse.ui.part.ISetSelectionTarget; //导入依赖的package包/类
private AddFolderToBuildpathAction(IWorkbenchSite site, ISetSelectionTarget selectionTarget, IRunnableContext context) {
	super(site, selectionTarget, BuildpathModifierAction.ADD_SEL_SF_TO_BP);

	fContext= context;

	setText(NewWizardMessages.NewSourceContainerWorkbookPage_ToolBar_AddSelSFToCP_label);
	setImageDescriptor(JavaPluginImages.DESC_ELCL_ADD_AS_SOURCE_FOLDER);
	setToolTipText(NewWizardMessages.NewSourceContainerWorkbookPage_ToolBar_AddSelSFToCP_tooltip);
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:10,代码来源:AddFolderToBuildpathAction.java

示例14: IncludeToBuildpathAction

import org.eclipse.ui.part.ISetSelectionTarget; //导入依赖的package包/类
private IncludeToBuildpathAction(IWorkbenchSite site, ISetSelectionTarget selectionTarget, IRunnableContext context) {
	super(site, selectionTarget, BuildpathModifierAction.INCLUDE);

	fContext= context;

	setText(NewWizardMessages.NewSourceContainerWorkbookPage_ToolBar_Unexclude_label);
	setImageDescriptor(JavaPluginImages.DESC_ELCL_INCLUDE_ON_BUILDPATH);
	setToolTipText(NewWizardMessages.NewSourceContainerWorkbookPage_ToolBar_Unexclude_tooltip);
	setDisabledImageDescriptor(JavaPluginImages.DESC_DLCL_INCLUDE_ON_BUILDPATH);
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:11,代码来源:IncludeToBuildpathAction.java

示例15: ResetAllOutputFoldersAction

import org.eclipse.ui.part.ISetSelectionTarget; //导入依赖的package包/类
public ResetAllOutputFoldersAction(IWorkbenchSite site, ISetSelectionTarget selectionTarget, IRunnableContext context, IJavaProject javaProject) {
super(site, selectionTarget, BuildpathModifierAction.RESET_ALL_OUTPUT_FOLDERS);

fContext= context;
fJavaProject= javaProject;

setText(NewWizardMessages.NewSourceContainerWorkbookPage_ToolBar_Reset_tooltip);
setToolTipText(NewWizardMessages.NewSourceContainerWorkbookPage_ToolBar_Reset_tooltip);
  }
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:10,代码来源:ResetAllOutputFoldersAction.java


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