org.eclipse.ui.navigator.resources.ProjectExplorer Java Examples

The following examples show how to use org.eclipse.ui.navigator.resources.ProjectExplorer. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: TabbedPropertySheetTitleProvider.java    From translationstudio8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * 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$
	}
}
 
Example #2
Source File: TabbedPropertySheetTitleProvider.java    From tmxeditor8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * 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$
	}
}
 
Example #3
Source File: ProcessDiagramEditor.java    From bonita-studio with GNU General Public License v2.0 6 votes vote down vote up
/**
 * @generated BonitaSoft
 */
public Object getAdapter(Class type) {
	if (type == IShowInTargetList.class) {
		return new IShowInTargetList() {
			public String[] getShowInTargetIds() {
				return new String[] { ProjectExplorer.VIEW_ID };
			}
		};
	}

	if (type == IContentOutlinePage.class) {

		TreeViewer viewer = new TreeViewer();
		viewer.setRootEditPart(new DiagramRootTreeEditPart());
		outlinePage = new DiagramOutlinePage(viewer);
		return outlinePage;
	}

	return super.getAdapter(type);
}
 
Example #4
Source File: GHOLD_101_WorkingSetsTest_PluginUITest.java    From n4js with Eclipse Public License 1.0 5 votes vote down vote up
/***/
@Before
public void setUp2() throws Exception {
	waitForIdleState();
	projectExplorer = (ProjectExplorer) EclipseUIUtils.showView(ProjectExplorer.VIEW_ID);
	UIUtils.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());

}
 
Example #5
Source File: SelectAllProjectExplorer_PluginUITest.java    From n4js with Eclipse Public License 1.0 5 votes vote down vote up
/***/
@Before
public void setUp2() throws Exception {
	waitForIdleState();
	projectExplorer = (ProjectExplorer) EclipseUIUtils.showView(ProjectExplorer.VIEW_ID);
	UIUtils.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);
	new WorkspaceModifyOperation() {
		@Override
		protected void execute(IProgressMonitor monitor)
				throws CoreException, InvocationTargetException, InterruptedException {
			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");
		}
	}.run(new NullProgressMonitor());

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

	// Disable auto-building, as there is no real code to build involved
	wasAutobuilding = IResourcesSetupUtil.setAutobuild(false);
}
 
Example #6
Source File: CrossflowDiagramEditor.java    From scava with Eclipse Public License 2.0 5 votes vote down vote up
/**
 * @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);
}
 
Example #7
Source File: TabbedPropertySheetAdapterFactory.java    From translationstudio8 with GNU General Public License v2.0 5 votes vote down vote up
public Object getAdapter(Object adaptableObject, Class adapterType) {
    if (adaptableObject instanceof ProjectExplorer) {
    	if (IPropertySheetPage.class == adapterType)
            return new TabbedPropertySheetPage(
                new TabbedPropertySheetProjectExplorerContributor(
                    (CommonNavigator) adaptableObject));
    }
    return null;
}
 
Example #8
Source File: WorkingSetsContentProvider.java    From translationstudio8 with GNU General Public License v2.0 5 votes vote down vote up
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;
}
 
Example #9
Source File: WorkingSetsContentProvider.java    From translationstudio8 with GNU General Public License v2.0 5 votes vote down vote up
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);
}
 
Example #10
Source File: TabbedPropertySheetAdapterFactory.java    From tmxeditor8 with GNU General Public License v2.0 5 votes vote down vote up
public Object getAdapter(Object adaptableObject, Class adapterType) {
    if (adaptableObject instanceof ProjectExplorer) {
    	if (IPropertySheetPage.class == adapterType)
            return new TabbedPropertySheetPage(
                new TabbedPropertySheetProjectExplorerContributor(
                    (CommonNavigator) adaptableObject));
    }
    return null;
}
 
Example #11
Source File: WorkingSetsContentProvider.java    From tmxeditor8 with GNU General Public License v2.0 5 votes vote down vote up
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;
}
 
Example #12
Source File: WorkingSetsContentProvider.java    From tmxeditor8 with GNU General Public License v2.0 5 votes vote down vote up
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);
}