Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[pde-dev] ShowIn

Hi,

I have some problems with the Show In functionality in eclipse. I
cerate a search query, and the search part is showing my custom
objects fine. When right-clicking on them, the "Show In" menu shows
up, but only with the message "No applicable views".

In my perspective factory, I added layout.addShowInPart(ID_VIEW), and
both the perspective and the view are active at the time of searching.
My view implements IAdaptable, which looks like this:

	public Object getAdapter(Class adapter) {
		if (adapter == IShowInSource.class) {
			return getShowInSource();
		} else if (adapter == IShowInTarget.class) {
			return getShowInTarget();
		} else if (adapter == IShowInTargetList.class) {
			return new IShowInTargetList() {
				public String[] getShowInTargetIds() {
					return new String[] { ID_VIEW };
				}

			};
		}
		return null;
	}
	
	/**
	 * Returns the <code>IShowInSource</code> for this view.
	 */
	private IShowInSource getShowInSource() {
		return new IShowInSource() {
			public ShowInContext getShowInContext() {
				return new ShowInContext(treeViewer.getInput(), treeViewer
						.getSelection());
			}
		};
	}
	
	/**
	 * Returns the <code>IShowInTarget</code> for this view.
	 */
	private IShowInTarget getShowInTarget() {
		return new IShowInTarget() {
			public boolean show(ShowInContext context) {
				return true;
			};
	}

Is there anything else I have to do to make my view show up in the
"Show In" menu?

Regards,
Leen Toelen


Back to the top