Link Here
|
10 |
*******************************************************************************/ |
10 |
*******************************************************************************/ |
11 |
package org.eclipse.ui.forms.examples.internal.rcp; |
11 |
package org.eclipse.ui.forms.examples.internal.rcp; |
12 |
|
12 |
|
|
|
13 |
import org.eclipse.core.filesystem.EFS; |
14 |
import org.eclipse.core.filesystem.IFileStore; |
15 |
import org.eclipse.core.runtime.IPath; |
13 |
import org.eclipse.core.runtime.IProgressMonitor; |
16 |
import org.eclipse.core.runtime.IProgressMonitor; |
14 |
import org.eclipse.jface.action.Action; |
17 |
import org.eclipse.jface.action.Action; |
15 |
import org.eclipse.jface.action.ControlContribution; |
18 |
import org.eclipse.jface.action.ControlContribution; |
16 |
import org.eclipse.swt.SWT; |
19 |
import org.eclipse.swt.SWT; |
|
|
20 |
import org.eclipse.swt.layout.FillLayout; |
17 |
import org.eclipse.swt.widgets.Button; |
21 |
import org.eclipse.swt.widgets.Button; |
18 |
import org.eclipse.swt.widgets.Composite; |
22 |
import org.eclipse.swt.widgets.Composite; |
19 |
import org.eclipse.swt.widgets.Control; |
23 |
import org.eclipse.swt.widgets.Control; |
20 |
import org.eclipse.swt.widgets.Display; |
24 |
import org.eclipse.swt.widgets.Display; |
|
|
25 |
import org.eclipse.swt.widgets.Text; |
26 |
import org.eclipse.ui.IEditorInput; |
21 |
import org.eclipse.ui.ISharedImages; |
27 |
import org.eclipse.ui.ISharedImages; |
22 |
import org.eclipse.ui.PartInitException; |
28 |
import org.eclipse.ui.PartInitException; |
23 |
import org.eclipse.ui.PlatformUI; |
29 |
import org.eclipse.ui.PlatformUI; |
|
|
30 |
import org.eclipse.ui.editors.text.TextEditor; |
24 |
import org.eclipse.ui.forms.IManagedForm; |
31 |
import org.eclipse.ui.forms.IManagedForm; |
25 |
import org.eclipse.ui.forms.editor.SharedHeaderFormEditor; |
32 |
import org.eclipse.ui.forms.editor.SharedHeaderFormEditor; |
26 |
import org.eclipse.ui.forms.examples.internal.ExamplesPlugin; |
33 |
import org.eclipse.ui.forms.examples.internal.ExamplesPlugin; |
27 |
import org.eclipse.ui.forms.widgets.Form; |
34 |
import org.eclipse.ui.forms.widgets.Form; |
28 |
import org.eclipse.ui.forms.widgets.FormToolkit; |
35 |
import org.eclipse.ui.forms.widgets.FormToolkit; |
29 |
import org.eclipse.ui.forms.widgets.ScrolledForm; |
36 |
import org.eclipse.ui.forms.widgets.ScrolledForm; |
|
|
37 |
import org.eclipse.ui.internal.editors.text.EditorsPlugin; |
38 |
import org.eclipse.ui.internal.editors.text.NonExistingFileEditorInput; |
30 |
|
39 |
|
31 |
/** |
40 |
/** |
32 |
* A form editor that has several pages but only one stable header. |
41 |
* A form editor that has several pages but only one stable header. |
Link Here
|
62 |
} |
71 |
} |
63 |
}); |
72 |
}); |
64 |
//sform.setMessage("Static text", 0); |
73 |
//sform.setMessage("Static text", 0); |
|
|
74 |
Composite parent= headerForm.getForm().getForm().getHead(); |
75 |
parent.setLayout(new FillLayout()); |
76 |
Text text= new Text(parent, SWT.NONE); |
77 |
headerForm.getForm().getForm().setHeadClient(text); |
65 |
} |
78 |
} |
66 |
|
79 |
|
67 |
/* |
80 |
/* |
Link Here
|
74 |
addPage(new HeadlessPage(this, 1)); |
87 |
addPage(new HeadlessPage(this, 1)); |
75 |
addPage(new HeadlessPage(this, 2)); |
88 |
addPage(new HeadlessPage(this, 2)); |
76 |
addPage(new HeadlessPage(this, 3)); |
89 |
addPage(new HeadlessPage(this, 3)); |
|
|
90 |
addPage(new TextEditor(), createEditorInput(queryFileStore())); |
77 |
} catch (PartInitException e) { |
91 |
} catch (PartInitException e) { |
78 |
// |
92 |
// |
79 |
} |
93 |
} |
80 |
} |
94 |
} |
81 |
|
95 |
|
|
|
96 |
private IFileStore queryFileStore() { |
97 |
IPath stateLocation= EditorsPlugin.getDefault().getStateLocation(); |
98 |
IPath path= stateLocation.append("/_" + new Object().hashCode()); |
99 |
return EFS.getLocalFileSystem().getStore(path); |
100 |
} |
101 |
|
102 |
private IEditorInput createEditorInput(IFileStore fileStore) { |
103 |
return new NonExistingFileEditorInput(fileStore, ""); |
104 |
} |
105 |
|
82 |
/* |
106 |
/* |
83 |
* (non-Javadoc) |
107 |
* (non-Javadoc) |
84 |
* |
108 |
* |