當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。