01: /*******************************************************************************
02: * Copyright (c) 2004, 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.intro.impl.presentations;
11:
12: import org.eclipse.core.runtime.IRegistryChangeEvent;
13: import org.eclipse.swt.SWT;
14: import org.eclipse.swt.widgets.Composite;
15: import org.eclipse.swt.widgets.Text;
16: import org.eclipse.ui.internal.intro.impl.IntroPlugin;
17: import org.eclipse.ui.internal.intro.impl.model.AbstractIntroPartImplementation;
18: import org.eclipse.ui.internal.intro.impl.model.IntroModelRoot;
19: import org.eclipse.ui.internal.intro.impl.util.IntroModelSerializer;
20: import org.eclipse.ui.intro.config.IIntroContentProvider;
21:
22: /**
23: * This is an Text based implementation of an Intro Part. It simply walks the
24: * model and prints the content of pages. It is used for debugging.
25: */
26: public class TextIntroPartImplementation extends
27: AbstractIntroPartImplementation {
28:
29: public void doStandbyStateChanged(boolean standby,
30: boolean isStandbyPartNeeded) {
31: // no-op
32: }
33:
34: public void createPartControl(Composite container) {
35: Text text = new Text(container, SWT.MULTI | SWT.H_SCROLL
36: | SWT.V_SCROLL);
37: IntroModelRoot model = IntroPlugin.getDefault()
38: .getIntroModelRoot();
39: IntroModelSerializer serializer = new IntroModelSerializer(
40: model);
41: text.setText(serializer.toString());
42: addToolBarActions();
43: }
44:
45: protected void updateNavigationActionsState() {
46: // no-op
47: }
48:
49: public void setFocus() {
50: // no-op
51: }
52:
53: /*
54: * (non-Javadoc)
55: *
56: * @see org.eclipse.ui.internal.intro.impl.model.AbstractIntroPartImplementation#navigateBackward()
57: */
58: public boolean navigateBackward() {
59: return false;
60: }
61:
62: /*
63: * (non-Javadoc)
64: *
65: * @see org.eclipse.ui.internal.intro.impl.model.AbstractIntroPartImplementation#navigateForward()
66: */
67: public boolean navigateForward() {
68: return false;
69: }
70:
71: /*
72: * (non-Javadoc)
73: *
74: * @see org.eclipse.ui.internal.intro.impl.model.AbstractIntroPartImplementation#handleRegistryChanged(org.eclipse.core.runtime.IRegistryChangeEvent)
75: */
76: protected void handleRegistryChanged(IRegistryChangeEvent event) {
77: // no-op
78: }
79:
80: /*
81: * (non-Javadoc)
82: *
83: * @see org.eclipse.ui.internal.intro.impl.model.AbstractIntroPartImplementation#navigateHome()
84: */
85: public boolean navigateHome() {
86: return false;
87: }
88:
89: public void reflow(IIntroContentProvider provider,
90: boolean incremental) {
91: // no-op
92: }
93: }
|