01: /*******************************************************************************
02: * Copyright (c) 2000, 2006 IBM Corporation and others.
03: * All rights reserved. This program and the accompanying materials
04: * are made available under the terms of the Eclipse Public License v1.0
05: * which accompanies this distribution, and is available at
06: * http://www.eclipse.org/legal/epl-v10.html
07: *
08: * Contributors:
09: * IBM Corporation - initial API and implementation
10: *******************************************************************************/package org.eclipse.ui.internal;
11:
12: import org.eclipse.ui.IEditorPart;
13: import org.eclipse.ui.IEditorReference;
14: import org.eclipse.ui.part.MultiEditor;
15:
16: /**
17: * Implements a pane of each editor inside a MultiEditor.
18: */
19: public class MultiEditorInnerPane extends EditorPane {
20:
21: EditorPane parentPane;
22:
23: /**
24: * Constructor for MultiEditorInnerPane.
25: */
26: public MultiEditorInnerPane(EditorPane pane, IEditorReference ref,
27: WorkbenchPage page, EditorStack workbook) {
28: super (ref, page, workbook);
29: parentPane = pane;
30: }
31:
32: /**
33: * Returns the outer editor.
34: */
35: public EditorPane getParentPane() {
36: return parentPane;
37: }
38:
39: /**
40: * Update the gradient on the inner editor title bar
41: */
42: private void updateGradient() {
43: MultiEditor multiEditor = (MultiEditor) parentPane
44: .getPartReference().getPart(true);
45: if (multiEditor != null) {
46: IEditorPart part = (IEditorPart) this .getEditorReference()
47: .getPart(true);
48: if (part != null) {
49: multiEditor.updateGradient(part);
50: }
51: }
52: }
53:
54: /**
55: * Indicate focus in part.
56: */
57: public void showFocus(boolean inFocus) {
58: super .showFocus(inFocus);
59: updateGradient();
60: }
61:
62: /* (non-Javadoc)
63: * Method declared on PartPane.
64: */
65: /* package */void shellDeactivated() {
66: super .shellDeactivated();
67: updateGradient();
68: }
69:
70: /* (non-Javadoc)
71: * Method declared on PartPane.
72: */
73: /* package */void shellActivated() {
74: super.shellActivated();
75: updateGradient();
76: }
77:
78: }
|