Java Code Examples for org.eclipse.jdt.ui.JavaUI#ID_PACKAGES

The following examples show how to use org.eclipse.jdt.ui.JavaUI#ID_PACKAGES . 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: CallHierarchyViewPart.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 6 votes vote down vote up
/**
 * {@inheritDoc}
 */
   @Override
public Object getAdapter(Class adapter) {
   	if (adapter == IShowInSource.class) {
   		return getShowInSource();
   	}
   	if (adapter == IContextProvider.class) {
   		return JavaUIHelp.getHelpContextProvider(this, IJavaHelpContextIds.CALL_HIERARCHY_VIEW);
   	}
	if (adapter == IShowInTargetList.class) {
		return new IShowInTargetList() {
			public String[] getShowInTargetIds() {
				return new String[] { JavaUI.ID_PACKAGES, JavaPlugin.ID_RES_NAV };
			}
		};
	}
   	return super.getAdapter(adapter);
   }
 
Example 2
Source File: JavaOutlinePage.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 6 votes vote down vote up
public Object getAdapter(Class key) {
	if (key == IShowInSource.class) {
		return getShowInSource();
	}
	if (key == IShowInTargetList.class) {
		return new IShowInTargetList() {
			public String[] getShowInTargetIds() {
				return new String[] { JavaUI.ID_PACKAGES };
			}

		};
	}
	if (key == IShowInTarget.class) {
		return getShowInTarget();
	}

	return null;
}
 
Example 3
Source File: TypeHierarchyViewPart.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 6 votes vote down vote up
@Override
public Object getAdapter(Class key) {
	if (key == IShowInSource.class) {
		return getShowInSource();
	}
	if (key == IShowInTargetList.class) {
		return new IShowInTargetList() {
			public String[] getShowInTargetIds() {
				return new String[] { JavaUI.ID_PACKAGES, JavaPlugin.ID_RES_NAV  };
			}

		};
	}
	if (key == IContextProvider.class) {
		return JavaUIHelp.getHelpContextProvider(this, IJavaHelpContextIds.TYPE_HIERARCHY_VIEW);
	}
	return super.getAdapter(key);
}
 
Example 4
Source File: PropertiesFileEditor.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 5 votes vote down vote up
@Override
public Object getAdapter(Class adapter) {
	if (adapter == IShowInTargetList.class) {
		return new IShowInTargetList() {
			public String[] getShowInTargetIds() {
				return new String[] { JavaUI.ID_PACKAGES, JavaPlugin.ID_RES_NAV };
			}

		};
	}
	return super.getAdapter(adapter);
}
 
Example 5
Source File: ProjectsView.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 5 votes vote down vote up
@Override
public Object getAdapter(Class key) {
	if (key == IShowInTargetList.class) {
		return new IShowInTargetList() {
			public String[] getShowInTargetIds() {
				return new String[] { JavaUI.ID_PACKAGES, JavaPlugin.ID_RES_NAV  };
			}

		};
	}
	return super.getAdapter(key);
}
 
Example 6
Source File: MembersView.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 5 votes vote down vote up
@Override
public Object getAdapter(Class key) {
	if (key == IShowInTargetList.class) {
		return new IShowInTargetList() {
			public String[] getShowInTargetIds() {
				return new String[] { JavaUI.ID_PACKAGES };
			}

		};
	}
	return super.getAdapter(key);
}
 
Example 7
Source File: TypesView.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 5 votes vote down vote up
@Override
public Object getAdapter(Class key) {
	if (key == IShowInTargetList.class) {
		return new IShowInTargetList() {
			public String[] getShowInTargetIds() {
				return new String[] { JavaUI.ID_PACKAGES, JavaPlugin.ID_RES_NAV };
			}

		};
	}
	return super.getAdapter(key);
}
 
Example 8
Source File: PackagesView.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 5 votes vote down vote up
@Override
public Object getAdapter(Class key) {
	if (key == IShowInTargetList.class) {
		return new IShowInTargetList() {
			public String[] getShowInTargetIds() {
				return new String[] { JavaUI.ID_PACKAGES, JavaPlugin.ID_RES_NAV  };
			}
		};
	}
	return super.getAdapter(key);
}
 
Example 9
Source File: JavaEditor.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 4 votes vote down vote up
@Override
public Object getAdapter(Class required) {

	if (IContentOutlinePage.class.equals(required)) {
		if (fOutlinePage == null && getSourceViewer() != null && isCalledByOutline())
			fOutlinePage= createOutlinePage();
		return fOutlinePage;
	}

	if (IEncodingSupport.class.equals(required))
		return fEncodingSupport;

	if (required == IShowInTargetList.class) {
		return new IShowInTargetList() {
			public String[] getShowInTargetIds() {
				return new String[] { JavaUI.ID_PACKAGES, IPageLayout.ID_OUTLINE, JavaPlugin.ID_RES_NAV };
			}

		};
	}

	if (required == IShowInSource.class) {
		IJavaElement inputJE= getInputJavaElement();
		if (inputJE instanceof ICompilationUnit && !JavaModelUtil.isPrimary((ICompilationUnit) inputJE))
			return null;

		return new IShowInSource() {
			public ShowInContext getShowInContext() {
				return new ShowInContext(null, null) {
					/*
					 * @see org.eclipse.ui.part.ShowInContext#getInput()
					 * @since 3.4
					 */
					@Override
					public Object getInput() {
						if (isBreadcrumbActive())
							return null;

						return getEditorInput();
					}

					/*
					 * @see org.eclipse.ui.part.ShowInContext#getSelection()
					 * @since 3.3
					 */
					@Override
					public ISelection getSelection() {
						if (isBreadcrumbActive())
							return getBreadcrumb().getSelectionProvider().getSelection();

						try {
							IJavaElement je= SelectionConverter.getElementAtOffset(JavaEditor.this);
							if (je != null)
								return new StructuredSelection(je);
							return null;
						} catch (JavaModelException ex) {
							return null;
						}
					}
				};
			}
		};
	}

	if (required == IJavaFoldingStructureProvider.class)
		return fProjectionModelUpdater;

	if (fProjectionSupport != null) {
		Object adapter= fProjectionSupport.getAdapter(getSourceViewer(), required);
		if (adapter != null)
			return adapter;
	}

	if (required == IContextProvider.class) {
		if (isBreadcrumbActive()) {
			return JavaUIHelp.getHelpContextProvider(this, IJavaHelpContextIds.JAVA_EDITOR_BREADCRUMB);
		} else {
			return JavaUIHelp.getHelpContextProvider(this, IJavaHelpContextIds.JAVA_EDITOR);
		}
	}

	return super.getAdapter(required);
}