org.eclipse.ui.part.IContributedContentsView Java Examples

The following examples show how to use org.eclipse.ui.part.IContributedContentsView. 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: AbstractFindbugsView.java    From spotbugs with GNU Lesser General Public License v2.1 5 votes vote down vote up
@Override
public Object getAdapter(@SuppressWarnings("rawtypes") Class adapter) {
    if (adapter == IContributedContentsView.class) {
        return this;
    }
    return super.getAdapter(adapter);
}
 
Example #2
Source File: LibraryExplorerView.java    From birt with Eclipse Public License 1.0 5 votes vote down vote up
public Object getAdapter( Class key )
{
	if ( key == IContributedContentsView.class )
		return new IContributedContentsView( ) {

			public IWorkbenchPart getContributingPart( )
			{
				return getCurrentContributingPart( );
			}
		};
	return super.getAdapter( key );
}
 
Example #3
Source File: DataView.java    From birt with Eclipse Public License 1.0 5 votes vote down vote up
public Object getAdapter( Class key )
{
	if ( key == IContributedContentsView.class )
		return new IContributedContentsView( ) {

			public IWorkbenchPart getContributingPart( )
			{
				return getCurrentContributingPart( );
			}
		};
	return super.getAdapter( key );
}
 
Example #4
Source File: AttributeView.java    From birt with Eclipse Public License 1.0 5 votes vote down vote up
public Object getAdapter( Class key )
{
	if ( key == IContributedContentsView.class )
	{
		return new IContributedContentsView( ) {

			public IWorkbenchPart getContributingPart( )
			{
				return getCurrentContributingPart( );
			}
		};
	}
	return super.getAdapter( key );
}
 
Example #5
Source File: TabbedPropertySheetPage.java    From bonita-studio with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Handle the part activated event.
 *
 * @param part
 *            the new activated part.
 */
protected void handlePartActivated(IWorkbenchPart part) {
	/*
	 * The properties view has been activated and the current page is this
	 * instance of TabbedPropertySheetPage
	 */
	boolean thisActivated = part instanceof PropertySheet
		&& ((PropertySheet) part).getCurrentPage() == this;

	/*
	 * When the active part changes and the part does not provide a
	 * selection that affects this property sheet page, the PropertySheet
	 * does not send us a selectionChanged() event. We need to be informed
	 * of these events since we want to send aboutToBeHidden() and
	 * aboutToBeShown() when the property sheet is hidden or shown.
	 */
       if (!thisActivated && !part.equals(contributor)
               && !part.getSite().getId().equals(contributor.getContributorId())) {
		/*
		 * Is the part is a IContributedContentsView for the contributor,
		 * for example, outline view.
		 */
		IContributedContentsView view = Adapters.adapt(part, IContributedContentsView.class);
		if (view == null
			|| (view.getContributingPart() != null && !view
				.getContributingPart().equals(contributor))) {
			if (activePropertySheet) {
				if (currentTab != null) {
					currentTab.aboutToBeHidden();
				}
				activePropertySheet = false;
			}
			return;
		}
	}
	if (!activePropertySheet && currentTab != null) {
		currentTab.aboutToBeShown();
		currentTab.refresh();
	}
	activePropertySheet = true;
}