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


Java ProjectExplorer类代码示例

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


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

示例1: gotoBookmark

import org.eclipse.ui.navigator.resources.ProjectExplorer; //导入依赖的package包/类
@Override
public boolean gotoBookmark(IWorkbenchWindow window, Bookmark bookmark, IBookmarkLocation bookmarkLocation) {
	if (!(bookmarkLocation instanceof WorkspaceFolderBookmarkLocation)) {
		return false;
	}
	WorkspaceFolderBookmarkLocation workspaceFileBookmarkLocation = (WorkspaceFolderBookmarkLocation) bookmarkLocation;
	IFolder folder = workspaceFileBookmarkLocation.getWorkspaceFolder();
	try {
		ProjectExplorer projectExplorer = (ProjectExplorer) PlatformUI.getWorkbench().getActiveWorkbenchWindow()
				.getActivePage().showView(ProjectExplorer.VIEW_ID);
		projectExplorer.selectReveal(new StructuredSelection(folder));
		return true;
	} catch (PartInitException e) {
		return false;
	}
}
 
开发者ID:cchabanois,项目名称:mesfavoris,代码行数:17,代码来源:GotoWorkspaceFolderBookmark.java

示例2: TabbedPropertySheetTitleProvider

import org.eclipse.ui.navigator.resources.ProjectExplorer; //导入依赖的package包/类
/**
 * Constructor for CommonNavigatorTitleProvider.
 */
public TabbedPropertySheetTitleProvider() {
	super();
	IWorkbenchPart part = PlatformUI.getWorkbench()
			.getActiveWorkbenchWindow().getActivePage().findView(ProjectExplorer.VIEW_ID);

	INavigatorContentService contentService = (INavigatorContentService) part
			.getAdapter(INavigatorContentService.class);

	if (contentService != null) {
		labelProvider = contentService.createCommonLabelProvider();
		descriptionProvider = contentService
				.createCommonDescriptionProvider();
	} else {
		WorkbenchNavigatorPlugin.log(
				"Could not acquire INavigatorContentService from part (\"" //$NON-NLS-1$
						+ part.getTitle() + "\").", null); //$NON-NLS-1$
	}
}
 
开发者ID:heartsome,项目名称:translationstudio8,代码行数:22,代码来源:TabbedPropertySheetTitleProvider.java

示例3: setUp

import org.eclipse.ui.navigator.resources.ProjectExplorer; //导入依赖的package包/类
@Override
@Before
public void setUp() throws Exception {
	super.setUp();
	waitForIdleState();
	projectExplorer = (ProjectExplorer) showView(ProjectExplorer.VIEW_ID);
	waitForUiThread();
	assertNotNull("Cannot show Project Explorer.", projectExplorer);
	commonViewer = projectExplorer.getCommonViewer();
	assertFalse("Expected projects as top level elements in navigator.", broker.isWorkingSetTopLevel());
	assertNull(
			"Select working set drop down contribution was visible when projects are configured as top level elements.",
			getWorkingSetDropDownContribution());

}
 
开发者ID:eclipse,项目名称:n4js,代码行数:16,代码来源:GHOLD_101_WorkingSetsTest_PluginUITest.java

示例4: setUp

import org.eclipse.ui.navigator.resources.ProjectExplorer; //导入依赖的package包/类
@Override
@Before
public void setUp() throws Exception {
	super.setUp();
	waitForIdleState();
	projectExplorer = (ProjectExplorer) showView(ProjectExplorer.VIEW_ID);
	waitForUiThread();
	assertNotNull("Cannot show Project Explorer.", projectExplorer);
	commonViewer = projectExplorer.getCommonViewer();
	assertFalse("Expected projects as top level elements in navigator.", broker.isWorkingSetTopLevel());
	assertNull(
			"Select working set drop down contribution was visible when projects are configured as top level elements.",
			getWorkingSetDropDownContribution());

	final Multimap<ProjectType, String> typeNamesMapping = HashMultimap.create();

	typeNamesMapping.putAll(LIBRARY, LIBRARY_PROJECTS);
	typeNamesMapping.putAll(TEST, TEST_PROJECTS);
	for (final Entry<ProjectType, Collection<String>> entry : typeNamesMapping.asMap().entrySet()) {
		for (final String projectName : entry.getValue()) {
			createN4JSProject(projectName, entry.getKey());
		}
	}

	// Actually close "Closed*" projects
	closeProject("ClosedL2");
	closeProject("ClosedT2");

	// Wait for workbench to reflect project changes
	waitForIdleState();
	commonViewer.refresh();

	// Disable auto-building, as there is no real code to build involved
	ResourcesPlugin.getWorkspace().getDescription().setAutoBuilding(false);
}
 
开发者ID:eclipse,项目名称:n4js,代码行数:36,代码来源:SelectAllProjectExplorer_PluginUITest.java

示例5: asyncRefreshCommonViewer

import org.eclipse.ui.navigator.resources.ProjectExplorer; //导入依赖的package包/类
private void asyncRefreshCommonViewer(final ProjectExplorer explorer, final boolean resetInput) {

		// do deferred initialization
		this.getWorkingSetManagers().stream()
				.filter(m -> (m instanceof IDeferredInitializer))
				.map(m -> (IDeferredInitializer) m)
				.filter(m -> m.isInitializationRequired())
				.forEach(m -> {
					m.lateInit();
				});

		final CommonViewer viewer = explorer.getCommonViewer();
		final Display d = getDisplay();
		if (!d.isDisposed()) {
			if (resetInput) {
				d.asyncExec(() -> {
					if (!viewer.getTree().isDisposed())
						viewer.setInput(viewer.getInput());
				});
			} else {
				d.asyncExec(() -> {
					if (!viewer.getTree().isDisposed())
						viewer.refresh(true);
				});
			}
		}
	}
 
开发者ID:eclipse,项目名称:n4js,代码行数:28,代码来源:WorkingSetManagerBrokerImpl.java

示例6: refreshProjectExp

import org.eclipse.ui.navigator.resources.ProjectExplorer; //导入依赖的package包/类
/**
 * This method refresh Project Explorer View when the actions (Mark/Mark All/Delete/Delete All)
 * have been completed.
 *
 */
public static void refreshProjectExp() {
  try {
    ResourcesPlugin.getWorkspace().getRoot().refreshLocal(IResource.DEPTH_INFINITE, null);
    final IViewPart viewPart = PlatformUI.getWorkbench().getWorkbenchWindows()[0].getActivePage()
        .findView("org.eclipse.ui.navigator.ProjectExplorer");
    if (viewPart == null) {
      return;
    }
    ((ProjectExplorer) viewPart).getCommonViewer().refresh();
  } catch (final CoreException e) {
    e.printStackTrace();
  }
}
 
开发者ID:ModelWriter,项目名称:Tarski,代码行数:19,代码来源:MarkerFactory.java

示例7: bind

import org.eclipse.ui.navigator.resources.ProjectExplorer; //导入依赖的package包/类
/**
 * Binds all controls in an IWorkbenchPartReference that is
 * an instance of IEditorPartReference to their appropriate
 * gaze handlers if the handler exists.
 * Binds the IWorkbenchPartReference that is an instance of
 * IViewPartReference to the appropriate gaze handler if the
 * handler exists.
 * @param partRef Workbench part from which to get controls.
 */
public static void bind(IWorkbenchPartReference partRef) {
    IWorkbenchPart part = partRef.getPart(true);
    Control control = part.getAdapter(Control.class);
    System.out.println(control);
    //is an EditorPart
    if (control != null) {
    	bindControl(partRef, control, false);
    //is a ViewPart
    } else {
    	//must be handled on a case to case basis
    	
    	//Browser - always look through all controls in the shell for browsers and bind them
    	//regardless of the partRef that has become visible
    	//not possible to get a Browser control from a partRef
    	Shell workbenchShell = partRef.getPage().getWorkbenchWindow().getShell();
    	for (Control ctrl : workbenchShell.getChildren()) {
    		bind(ctrl); //call recursive helper function to find all browser controls
    	}
    	
    	//Project Explorer
    	if (part.getAdapter(ProjectExplorer.class) != null) {
    		ProjectExplorer explorer = part.getAdapter(ProjectExplorer.class);
    		//this control is the primary control associated with a ProjectExplorer
    		Control viewControl = explorer.getCommonViewer().getControl();
    		bindControl(partRef, viewControl, false);
    	}
    }
}
 
开发者ID:SERESLab,项目名称:iTrace-Archive,代码行数:38,代码来源:HandlerBindManager.java

示例8: unbind

import org.eclipse.ui.navigator.resources.ProjectExplorer; //导入依赖的package包/类
/**
 * Unbinds all controls in an IWorkbenchPartReference that is an instance
 * of IEditorPartReference which are currently bound to a gaze handler.
 * Unbinds an IWorkbenchPartReference that is an instance of IViewPartReference
 * which is currently bound to a gaze handler.
 * @param partRef Workbench part from which to get controls.
 */
public static void unbind(IWorkbenchPartReference partRef) {
	IWorkbenchPart part = partRef.getPart(true);
    Control control = part.getAdapter(Control.class);
    
    //is an EditorPart
    if (control != null) {
    	bindControl(partRef, control, true);
    //is a ViewPart
    } else {
    	//must be handled on a case to case basis
    	
    	//Browser - always look through all controls in the shell for browsers and unbind them
    	//regardless of the partRef that has been hidden
    	//not possible to get Browser control from a partRef
    	Shell workbenchShell = partRef.getPage().getWorkbenchWindow().getShell();
    	for (Control ctrl : workbenchShell.getChildren()) {
    		unbind(ctrl);
    	}
    	
    	//Project Explorer
    	if (part.getAdapter(ProjectExplorer.class) != null) {
    		ProjectExplorer explorer = part.getAdapter(ProjectExplorer.class);
    		//this control is the primary control associated with a ProjectExplorer
    		Control viewControl = explorer.getCommonViewer().getControl();
    		bindControl(partRef, viewControl, true);
    	}
    }
}
 
开发者ID:SERESLab,项目名称:iTrace-Archive,代码行数:36,代码来源:HandlerBindManager.java

示例9: getAdapter

import org.eclipse.ui.navigator.resources.ProjectExplorer; //导入依赖的package包/类
/**
 * @generated
 */
@SuppressWarnings("rawtypes")
public Object getAdapter(Class type) {
	if (type == IShowInTargetList.class) {
		return new IShowInTargetList() {
			public String[] getShowInTargetIds() {
				return new String[] { ProjectExplorer.VIEW_ID };
			}
		};
	}
	return super.getAdapter(type);
}
 
开发者ID:spoenemann,项目名称:xtext-gef,代码行数:15,代码来源:StatemachineDiagramEditor.java

示例10: getAdapter

import org.eclipse.ui.navigator.resources.ProjectExplorer; //导入依赖的package包/类
public Object getAdapter(Object adaptableObject, Class adapterType) {
    if (adaptableObject instanceof ProjectExplorer) {
    	if (IPropertySheetPage.class == adapterType)
            return new TabbedPropertySheetPage(
                new TabbedPropertySheetProjectExplorerContributor(
                    (CommonNavigator) adaptableObject));
    }
    return null;
}
 
开发者ID:heartsome,项目名称:translationstudio8,代码行数:10,代码来源:TabbedPropertySheetAdapterFactory.java

示例11: getChildren

import org.eclipse.ui.navigator.resources.ProjectExplorer; //导入依赖的package包/类
public Object[] getChildren(Object parentElement) {
	if (parentElement instanceof IWorkingSet) {
		IWorkingSet workingSet = (IWorkingSet) parentElement;
		if (workingSet.isAggregateWorkingSet() && projectExplorer != null) {
			switch (projectExplorer.getRootMode()) {
				case ProjectExplorer.WORKING_SETS :
					return ((IAggregateWorkingSet) workingSet).getComponents();
				case ProjectExplorer.PROJECTS :
					return getWorkingSetElements(workingSet);
			}
		}
		return getWorkingSetElements(workingSet);
	}
	return NO_CHILDREN;
}
 
开发者ID:heartsome,项目名称:translationstudio8,代码行数:16,代码来源:WorkingSetsContentProvider.java

示例12: updateRootMode

import org.eclipse.ui.navigator.resources.ProjectExplorer; //导入依赖的package包/类
private void updateRootMode() {
	if (projectExplorer == null) {
		return;
	}
	if( extensionStateModel.getBooleanProperty(SHOW_TOP_LEVEL_WORKING_SETS) )
		projectExplorer.setRootMode(ProjectExplorer.WORKING_SETS);
	else
		projectExplorer.setRootMode(ProjectExplorer.PROJECTS);
}
 
开发者ID:heartsome,项目名称:translationstudio8,代码行数:10,代码来源:WorkingSetsContentProvider.java

示例13: getAdapter

import org.eclipse.ui.navigator.resources.ProjectExplorer; //导入依赖的package包/类
/**
 * @generated
 */
public Object getAdapter(Class type) {
	if (type == IShowInTargetList.class) {
		return new IShowInTargetList() {
			public String[] getShowInTargetIds() {
				return new String[] { ProjectExplorer.VIEW_ID };
			}
		};
	}
	return super.getAdapter(type);
}
 
开发者ID:road-framework,项目名称:ROADDesigner,代码行数:14,代码来源:SmcDiagramEditor.java

示例14: getAdapterGen

import org.eclipse.ui.navigator.resources.ProjectExplorer; //导入依赖的package包/类
/**
 * @generated
 */
@SuppressWarnings("rawtypes")
public Object getAdapterGen(Class type) {
	if (type == IShowInTargetList.class) {
		return new IShowInTargetList() {
			public String[] getShowInTargetIds() {
				return new String[] { ProjectExplorer.VIEW_ID };
			}
		};
	}
	return super.getAdapter(type);
}
 
开发者ID:adisandro,项目名称:MMINT,代码行数:15,代码来源:MIDDiagramEditor.java

示例15: getAdapter

import org.eclipse.ui.navigator.resources.ProjectExplorer; //导入依赖的package包/类
/**
 * @generated
 */
public Object getAdapter(Class type) {
    if (type == IShowInTargetList.class) {
        return new IShowInTargetList() {
            public String[] getShowInTargetIds() {
                return new String[] { ProjectExplorer.VIEW_ID };
            }
        };
    }
    return super.getAdapter(type);
}
 
开发者ID:d-case,项目名称:d-case_editor,代码行数:14,代码来源:DcaseDiagramEditor.java


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