001: /*******************************************************************************
002: * Copyright (c) 2000, 2005 IBM Corporation and others.
003: * All rights reserved. This program and the accompanying materials
004: * are made available under the terms of the Eclipse Public License v1.0
005: * which accompanies this distribution, and is available at
006: * http://www.eclipse.org/legal/epl-v10.html
007: *
008: * Contributors:
009: * IBM Corporation - initial API and implementation
010: *******************************************************************************/package org.eclipse.ui.internal.console;
011:
012: import org.eclipse.swt.graphics.Image;
013: import org.eclipse.swt.widgets.Composite;
014: import org.eclipse.ui.IPropertyListener;
015: import org.eclipse.ui.IWorkbenchPart;
016: import org.eclipse.ui.IWorkbenchPartSite;
017: import org.eclipse.ui.console.IConsole;
018:
019: /**
020: * Fake part to use as keys in page book for console pages
021: */
022: public class ConsoleWorkbenchPart implements IWorkbenchPart {
023:
024: private IConsole fConsole = null;
025: private IWorkbenchPartSite fSite = null;
026:
027: /* (non-Javadoc)
028: * @see java.lang.Object#equals(java.lang.Object)
029: */
030: public boolean equals(Object obj) {
031: return (obj instanceof ConsoleWorkbenchPart)
032: && fConsole
033: .equals(((ConsoleWorkbenchPart) obj).fConsole);
034: }
035:
036: /* (non-Javadoc)
037: * @see java.lang.Object#hashCode()
038: */
039: public int hashCode() {
040: return fConsole.hashCode();
041: }
042:
043: /**
044: * Constructs a part for the given console that binds to the given
045: * site
046: */
047: public ConsoleWorkbenchPart(IConsole console,
048: IWorkbenchPartSite site) {
049: fConsole = console;
050: fSite = site;
051: }
052:
053: /* (non-Javadoc)
054: * @see org.eclipse.ui.IWorkbenchPart#addPropertyListener(org.eclipse.ui.IPropertyListener)
055: */
056: public void addPropertyListener(IPropertyListener listener) {
057: }
058:
059: /* (non-Javadoc)
060: * @see org.eclipse.ui.IWorkbenchPart#createPartControl(org.eclipse.swt.widgets.Composite)
061: */
062: public void createPartControl(Composite parent) {
063: }
064:
065: /* (non-Javadoc)
066: * @see org.eclipse.ui.IWorkbenchPart#dispose()
067: */
068: public void dispose() {
069: }
070:
071: /* (non-Javadoc)
072: * @see org.eclipse.ui.IWorkbenchPart#getSite()
073: */
074: public IWorkbenchPartSite getSite() {
075: return fSite;
076: }
077:
078: /* (non-Javadoc)
079: * @see org.eclipse.ui.IWorkbenchPart#getTitle()
080: */
081: public String getTitle() {
082: return ""; //$NON-NLS-1$
083: }
084:
085: /* (non-Javadoc)
086: * @see org.eclipse.ui.IWorkbenchPart#getTitleImage()
087: */
088: public Image getTitleImage() {
089: return null;
090: }
091:
092: /* (non-Javadoc)
093: * @see org.eclipse.ui.IWorkbenchPart#getTitleToolTip()
094: */
095: public String getTitleToolTip() {
096: return ""; //$NON-NLS-1$
097: }
098:
099: /* (non-Javadoc)
100: * @see org.eclipse.ui.IWorkbenchPart#removePropertyListener(org.eclipse.ui.IPropertyListener)
101: */
102: public void removePropertyListener(IPropertyListener listener) {
103: }
104:
105: /* (non-Javadoc)
106: * @see org.eclipse.ui.IWorkbenchPart#setFocus()
107: */
108: public void setFocus() {
109: }
110:
111: /* (non-Javadoc)
112: * @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class)
113: */
114: public Object getAdapter(Class adapter) {
115: return null;
116: }
117:
118: /**
119: * Returns the console associated with this part.
120: *
121: * @return console associated with this part
122: */
123: protected IConsole getConsole() {
124: return fConsole;
125: }
126: }
|