KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > ui > internal > intro > impl > presentations > TextIntroPartImplementation


1 /*******************************************************************************
2  * Copyright (c) 2004, 2006 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11 package org.eclipse.ui.internal.intro.impl.presentations;
12
13 import org.eclipse.core.runtime.IRegistryChangeEvent;
14 import org.eclipse.swt.SWT;
15 import org.eclipse.swt.widgets.Composite;
16 import org.eclipse.swt.widgets.Text;
17 import org.eclipse.ui.internal.intro.impl.IntroPlugin;
18 import org.eclipse.ui.internal.intro.impl.model.AbstractIntroPartImplementation;
19 import org.eclipse.ui.internal.intro.impl.model.IntroModelRoot;
20 import org.eclipse.ui.internal.intro.impl.util.IntroModelSerializer;
21 import org.eclipse.ui.intro.config.IIntroContentProvider;
22
23 /**
24  * This is an Text based implementation of an Intro Part. It simply walks the
25  * model and prints the content of pages. It is used for debugging.
26  */

27 public class TextIntroPartImplementation extends
28         AbstractIntroPartImplementation {
29
30
31     public void doStandbyStateChanged(boolean standby,
32             boolean isStandbyPartNeeded) {
33         // no-op
34
}
35
36     public void createPartControl(Composite container) {
37         Text text = new Text(container, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL);
38         IntroModelRoot model = IntroPlugin.getDefault().getIntroModelRoot();
39         IntroModelSerializer serializer = new IntroModelSerializer(model);
40         text.setText(serializer.toString());
41         addToolBarActions();
42     }
43
44     protected void updateNavigationActionsState() {
45         // no-op
46
}
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, boolean incremental) {
90         // no-op
91
}
92 }
93
Popular Tags