View | Details | Raw Unified | Return to bug 69732 | Differences between
and this patch

Collapse All | Expand All

(-)cheatsheets/CVS_1.xml (-2 / +4 lines)
Lines 18-24 Link Here
18
18
19
	<item
19
	<item
20
		href="/org.eclipse.platform.doc.user/tasks/tasks-100b.htm"
20
		href="/org.eclipse.platform.doc.user/tasks/tasks-100b.htm"
21
		title="Load the Destination into your Workspace">
21
		title="Load the Destination into your Workspace"
22
		dialog="true">
22
		<description>
23
		<description>
23
Select the project and choose Replace With &gt; Another Branch or Version from the context menu. Then select the branch to replace with. In this step you must ensure that the destination is loaded into your workspace. This is a manual task, you will need to perform the work and click the "Click to complete" button to move to the next step.
24
Select the project and choose Replace With &gt; Another Branch or Version from the context menu. Then select the branch to replace with. In this step you must ensure that the destination is loaded into your workspace. This is a manual task, you will need to perform the work and click the "Click to complete" button to move to the next step.
24
		</description>
25
		</description>
Lines 26-32 Link Here
26
27
27
	<item
28
	<item
28
		href="/org.eclipse.platform.doc.user/tasks/tasks-100b.htm" 
29
		href="/org.eclipse.platform.doc.user/tasks/tasks-100b.htm" 
29
		title="Merge Details">
30
		title="Merge Details"
31
		dialog="true">
30
		<description>
32
		<description>
31
Select the project, choose Team &gt; Merge and complete the wizard as required. This step specifies the details of the merge.  This is a manual task, you will need to perform the work and click the "Click to complete" button to move to the next step.
33
Select the project, choose Team &gt; Merge and complete the wizard as required. This step specifies the details of the merge.  This is a manual task, you will need to perform the work and click the "Click to complete" button to move to the next step.
32
		</description>
34
		</description>
(-)src/org/eclipse/ui/internal/cheatsheets/data/Item.java (-1 / +19 lines)
Lines 15-20 Link Here
15
public class Item extends Intro implements IActionItem, IPerformWhenItem, ISubItemItem {
15
public class Item extends Intro implements IActionItem, IPerformWhenItem, ISubItemItem {
16
	private String title;
16
	private String title;
17
	private boolean skip;
17
	private boolean skip;
18
	private boolean dialog;
18
	private ArrayList itemExtensions;
19
	private ArrayList itemExtensions;
19
	
20
	
20
	private Action action;
21
	private Action action;
Lines 29-38 Link Here
29
		super();
30
		super();
30
	}
31
	}
31
	
32
	
32
	public Item(String title, String description, String href, String contextId, boolean skip) {
33
	public Item(String title, String description, String href, String contextId, boolean skip, boolean dialog) {
33
		super(description, href, contextId);
34
		super(description, href, contextId);
34
		this.title = title;
35
		this.title = title;
35
		this.skip = skip;
36
		this.skip = skip;
37
		this.dialog = dialog;
36
	}
38
	}
37
	
39
	
38
	/**
40
	/**
Lines 59-64 Link Here
59
	}
61
	}
60
62
61
	/**
63
	/**
64
	 * Returns whether or not this item requires opening a dialog.
65
	 * @return whether the item requires opening a dialog
66
	 */
67
	public boolean isDialog() {
68
		return this.dialog;
69
	}
70
	
71
	/**
62
	 * Returns the skip.
72
	 * Returns the skip.
63
	 * @return boolean
73
	 * @return boolean
64
	 */
74
	 */
Lines 67-72 Link Here
67
	}
77
	}
68
78
69
	/**
79
	/**
80
	 * Sets whether or not this item requires opening a dialog.
81
	 * @param dialog whether the item requires opening a dialog
82
	 */
83
	public void setDialog(boolean dialog) {
84
		this.dialog = dialog;
85
	}
86
	
87
	/**
70
	 * @param skip The skip to set.
88
	 * @param skip The skip to set.
71
	 */
89
	 */
72
	public void setSkip(boolean skip) {
90
	public void setSkip(boolean skip) {
(-)src/org/eclipse/ui/internal/cheatsheets/data/IParserTags.java (+2 lines)
Lines 55-66 Link Here
55
	 * <!ELEMENT item (description [action|perform-when] | (subitem|repeated-subitem|conditional-subitem)*)>
55
	 * <!ELEMENT item (description [action|perform-when] | (subitem|repeated-subitem|conditional-subitem)*)>
56
	 * <!ATTLIST item
56
	 * <!ATTLIST item
57
	 *   title               CDATA #REQUIRED
57
	 *   title               CDATA #REQUIRED
58
	 *   dialog              ("true" | "false") "false"
58
	 *   skip                ("true" | "false") "false"
59
	 *   skip                ("true" | "false") "false"
59
	 *   contextId           CDATA #IMPLIED
60
	 *   contextId           CDATA #IMPLIED
60
	 *   href                CDATA #IMPLIED
61
	 *   href                CDATA #IMPLIED
61
	 * >
62
	 * >
62
	 */
63
	 */
63
	public static final String ITEM = "item"; //$NON-NLS-1$
64
	public static final String ITEM = "item"; //$NON-NLS-1$
65
	public static final String DIALOG = "dialog"; //$NON-NLS-1$
64
	public static final String SKIP = "skip"; //$NON-NLS-1$
66
	public static final String SKIP = "skip"; //$NON-NLS-1$
65
67
66
	/*
68
	/*
(-)src/org/eclipse/ui/internal/cheatsheets/data/CheatSheetParser.java (+2 lines)
Lines 505-510 Link Here
505
					item.setHref(attribute.getNodeValue());
505
					item.setHref(attribute.getNodeValue());
506
				} else if (attributeName.equals(IParserTags.SKIP)) {
506
				} else if (attributeName.equals(IParserTags.SKIP)) {
507
					item.setSkip(attribute.getNodeValue().equals(TRUE_STRING));
507
					item.setSkip(attribute.getNodeValue().equals(TRUE_STRING));
508
				} else if (attributeName.equals(IParserTags.DIALOG)) {
509
					item.setDialog(attribute.getNodeValue().equals(TRUE_STRING));
508
				} else {
510
				} else {
509
					AbstractItemExtensionElement[] ie = handleUnknownItemAttribute(attribute, itemNode);
511
					AbstractItemExtensionElement[] ie = handleUnknownItemAttribute(attribute, itemNode);
510
					if (ie != null)
512
					if (ie != null)
(-)src/org/eclipse/ui/cheatsheets/CheatSheetViewerFactory.java (-1 / +1 lines)
Lines 37-42 Link Here
37
	 * @return a new cheat sheet viewer
37
	 * @return a new cheat sheet viewer
38
	 */
38
	 */
39
	public static ICheatSheetViewer createCheatSheetView() {
39
	public static ICheatSheetViewer createCheatSheetView() {
40
		return new CheatSheetViewer();
40
		return new CheatSheetViewer(false);
41
	}
41
	}
42
}
42
}
(-)schema/cheatSheetContentFileSpec.html (-4 / +8 lines)
Lines 11-17 Link Here
11
<body>
11
<body>
12
12
13
<h1>Cheat Sheet Content File XML Format</h1>
13
<h1>Cheat Sheet Content File XML Format</h1>
14
<p>Version 3.0</p>
14
<p>Version 3.2</p>
15
<p>This document describes the cheat sheet content file structure as a series of
15
<p>This document describes the cheat sheet content file structure as a series of
16
DTD fragments (machine readable <a href="contentFile.xsd">XML schema</a>).</p>
16
DTD fragments (machine readable <a href="contentFile.xsd">XML schema</a>).</p>
17
<h2><code>cheatsheet</code></h2>
17
<h2><code>cheatsheet</code></h2>
Lines 70-75 Link Here
70
<pre>&lt;!ELEMENT item (description ([action|perform-when] | (subitem|repeated-subitem|conditional-subitem)*))&gt;&nbsp;
70
<pre>&lt;!ELEMENT item (description ([action|perform-when] | (subitem|repeated-subitem|conditional-subitem)*))&gt;&nbsp;
71
&lt;!ATTLIST item&nbsp;
71
&lt;!ATTLIST item&nbsp;
72
&nbsp; title&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; CDATA #REQUIRED
72
&nbsp; title&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; CDATA #REQUIRED
73
&nbsp; dialog  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (&quot;true&quot; | &quot;false&quot;) &quot;false&quot;
73
&nbsp; skip   &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (&quot;true&quot; | &quot;false&quot;) &quot;false&quot;
74
&nbsp; skip   &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (&quot;true&quot; | &quot;false&quot;) &quot;false&quot;
74
&nbsp; contextId&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; CDATA #IMPLIED&nbsp;
75
&nbsp; contextId&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; CDATA #IMPLIED&nbsp;
75
&nbsp; href &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; CDATA #IMPLIED
76
&nbsp; href &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; CDATA #IMPLIED
Lines 79-84 Link Here
79
follows:</p>
80
follows:</p>
80
<ul type="disc">
81
<ul type="disc">
81
  <li><b>title</b> - The title of the cheat sheet item.
82
  <li><b>title</b> - The title of the cheat sheet item.
83
  <li><b>dialog</b> - dialog=&quot;true&quot; means this step involves opening
84
    a modal dialog. This is a hint to the system that it should allow the user
85
    to continue using the cheat sheet while in the modal dialog.</li>
82
  <li><b>skip</b> - skip=&quot;true&quot; means that the whole step can be
86
  <li><b>skip</b> - skip=&quot;true&quot; means that the whole step can be
83
    skipped; the UI generally shows a button that the user can press to indicate
87
    skipped; the UI generally shows a button that the user can press to indicate
84
    that they are skipping this step</li>
88
    that they are skipping this step</li>
Lines 322-329 Link Here
322
  &lt;intro&gt;
326
  &lt;intro&gt;
323
    &lt;description&gt;Example cheat sheet with two steps.&lt;/description&gt;
327
    &lt;description&gt;Example cheat sheet with two steps.&lt;/description&gt;
324
  &lt;/intro&gt;
328
  &lt;/intro&gt;
325
  &lt;item title=&quot;Step 1&quot;&gt;
329
  &lt;item title=&quot;Step 1&quot; dialog=&quot;true&quot;&gt;
326
     &lt;description&gt;This is a step with an action.&lt;/description&gt;
330
     &lt;description&gt;This is a step with an action that involves opening a modal dialog.&lt;/description&gt;
327
     &lt;action class=&quot;com.xyz.myaction&quot; pluginId=&quot;com.xyz&quot;/&gt;
331
     &lt;action class=&quot;com.xyz.myaction&quot; pluginId=&quot;com.xyz&quot;/&gt;
328
  &lt;/item&gt;
332
  &lt;/item&gt;
329
  &lt;item title=&quot;Step 2&quot;&gt;
333
  &lt;item title=&quot;Step 2&quot;&gt;
Lines 333-339 Link Here
333
337
334
<br>
338
<br>
335
<p class=note id=copyright>
339
<p class=note id=copyright>
336
Copyright (c) 2004 IBM Corporation and others.<br>
340
Copyright (c) 2004, 2005 IBM Corporation and others.<br>
337
All rights reserved. This program and the accompanying materials are made 
341
All rights reserved. This program and the accompanying materials are made 
338
available under the terms of the Eclipse Public License v1.0 which accompanies 
342
available under the terms of the Eclipse Public License v1.0 which accompanies 
339
this distribution, and is available at 
343
this distribution, and is available at 
(-)schema/contentFile.xsd (-1 / +2 lines)
Lines 4-10 Link Here
4
	<xsd:annotation>
4
	<xsd:annotation>
5
		<xsd:documentation xml:lang="en">
5
		<xsd:documentation xml:lang="en">
6
		Schema for cheat sheet content file.
6
		Schema for cheat sheet content file.
7
 		Copyright (c) 2004 IBM Corporation and others.&lt;br&gt;
7
 		Copyright (c) 2004, 2005 IBM Corporation and others.&lt;br&gt;
8
		All rights reserved. This program and the accompanying materials are made 
8
		All rights reserved. This program and the accompanying materials are made 
9
		available under the terms of the Eclipse Public License v1.0 which 
9
		available under the terms of the Eclipse Public License v1.0 which 
10
		accompanies this distribution, and is available at 
10
		accompanies this distribution, and is available at 
Lines 57-62 Link Here
57
	            </xsd:choice>
57
	            </xsd:choice>
58
            </xsd:choice>
58
            </xsd:choice>
59
            <xsd:attribute name="title" type="xsd:string" use="required"/>
59
            <xsd:attribute name="title" type="xsd:string" use="required"/>
60
            <xsd:attribute name="dialog" type="xsd:boolean" use="optional" default="false"/>
60
            <xsd:attribute name="skip" type="xsd:boolean" use="optional" default="false"/>
61
            <xsd:attribute name="skip" type="xsd:boolean" use="optional" default="false"/>
61
            <xsd:attribute name="contextId" type="xsd:string" use="optional"/>
62
            <xsd:attribute name="contextId" type="xsd:string" use="optional"/>
62
            <xsd:attribute name="href" type="xsd:string" use="optional"/>
63
            <xsd:attribute name="href" type="xsd:string" use="optional"/>
(-)src/org/eclipse/ui/internal/cheatsheets/views/CheatSheetView.java (-1 / +1 lines)
Lines 94-100 Link Here
94
	public void createPartControl(Composite parent) {
94
	public void createPartControl(Composite parent) {
95
		CheatSheetStopWatch.startStopWatch("CheatSheetView.createPartControl"); //$NON-NLS-1$
95
		CheatSheetStopWatch.startStopWatch("CheatSheetView.createPartControl"); //$NON-NLS-1$
96
96
97
		viewer = new CheatSheetViewer();
97
		viewer = new CheatSheetViewer(false);
98
		viewer.createPartControl(parent);
98
		viewer.createPartControl(parent);
99
	
99
	
100
		if (!actionBarContributed) {
100
		if (!actionBarContributed) {
(-)src/org/eclipse/ui/internal/cheatsheets/views/ViewItem.java (+10 lines)
Lines 333-338 Link Here
333
		return mainItemComposite.isExpanded();
333
		return mainItemComposite.isExpanded();
334
	}
334
	}
335
335
336
	/**
337
     * Returns whether or not cheat sheet viewer containing this item is in
338
     * a modal dialog.
339
     * 
340
     * @return whether the cheat sheet viewer is in a modal dialog
341
	 */
342
	public boolean isInDialogMode() {
343
		return viewer.isInDialogMode();
344
	}
345
	
336
	/*package*/
346
	/*package*/
337
	boolean isSkipped() {
347
	boolean isSkipped() {
338
		return isSkipped;
348
		return isSkipped;
(-)src/org/eclipse/ui/internal/cheatsheets/views/CheatSheetViewer.java (-3 / +115 lines)
Lines 24-30 Link Here
24
import org.eclipse.core.runtime.Path;
24
import org.eclipse.core.runtime.Path;
25
import org.eclipse.core.runtime.Platform;
25
import org.eclipse.core.runtime.Platform;
26
import org.eclipse.core.runtime.Status;
26
import org.eclipse.core.runtime.Status;
27
import org.eclipse.help.ui.internal.views.HelpTray;
28
import org.eclipse.help.ui.internal.views.IHelpPartPage;
29
import org.eclipse.help.ui.internal.views.ReusableHelpPart;
27
import org.eclipse.jface.action.Action;
30
import org.eclipse.jface.action.Action;
31
import org.eclipse.jface.dialogs.TrayDialog;
28
import org.eclipse.osgi.util.NLS;
32
import org.eclipse.osgi.util.NLS;
29
import org.eclipse.swt.SWT;
33
import org.eclipse.swt.SWT;
30
import org.eclipse.swt.events.DisposeEvent;
34
import org.eclipse.swt.events.DisposeEvent;
Lines 35-41 Link Here
35
import org.eclipse.swt.widgets.Composite;
39
import org.eclipse.swt.widgets.Composite;
36
import org.eclipse.swt.widgets.Control;
40
import org.eclipse.swt.widgets.Control;
37
import org.eclipse.swt.widgets.Display;
41
import org.eclipse.swt.widgets.Display;
42
import org.eclipse.swt.widgets.Event;
38
import org.eclipse.swt.widgets.Label;
43
import org.eclipse.swt.widgets.Label;
44
import org.eclipse.swt.widgets.Listener;
45
import org.eclipse.swt.widgets.Shell;
46
import org.eclipse.swt.widgets.Widget;
39
import org.eclipse.ui.PlatformUI;
47
import org.eclipse.ui.PlatformUI;
40
import org.eclipse.ui.cheatsheets.ICheatSheetEvent;
48
import org.eclipse.ui.cheatsheets.ICheatSheetEvent;
41
import org.eclipse.ui.cheatsheets.ICheatSheetViewer;
49
import org.eclipse.ui.cheatsheets.ICheatSheetViewer;
Lines 82-100 Link Here
82
	private ArrayList viewItemList = new ArrayList();
90
	private ArrayList viewItemList = new ArrayList();
83
91
84
	//Composites
92
	//Composites
85
	private Composite control;
93
	protected Composite control;
86
94
87
	private Cursor busyCursor;
95
	private Cursor busyCursor;
88
	
96
	
89
	private ErrorPage errorPage;
97
	private ErrorPage errorPage;
90
	private CheatSheetPage cheatSheetPage;
98
	private CheatSheetPage cheatSheetPage;
91
	private Label howToBegin;
99
	private Label howToBegin;
100
	private boolean inDialog;
101
	private Listener listener;
92
102
93
	/**
103
	/**
94
	 * The constructor.
104
	 * The constructor.
105
	 * 
106
	 * @param inDialog whether or not this viewer will be placed in a modal dialog
95
	 */
107
	 */
96
	public CheatSheetViewer() {
108
	public CheatSheetViewer(boolean inDialog) {
97
		currentItemNum = -1;
109
		currentItemNum = -1;
110
		this.inDialog = inDialog;
98
		saveHelper = new CheatSheetSaveHelper();
111
		saveHelper = new CheatSheetSaveHelper();
99
	}
112
	}
100
113
Lines 540-545 Link Here
540
				dispose();
553
				dispose();
541
			}
554
			}
542
		});
555
		});
556
		
557
		/*
558
		 * org.eclipse.help.ui is an optional dependency; only perform this
559
		 * step is this plugin is present.
560
		 */
561
		if (!inDialog && (Platform.getBundle("org.eclipse.help.ui") != null)) {
562
			listener = new Listener() {
563
				public void handleEvent(Event event) {
564
					if (isTrayDialog(event.widget)) {
565
						dialogOpened((TrayDialog)((Shell)event.widget).getData());
566
					}
567
				}
568
			};
569
			Display.getCurrent().addFilter(SWT.Show, listener);
570
		}
543
571
544
		howToBegin = new Label(control, SWT.WRAP);
572
		howToBegin = new Label(control, SWT.WRAP);
545
		howToBegin.setText(Messages.INITIAL_VIEW_DIRECTIONS);
573
		howToBegin.setText(Messages.INITIAL_VIEW_DIRECTIONS);
Lines 555-565 Link Here
555
	}
583
	}
556
584
557
	/**
585
	/**
586
	 * Called when any TrayDialog is opened. The viewer must react by disabling
587
	 * itself and moving the cheat sheet to the dialog's tray if the current item
588
	 * was flagged as one that opens a modal dialog.
589
	 * 
590
	 * @param dialog the dialog that was opened
591
	 */
592
	private void dialogOpened(TrayDialog dialog) {
593
		if (isInDialogItem()) {
594
			final String id = getCheatSheetID();
595
			HelpTray tray = (HelpTray)dialog.getTray();
596
			if (tray == null) {
597
				tray = new HelpTray();
598
				dialog.openTray(tray);
599
			}
600
			ReusableHelpPart helpPart = tray.getHelpPart();
601
			IHelpPartPage page = helpPart.createPage(CheatSheetHelpPart.ID, null, null);
602
			page.setVerticalSpacing(0);
603
			page.setHorizontalMargin(0);
604
			helpPart.addPart(CheatSheetHelpPart.ID, new CheatSheetHelpPart(helpPart.getForm().getForm().getBody(), helpPart.getForm().getToolkit(), page.getToolBarManager(), id));
605
			page.addPart(CheatSheetHelpPart.ID, true);
606
			helpPart.addPage(page);
607
			helpPart.showPage(CheatSheetHelpPart.ID);
608
			
609
			/*
610
			 * Disable the viewer until the tray is closed, then show it again.
611
			 */
612
			control.setVisible(false);
613
			Display.getCurrent().removeFilter(SWT.Show, listener);
614
615
			helpPart.getControl().addListener(SWT.Dispose, new Listener() {
616
				public void handleEvent(Event event) {
617
					control.setVisible(true);
618
					Display.getCurrent().addFilter(SWT.Show, listener);
619
					checkSavedState();
620
				}
621
			});
622
		}
623
	}
624
625
	/**
558
	 * Disposes of this cheat sheet viewer.
626
	 * Disposes of this cheat sheet viewer.
559
	 */
627
	 */
560
	private void dispose() {
628
	private void dispose() {
629
		if (listener != null) {
630
			Display.getCurrent().removeFilter(SWT.Show, listener);
631
		}
561
		internalDispose();
632
		internalDispose();
562
563
		if (busyCursor != null)
633
		if (busyCursor != null)
564
			busyCursor.dispose();
634
			busyCursor.dispose();
565
	}
635
	}
Lines 631-636 Link Here
631
		return (ViewItem) viewItemList.get(index);
701
		return (ViewItem) viewItemList.get(index);
632
	}
702
	}
633
	
703
	
704
	/**
705
	 * Returns whether or not this viewer contains the given Control, which
706
	 * is currently in focus.
707
	 * 
708
	 * @param control the Control currently in focus
709
	 * @return whether this viewer contains the given Control or not
710
	 */
711
	public boolean hasFocusControl(Control control) {
712
		return (control == this.control) || (cheatSheetPage.getForm() == control);
713
	}
714
	
634
	private void initCheatSheetView() {
715
	private void initCheatSheetView() {
635
		CheatSheetStopWatch.startStopWatch("CheatSheetViewer.initCheatSheetView()"); //$NON-NLS-1$
716
		CheatSheetStopWatch.startStopWatch("CheatSheetViewer.initCheatSheetView()"); //$NON-NLS-1$
636
		//Re-initialize list to store items collapsed by expand/restore action on c.s. toolbar.
717
		//Re-initialize list to store items collapsed by expand/restore action on c.s. toolbar.
Lines 721-728 Link Here
721
			cheatSheetPage.dispose();
802
			cheatSheetPage.dispose();
722
		}
803
		}
723
	}
804
	}
805
806
	/**
807
	 * Returns whether or not the currently active item requires opening a
808
	 * modal dialog.
809
	 * 
810
	 * @return whether the current item opens a modal dialog
811
	 */
812
	private boolean isInDialogItem() {
813
		ViewItem item = getViewItemAtIndex(currentItemNum);
814
		return item.getItem().isDialog();
815
	}
724
	
816
	
725
	/**
817
	/**
818
	 * Returns whether or not this cheat sheet viewer is inside a modal
819
	 * dialog.
820
	 * 
821
	 * @return whether this viewer is inside a modal dialog
822
	 */
823
	public boolean isInDialogMode() {
824
		return inDialog;
825
	}
826
	
827
	/**
828
	 * Returns whether the given widget is a TrayDialog.
829
	 * 
830
	 * @param widget the widget to check
831
	 * @return whether or not the widget is a TrayDialog
832
	 */
833
	private boolean isTrayDialog(Widget widget) {
834
		return (widget instanceof Shell && ((Shell)widget).getData() instanceof TrayDialog);
835
	}
836
837
	/**
726
	* Read the contents of the welcome page
838
	* Read the contents of the welcome page
727
	*/
839
	*/
728
	private boolean readFile() {
840
	private boolean readFile() {
(-)src/org/eclipse/ui/internal/cheatsheets/views/CoreItem.java (-1 / +8 lines)
Lines 63-69 Link Here
63
	}
63
	}
64
64
65
	private void createButtons(Action action) {
65
	private void createButtons(Action action) {
66
		if (action != null ) {
66
		/*
67
		 * When the cheat sheet is displayed in a dialog's tray, hide
68
		 * the action that was just invoked to open the dialog.
69
		 */
70
		boolean inDialog = isInDialogMode();
71
		boolean isDialogAction = getItem().isDialog();
72
		boolean hideAction = isDialogAction && inDialog;
73
		if (action != null && !hideAction) {
67
			final ImageHyperlink startButton = createButton(buttonComposite, CheatSheetPlugin.getPlugin().getImage(ICheatSheetResource.CHEATSHEET_ITEM_BUTTON_START), this, itemColor, Messages.PERFORM_TASK_TOOLTIP);
74
			final ImageHyperlink startButton = createButton(buttonComposite, CheatSheetPlugin.getPlugin().getImage(ICheatSheetResource.CHEATSHEET_ITEM_BUTTON_START), this, itemColor, Messages.PERFORM_TASK_TOOLTIP);
68
			page.getToolkit().adapt(startButton, true, true);
75
			page.getToolkit().adapt(startButton, true, true);
69
			startButton.addHyperlinkListener(new HyperlinkAdapter() {
76
			startButton.addHyperlinkListener(new HyperlinkAdapter() {
(-)META-INF/MANIFEST.MF (-1 / +2 lines)
Lines 17-21 Link Here
17
 org.eclipse.ui.forms;bundle-version="[3.2.0,4.0.0)",
17
 org.eclipse.ui.forms;bundle-version="[3.2.0,4.0.0)",
18
 org.eclipse.help;bundle-version="[3.1.0,4.0.0)",
18
 org.eclipse.help;bundle-version="[3.1.0,4.0.0)",
19
 org.eclipse.core.runtime;bundle-version="[3.1.0,4.0.0)",
19
 org.eclipse.core.runtime;bundle-version="[3.1.0,4.0.0)",
20
 org.eclipse.help.base;bundle-version="[3.2.0,4.0.0)";resolution:=optional
20
 org.eclipse.help.base;bundle-version="[3.2.0,4.0.0)";resolution:=optional,
21
 org.eclipse.help.ui;bundle-version="[3.2.0,4.0.0)";resolution:=optional
21
Eclipse-LazyStart: true
22
Eclipse-LazyStart: true
(-)src/org/eclipse/ui/internal/cheatsheets/views/CheatSheetHelpPart.java (+150 lines)
Added Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2005 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.cheatsheets.views;
12
13
import org.eclipse.core.runtime.IPath;
14
import org.eclipse.help.ui.internal.views.IHelpPart;
15
import org.eclipse.help.ui.internal.views.ReusableHelpPart;
16
import org.eclipse.jface.action.IAction;
17
import org.eclipse.jface.action.IMenuManager;
18
import org.eclipse.jface.action.IToolBarManager;
19
import org.eclipse.jface.action.Separator;
20
import org.eclipse.jface.resource.ImageDescriptor;
21
import org.eclipse.swt.widgets.Composite;
22
import org.eclipse.swt.widgets.Control;
23
import org.eclipse.ui.IMemento;
24
import org.eclipse.ui.forms.AbstractFormPart;
25
import org.eclipse.ui.forms.widgets.FormToolkit;
26
import org.eclipse.ui.internal.cheatsheets.CheatSheetPlugin;
27
import org.eclipse.ui.internal.cheatsheets.Messages;
28
29
/**
30
 * A help part wrapper that contains a cheat sheet. This is used to display
31
 * cheat sheets inside the ReusableHelpPart.
32
 */
33
public class CheatSheetHelpPart extends AbstractFormPart implements IHelpPart {
34
	
35
	public static final String ID = "cheatsheet-page";
36
	
37
	private CheatSheetViewer viewer;
38
	private String id;
39
	
40
	/**
41
	 * Constructs a new part.
42
	 * 
43
	 * @param parent the parent Composite that will contain the widgets
44
	 * @param toolkit the form toolkit to use for creating the widgets
45
	 * @param tbm the toolbar we will contribute to
46
	 * @param id the unique id of the cheatsheet to display in the part
47
	 */
48
	public CheatSheetHelpPart(Composite parent, FormToolkit toolkit, IToolBarManager tbm, String id) {
49
		viewer = new CheatSheetViewer(true);
50
		viewer.setInput(id);
51
		viewer.createPartControl(parent);
52
		contributeToToolBar(tbm);
53
	}
54
55
	/**
56
	 * Contributes any actions we have to the toolbar.
57
	 * 
58
	 * @param tbm the toolbar to contribute to
59
	 */
60
	private void contributeToToolBar(IToolBarManager tbm) {
61
		IPath path = CheatSheetPlugin.ICONS_PATH.append(CheatSheetPlugin.T_ELCL).append("collapse_expand_all.gif");//$NON-NLS-1$
62
		ImageDescriptor collapseExpandImage = CheatSheetPlugin.createImageDescriptor(CheatSheetPlugin.getPlugin().getBundle(), path);
63
		CheatSheetExpandRestoreAction expandRestoreAction = new CheatSheetExpandRestoreAction(Messages.COLLAPSE_ALL_BUT_CURRENT_TOOLTIP, false, viewer);
64
		expandRestoreAction.setToolTipText(Messages.COLLAPSE_ALL_BUT_CURRENT_TOOLTIP);
65
		expandRestoreAction.setImageDescriptor(collapseExpandImage);
66
		tbm.insertBefore("back", expandRestoreAction); //$NON-NLS-1$
67
		tbm.insertBefore("back", new Separator()); //$NON-NLS-1$
68
		viewer.setExpandRestoreAction(expandRestoreAction);
69
	}
70
	
71
	/**
72
	 * This part doesn't require a context menu.
73
	 */
74
	public boolean fillContextMenu(IMenuManager manager) {
75
		return false;
76
	}
77
	
78
	/**
79
	 * Returns the part's top Control.
80
	 */
81
	public Control getControl() {
82
		return viewer.getControl();
83
	}
84
	
85
	/**
86
	 * This part doesn't use any global actions.
87
	 */
88
	public IAction getGlobalAction(String id) {
89
		return null;
90
	}
91
	
92
	/**
93
	 * Returns the part's unique identifier.
94
	 * 
95
	 * @param the unique id for the part
96
	 */
97
	public String getId() {
98
		return id;
99
	}
100
	
101
	/**
102
	 * Returns whether or not this part contains the given Control, which
103
	 * is in focus.
104
	 * 
105
	 * @param control the Control in focus
106
	 */
107
	public boolean hasFocusControl(Control control) {
108
		return viewer.hasFocusControl(control);
109
	}
110
	
111
	/**
112
	 * Initializes the part.
113
	 */
114
	public void init(ReusableHelpPart parent, String id, IMemento memento) {
115
		this.id = id;
116
	}
117
118
	/**
119
	 * No filtering required.
120
	 */
121
	public void refilter() {
122
	}
123
	
124
	/**
125
	 * The cheat sheet automatically saves its state; no action required.
126
	 */
127
	public void saveState(IMemento memento) {
128
	}
129
	
130
	/**
131
	 * Sets the visibility of the part.
132
	 * 
133
	 * @param whether or not the part should be visible
134
	 */
135
	public void setVisible(boolean visible) {
136
		viewer.getControl().setVisible(visible);
137
	}
138
	
139
	/**
140
	 * No action needed for this part here.
141
	 */
142
	public void stop() {
143
	}
144
	
145
	/**
146
	 * No action needed for this part here.
147
	 */
148
	public void toggleRoleFilter() {
149
	}
150
}
(-)cheatsheets/HelloWorldSWT.xml (+4 lines)
Lines 33-38 Link Here
33
	<item
33
	<item
34
		href="/org.eclipse.platform.doc.isv/samples/org.eclipse.swt.examples/doc-html/swt_manual_setup.html"
34
		href="/org.eclipse.platform.doc.isv/samples/org.eclipse.swt.examples/doc-html/swt_manual_setup.html"
35
		title="Add SWT projects to your workspace"
35
		title="Add SWT projects to your workspace"
36
		dialog="true"
36
		skip="true">
37
		skip="true">
37
		<description>
38
		<description>
38
		Since you are creating a standalone SWT application, you need to download 
39
		Since you are creating a standalone SWT application, you need to download 
Lines 58-63 Link Here
58
	<item
59
	<item
59
		href="/org.eclipse.jdt.doc.user/tasks/tasks-12.htm"
60
		href="/org.eclipse.jdt.doc.user/tasks/tasks-12.htm"
60
		title="Create a Java project"
61
		title="Create a Java project"
62
		dialog="true"
61
		skip="true">
63
		skip="true">
62
		<action
64
		<action
63
			pluginId="org.eclipse.jdt.ui"
65
			pluginId="org.eclipse.jdt.ui"
Lines 76-81 Link Here
76
	<item
78
	<item
77
		href="/org.eclipse.jdt.doc.user/tasks/tasks-110.htm"
79
		href="/org.eclipse.jdt.doc.user/tasks/tasks-110.htm"
78
		title="Configure the Java project"
80
		title="Configure the Java project"
81
		dialog="true"
79
		skip="true">
82
		skip="true">
80
		<description>
83
		<description>
81
			1. Select your Java project and from the context menu select Properties. 
84
			1. Select your Java project and from the context menu select Properties. 
Lines 92-97 Link Here
92
	<item
95
	<item
93
		href="/org.eclipse.jdt.doc.user/gettingStarted/qs-9.htm" 
96
		href="/org.eclipse.jdt.doc.user/gettingStarted/qs-9.htm" 
94
		title="Create the HelloWorld class"
97
		title="Create the HelloWorld class"
98
		dialog="true"
95
		skip="true">
99
		skip="true">
96
		<action
100
		<action
97
			pluginId="org.eclipse.jdt.ui"
101
			pluginId="org.eclipse.jdt.ui"
(-)cheatsheets/HelloWorld.xml (+2 lines)
Lines 31-36 Link Here
31
	<item
31
	<item
32
		href="/org.eclipse.jdt.doc.user/tasks/tasks-12.htm"
32
		href="/org.eclipse.jdt.doc.user/tasks/tasks-12.htm"
33
		title="Create a Java project"
33
		title="Create a Java project"
34
		dialog="true"
34
		skip="true">
35
		skip="true">
35
		<action
36
		<action
36
			pluginId="org.eclipse.jdt.ui"
37
			pluginId="org.eclipse.jdt.ui"
Lines 49-54 Link Here
49
	<item
50
	<item
50
		href="/org.eclipse.jdt.doc.user/gettingStarted/qs-9.htm" 
51
		href="/org.eclipse.jdt.doc.user/gettingStarted/qs-9.htm" 
51
		title="Create your HelloWorld class"
52
		title="Create your HelloWorld class"
53
		dialog="true"
52
		skip="true">
54
		skip="true">
53
		<action
55
		<action
54
			pluginId="org.eclipse.jdt.ui"
56
			pluginId="org.eclipse.jdt.ui"
(-)src/org/eclipse/help/ui/internal/views/ReusableHelpPart.java (-2 / +35 lines)
Lines 269-275 Link Here
269
		}
269
		}
270
	}
270
	}
271
271
272
	private class HelpPartPage {
272
	private class HelpPartPage implements IHelpPartPage {
273
		private String id;
273
		private String id;
274
274
275
		private String iconId;
275
		private String iconId;
Lines 643-649 Link Here
643
			indexerJob.schedule();
643
			indexerJob.schedule();
644
		}
644
		}
645
	}
645
	}
646
646
	
647
	/**
648
	 * Adds the given page to this part.
649
	 * 
650
	 * @param page the page to add
651
	 */
652
	public void addPage(IHelpPartPage page) {
653
		pages.add(page);		
654
	}
655
	
656
	/**
657
	 * Adds the given part to this one. The part can then be used inside
658
	 * any page and referred to by id.
659
	 * 
660
	 * @param id the part's unique id
661
	 * @param part the part to add
662
	 */
663
	public void addPart(String id, IHelpPart part) {
664
		part.init(this, id, memento);
665
		mform.addPart(part);
666
	}
667
	
668
	/**
669
	 * Creates a new page for this part.
670
	 * 
671
	 * @param id the page's unique id
672
	 * @param text the page's heading, or null for none
673
	 * @param iconId the page's icon
674
	 * @return the newly created page
675
	 */
676
	public IHelpPartPage createPage(String id, String text, String iconId) {
677
		return new HelpPartPage(id, text, iconId);
678
	}
679
	
647
	private void definePages() {
680
	private void definePages() {
648
		pages = new ArrayList();
681
		pages = new ArrayList();
649
		// federated search page
682
		// federated search page
(-)src/org/eclipse/help/ui/internal/views/ContextHelpWindow.java (-396 lines)
Removed Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2000, 2005 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
 *     Sebastian Davids <sdavids@gmx.de> - bug 93374
11
 *******************************************************************************/
12
package org.eclipse.help.ui.internal.views;
13
14
import org.eclipse.core.runtime.Platform;
15
import org.eclipse.help.IContext;
16
import org.eclipse.help.ui.internal.IHelpUIConstants;
17
import org.eclipse.help.ui.internal.Messages;
18
import org.eclipse.jface.action.ToolBarManager;
19
import org.eclipse.jface.dialogs.IDialogPage;
20
import org.eclipse.jface.dialogs.IPageChangeProvider;
21
import org.eclipse.jface.dialogs.IPageChangedListener;
22
import org.eclipse.jface.dialogs.PageChangedEvent;
23
import org.eclipse.jface.window.Window;
24
import org.eclipse.swt.SWT;
25
import org.eclipse.swt.events.ControlEvent;
26
import org.eclipse.swt.events.ControlListener;
27
import org.eclipse.swt.graphics.Rectangle;
28
import org.eclipse.swt.layout.GridData;
29
import org.eclipse.swt.layout.GridLayout;
30
import org.eclipse.swt.widgets.Composite;
31
import org.eclipse.swt.widgets.Control;
32
import org.eclipse.swt.widgets.Display;
33
import org.eclipse.swt.widgets.Event;
34
import org.eclipse.swt.widgets.Label;
35
import org.eclipse.swt.widgets.Listener;
36
import org.eclipse.swt.widgets.Shell;
37
import org.eclipse.swt.widgets.TabFolder;
38
import org.eclipse.swt.widgets.TabItem;
39
import org.eclipse.ui.PlatformUI;
40
import org.eclipse.ui.forms.HyperlinkGroup;
41
import org.eclipse.ui.forms.widgets.FormToolkit;
42
43
public class ContextHelpWindow extends Window implements IPageChangedListener {
44
	private ReusableHelpPart helpPart;
45
46
	private static final int DOCK_MARGIN = 10;
47
48
	private static final int CLIP_ALLOWANCE = 5;
49
50
	private FormToolkit toolkit;
51
52
	private Listener listener;
53
54
	private ControlListener parentListener;
55
56
	private Rectangle savedPbounds;
57
58
	private Rectangle savedBounds;
59
60
	private boolean parentResizeBlocked = false;
61
62
	public ContextHelpWindow(Shell parent) {
63
		super(parent);
64
		setShellStyle(SWT.CLOSE | SWT.RESIZE);
65
		if (!Platform.getWS().equals(Platform.WS_GTK)) {
66
			parentListener = new ControlListener() {
67
				public void controlMoved(ControlEvent e) {
68
					maintainRelativePosition();
69
				}
70
71
				public void controlResized(ControlEvent e) {
72
					onParentWindowResize();
73
				}
74
			};
75
			listener = new Listener() {
76
				public void handleEvent(Event e) {
77
					switch (e.type) {
78
					case SWT.FocusIn:
79
					case SWT.Selection:
80
						update((Control) e.widget);
81
						break;
82
					case SWT.Move:
83
						if (onWindowMove())
84
							e.doit = false;
85
						break;
86
					case SWT.Resize:
87
						onWindowResize();
88
						break;
89
					}
90
				}
91
			};
92
		}
93
	}
94
	
95
	public void showSearch() {
96
		helpPart.showPage(IHelpUIConstants.HV_FSEARCH_PAGE, true);
97
	}
98
99
	private void maintainRelativePosition() {
100
		if (savedPbounds == null || isDocked())
101
			dock(true);
102
		else {
103
			Rectangle pbounds = getShell().getParent().getBounds();
104
			Rectangle bounds = getShell().getBounds();
105
			int deltaX = pbounds.x - savedPbounds.x;
106
			int deltaY = pbounds.y - savedPbounds.y;
107
			int newX = bounds.x + deltaX;
108
			int newY = bounds.y + deltaY;
109
			boolean doDock = false;
110
			Rectangle dbounds = getShell().getDisplay().getBounds();
111
			if (newX > dbounds.width - bounds.width) {
112
				newX = dbounds.width - bounds.width;
113
				if (pbounds.x + pbounds.width > newX)
114
					doDock = true;
115
			} else if (newX < 0)
116
				doDock = true;
117
			if (newY > dbounds.height - bounds.height) {
118
				newY = dbounds.height - bounds.height;
119
			} else if (newY < 0)
120
				newY = 0;
121
			if (doDock) {
122
				dock(true);
123
				return;
124
			}
125
			getShell().setLocation(newX, newY);
126
			savedPbounds = pbounds;
127
			savedBounds = getShell().getBounds();
128
		}
129
	}
130
131
	protected Control createContents(Composite parent) {
132
		toolkit = new FormToolkit(parent.getDisplay());
133
		toolkit.getHyperlinkGroup().setHyperlinkUnderlineMode(
134
				HyperlinkGroup.UNDERLINE_HOVER);
135
		toolkit.getColors().initializeSectionToolBarColors();
136
		Composite container = new Composite(parent, SWT.NULL);
137
		GridLayout layout = new GridLayout();
138
		layout.marginWidth = layout.marginHeight = 0;
139
		layout.verticalSpacing = 0;
140
		container.setLayout(layout);
141
142
		GridData gd;
143
		ToolBarManager tbm = new ToolBarManager(SWT.FLAT);
144
		tbm.createControl(container);
145
		gd = new GridData(GridData.HORIZONTAL_ALIGN_END);
146
		gd.grabExcessHorizontalSpace = true;
147
		tbm.getControl().setLayoutData(gd);
148
		Label separator = new Label(container, SWT.SEPARATOR | SWT.HORIZONTAL);
149
		gd = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
150
		gd.heightHint = 1;
151
		separator.setLayoutData(gd);
152
		helpPart = new ReusableHelpPart(PlatformUI.getWorkbench()
153
				.getProgressService());
154
		helpPart.init(null, tbm, null, null);
155
		helpPart.setDefaultContextHelpText(Messages.HelpView_defaultText); //		
156
		helpPart.createControl(container, toolkit);
157
		helpPart.getControl().setLayoutData(new GridData(GridData.FILL_BOTH));
158
		if (!Platform.getWS().equals(Platform.WS_GTK)) 
159
			hookListeners();
160
		helpPart.showPage(IHelpUIConstants.HV_CONTEXT_HELP_PAGE);
161
		container.setLayoutData(new GridData(GridData.FILL_BOTH));
162
		return container;
163
	}
164
165
	private void hookListeners() {
166
		Shell shell = getShell();
167
		shell.addListener(SWT.Move, listener);
168
		shell.addListener(SWT.Resize, listener);
169
		hookPageChangeListener(shell.getParent(), listener);
170
		shell.getParent().addControlListener(parentListener);
171
	}
172
173
	private void unhookListeners() {
174
		Shell shell = getShell();
175
		shell.getParent().removeControlListener(parentListener);
176
		unhookPageChangeListener(shell.getParent(), listener);
177
		shell.removeListener(SWT.Move, listener);
178
		shell.removeListener(SWT.Resize, listener);
179
	}
180
181
	private void hookPageChangeListener(Composite parent, Listener listener) {
182
		Object data = parent.getData();
183
		if (data instanceof IPageChangeProvider) {
184
			((IPageChangeProvider) data).addPageChangedListener(this);
185
		}
186
	}
187
188
	private void unhookPageChangeListener(Composite parent, Listener listener) {
189
		Object data = parent.getData();
190
		if (data instanceof IPageChangeProvider) {
191
			((IPageChangeProvider) data).removePageChangedListener(this);
192
		}
193
	}
194
195
	public void dock(boolean changeSides) {
196
		getShell().setBounds(computeDockedBounds(changeSides));
197
	}
198
199
	public Rectangle computeDockedBounds(boolean changeSides) {
200
		Display d = getShell().getDisplay();
201
		Rectangle dbounds = d.getBounds();
202
		Rectangle pbounds = getShell().getParent().getBounds();
203
204
		int leftMargin = pbounds.x;
205
		int rightMargin = dbounds.width - pbounds.x - pbounds.width;
206
		int centeredLeftMargin = dbounds.width / 2 - pbounds.width / 2;
207
		boolean rightParent = leftMargin > centeredLeftMargin;
208
		int currentX = getShell().getLocation().x;
209
		int newSize = getShell().getSize().x;
210
		boolean leftOK = newSize <= leftMargin + CLIP_ALLOWANCE;
211
		boolean rightOK = newSize <= rightMargin + CLIP_ALLOWANCE;
212
		int x;
213
		// first try to keep the same side
214
		if (currentX < pbounds.x && leftOK && (!changeSides || !rightParent)) {
215
			x = pbounds.x - newSize;
216
		} else if (currentX > pbounds.x && rightOK
217
				&& (!changeSides || rightParent)) {
218
			x = pbounds.x + pbounds.width;
219
		}
220
		// must switch side
221
		else if (changeSides) {
222
			if (rightOK)
223
				x = pbounds.x + pbounds.width;
224
			else if (leftOK)
225
				x = pbounds.x - newSize;
226
			else {
227
				// pick the margin that has more space, reduce size
228
				if (leftMargin > rightMargin) {
229
					newSize = leftMargin;
230
					x = pbounds.x - newSize;
231
				} else {
232
					newSize = rightMargin;
233
					x = dbounds.width - newSize;
234
				}
235
			}
236
		} else {
237
			if (currentX < pbounds.x) {
238
				newSize = leftMargin;
239
				x = pbounds.x - newSize;
240
			} else {
241
				newSize = rightMargin;
242
				x = dbounds.width - newSize;
243
			}
244
		}
245
		savedPbounds = pbounds;
246
		savedBounds = getShell().getBounds();
247
		return new Rectangle(x, pbounds.y, newSize, pbounds.height);
248
	}
249
250
	private boolean onWindowMove() {
251
		if (savedBounds == null) {
252
			savedBounds = getShell().getBounds();
253
			savedPbounds = getShell().getParent().getBounds();
254
			return false;
255
		}
256
		Rectangle bounds = getShell().getBounds();
257
		Rectangle pbounds = getShell().getParent().getBounds();
258
		if (bounds.y != savedBounds.y) {
259
			// vertical move
260
			if (bounds.y + bounds.height == savedBounds.y + savedBounds.height) {
261
				// upper edge resize
262
				if (isDocked()) {
263
					savedBounds = bounds;
264
					savedPbounds = pbounds;
265
					return false;
266
				}
267
			}
268
		}
269
		boolean doDock = false;
270
271
		if (bounds.x < pbounds.x) {
272
			// left
273
			int deltaX = bounds.x - savedBounds.x;
274
			if (deltaX > 0 || bounds.x + bounds.width > pbounds.x) {
275
				// moving closer - check for dock snap
276
				int distance = pbounds.x - bounds.x - bounds.width;
277
				if (Math.abs(distance) <= DOCK_MARGIN)
278
					doDock = true;
279
			}
280
		} else {
281
			// right
282
			int deltaX = bounds.x - savedBounds.x;
283
			if (deltaX < 0 || bounds.x < pbounds.x + pbounds.width) {
284
				// moving closer - check for dock snap
285
				int distance = bounds.x - pbounds.x - pbounds.width;
286
				if (Math.abs(distance) <= DOCK_MARGIN)
287
					doDock = true;
288
			}
289
		}
290
		if (bounds.y + bounds.height < pbounds.y) // above
291
			doDock = false;
292
		if (pbounds.y + pbounds.height < bounds.y) // below
293
			doDock = false;
294
		if (doDock)
295
			dock(false);
296
		savedBounds = getShell().getBounds();
297
		savedPbounds = getShell().getParent().getBounds();
298
		return doDock;
299
	}
300
301
	private void onWindowResize() {
302
		if (isDocked()) {
303
			Rectangle bounds = getShell().getBounds();
304
			Rectangle pbounds = getShell().getParent().getBounds();
305
			if (bounds.height != savedBounds.height) {
306
				Shell parent = (Shell) getShell().getParent();
307
				if ((parent.getStyle() & SWT.RESIZE) != 0) {
308
					parentResizeBlocked = true;
309
					parent.setBounds(pbounds.x, bounds.y, pbounds.width,
310
							bounds.height);
311
					parentResizeBlocked = false;
312
				}
313
			}
314
		}
315
		savedBounds = getShell().getBounds();
316
	}
317
318
	private void onParentWindowResize() {
319
		if (!parentResizeBlocked && isDocked()) {
320
			Rectangle bounds = getShell().getBounds();
321
			Rectangle pbounds = getShell().getParent().getBounds();
322
			if (bounds.x == savedPbounds.x + savedPbounds.width) {
323
				// right
324
				if (savedPbounds.x + savedPbounds.width != pbounds.x
325
						+ pbounds.width)
326
					// right edge moved
327
					dock(false);
328
			} else {
329
			}
330
			getShell().setSize(getShell().getSize().x,
331
					getShell().getParent().getSize().y);
332
		}
333
		savedPbounds = getShell().getParent().getBounds();
334
	}
335
336
	public void update(Control c) {
337
		helpPart.update(null, c);
338
	}
339
340
	public void update(IContext context, Control c) {
341
		helpPart.showPage(IHelpUIConstants.HV_CONTEXT_HELP_PAGE);
342
		helpPart.update(context, null, c);
343
	}
344
345
	public boolean close() {
346
		if (!Platform.getWS().equals(Platform.WS_GTK)) 
347
			unhookListeners();
348
		if (super.close()) {
349
			if (toolkit != null) {
350
				toolkit.dispose();
351
				toolkit = null;
352
			}
353
			if (helpPart != null) {
354
				helpPart.dispose();
355
				helpPart = null;
356
			}
357
			return true;
358
		}
359
		return false;
360
	}
361
362
	private boolean isDocked() {
363
		if (savedPbounds == null)
364
			return false;
365
		return isDocked(savedBounds, savedPbounds);
366
	}
367
368
	private boolean isDocked(Rectangle bounds, Rectangle pbounds) {
369
		if (pbounds.height != bounds.height)
370
			return false;
371
		if (bounds.y + bounds.height < pbounds.y) // above
372
			return false;
373
		if (pbounds.y + pbounds.height < bounds.y) // below
374
			return false;
375
		return bounds.x == pbounds.x + pbounds.width
376
				|| bounds.x == pbounds.x - bounds.width;
377
	}
378
379
	public void pageChanged(PageChangedEvent event) {
380
		Object page = event.getSelectedPage();
381
		Control c = null;
382
		if (page instanceof IDialogPage) {
383
			c = ((IDialogPage) page).getControl();
384
		} else {
385
			c = getShell().getDisplay().getFocusControl();
386
			if (c instanceof TabFolder) {
387
				TabFolder folder = (TabFolder) c;
388
				TabItem[] selection = folder.getSelection();
389
				if (selection.length == 1) {
390
					c = selection[0].getControl();
391
				}
392
			}
393
		}
394
		update(null, c);
395
	}
396
}
(-)src/org/eclipse/help/ui/internal/Messages.properties (+1 lines)
Lines 71-76 Link Here
71
ReusableHelpPart_internalWebBrowserError=Error while opening internal web browser
71
ReusableHelpPart_internalWebBrowserError=Error while opening internal web browser
72
ReusableHelpPart_openInHelpContentsAction_label=Open in Help &Contents
72
ReusableHelpPart_openInHelpContentsAction_label=Open in Help &Contents
73
ReusableHelpPart_copyAction_label=&Copy
73
ReusableHelpPart_copyAction_label=&Copy
74
ReusableHelpPart_closeAction_tooltip=Close
74
ReusableHelpPart_bookmarkAction_label=&Add Bookmark
75
ReusableHelpPart_bookmarkAction_label=&Add Bookmark
75
ReusableHelpPart_internalBrowserTitle=Help
76
ReusableHelpPart_internalBrowserTitle=Help
76
ReusableHelpPart_status = {0} - {1}
77
ReusableHelpPart_status = {0} - {1}
(-)src/org/eclipse/help/ui/internal/DefaultHelpUI.java (-38 / +28 lines)
Lines 11-17 Link Here
11
11
12
import java.net.URL;
12
import java.net.URL;
13
13
14
import org.eclipse.core.runtime.Platform;
15
import org.eclipse.core.runtime.Preferences;
14
import org.eclipse.core.runtime.Preferences;
16
import org.eclipse.help.IContext;
15
import org.eclipse.help.IContext;
17
import org.eclipse.help.browser.IBrowser;
16
import org.eclipse.help.browser.IBrowser;
Lines 20-33 Link Here
20
import org.eclipse.help.internal.base.IHelpBaseConstants;
19
import org.eclipse.help.internal.base.IHelpBaseConstants;
21
import org.eclipse.help.ui.internal.util.ErrorUtil;
20
import org.eclipse.help.ui.internal.util.ErrorUtil;
22
import org.eclipse.help.ui.internal.views.ContextHelpPart;
21
import org.eclipse.help.ui.internal.views.ContextHelpPart;
23
import org.eclipse.help.ui.internal.views.ContextHelpWindow;
22
import org.eclipse.help.ui.internal.views.HelpTray;
24
import org.eclipse.help.ui.internal.views.HelpView;
23
import org.eclipse.help.ui.internal.views.HelpView;
24
import org.eclipse.help.ui.internal.views.ReusableHelpPart;
25
import org.eclipse.jface.dialogs.DialogTray;
25
import org.eclipse.jface.dialogs.MessageDialog;
26
import org.eclipse.jface.dialogs.MessageDialog;
27
import org.eclipse.jface.dialogs.TrayDialog;
26
import org.eclipse.jface.window.Window;
28
import org.eclipse.jface.window.Window;
27
import org.eclipse.swt.SWT;
29
import org.eclipse.swt.SWT;
28
import org.eclipse.swt.events.DisposeEvent;
29
import org.eclipse.swt.events.DisposeListener;
30
import org.eclipse.swt.graphics.Rectangle;
31
import org.eclipse.swt.widgets.Control;
30
import org.eclipse.swt.widgets.Control;
32
import org.eclipse.swt.widgets.Display;
31
import org.eclipse.swt.widgets.Display;
33
import org.eclipse.swt.widgets.Shell;
32
import org.eclipse.swt.widgets.Shell;
Lines 55-61 Link Here
55
public class DefaultHelpUI extends AbstractHelpUI {
54
public class DefaultHelpUI extends AbstractHelpUI {
56
55
57
	private ContextHelpDialog f1Dialog = null;
56
	private ContextHelpDialog f1Dialog = null;
58
	private ContextHelpWindow f1Window = null;
59
	private static DefaultHelpUI instance;
57
	private static DefaultHelpUI instance;
60
58
61
	private static final String HELP_VIEW_ID = "org.eclipse.help.ui.HelpView"; //$NON-NLS-1$
59
	private static final String HELP_VIEW_ID = "org.eclipse.help.ui.HelpView"; //$NON-NLS-1$
Lines 160-168 Link Here
160
				// check the dialog
158
				// check the dialog
161
				if (activeShell != null) {
159
				if (activeShell != null) {
162
					Object data = activeShell.getData();
160
					Object data = activeShell.getData();
163
					if (data instanceof Window) {
161
					if (data instanceof TrayDialog) {
164
						IContext context = ContextHelpPart.findHelpContext(c);
162
						IContext context = ContextHelpPart.findHelpContext(c);
165
						displayContextAsHelpPane(activeShell, context);
163
						displayContextAsHelpTray(activeShell, context);
166
						return;
164
						return;
167
					}
165
					}
168
				}
166
				}
Lines 199-205 Link Here
199
				if (activeShell != null) {
197
				if (activeShell != null) {
200
					Object data = activeShell.getData();
198
					Object data = activeShell.getData();
201
					if (data instanceof Window) {
199
					if (data instanceof Window) {
202
						displayContextAsHelpPane(activeShell, null);
200
						displayContextAsHelpTray(activeShell, null);
203
						return;
201
						return;
204
					}
202
					}
205
				}
203
				}
Lines 277-283 Link Here
277
		if (activeShell != null) {
275
		if (activeShell != null) {
278
			Object data = activeShell.getData();
276
			Object data = activeShell.getData();
279
			if (data instanceof Window && (!dinfopop || noInfopop)) {
277
			if (data instanceof Window && (!dinfopop || noInfopop)) {
280
				displayContextAsHelpPane(activeShell, context);
278
				displayContextAsHelpTray(activeShell, context);
281
				return;
279
				return;
282
			}
280
			}
283
		}
281
		}
Lines 322-357 Link Here
322
		f1Dialog.open();
320
		f1Dialog.open();
323
	}
321
	}
324
322
325
	private void displayContextAsHelpPane(Shell activeShell, IContext context) {
323
	private void displayContextAsHelpTray(Shell activeShell, IContext context) {
326
		Control c = activeShell.getDisplay().getFocusControl();
324
		Control controlInFocus = activeShell.getDisplay().getFocusControl();
327
		if (f1Window != null) {
325
		TrayDialog dialog = (TrayDialog)activeShell.getData();
328
			Shell parentShell = activeShell;
326
		
329
			if (activeShell.getData() instanceof ContextHelpWindow)
327
		DialogTray tray = dialog.getTray();
330
				parentShell = (Shell) activeShell.getParent();
328
		if (tray == null) {
331
			if (f1Window.getShell().getParent().equals(parentShell)) {
329
			tray = new HelpTray();
332
				f1Window.update(context, c);
330
			dialog.openTray(tray);
333
				return;
331
		}
332
		if (tray instanceof HelpTray) {
333
			ReusableHelpPart helpPart = ((HelpTray)tray).getHelpPart();
334
			if (context != null) {
335
				helpPart.showPage(IHelpUIConstants.HV_CONTEXT_HELP_PAGE);
336
				helpPart.update(context, null, controlInFocus);
334
			}
337
			}
335
		}
338
			else {
336
		Rectangle pbounds = activeShell.getBounds();
339
				helpPart.showPage(IHelpUIConstants.HV_FSEARCH_PAGE, true);
337
		f1Window = new ContextHelpWindow(activeShell);
338
		f1Window.create();
339
		Shell helpShell = f1Window.getShell();
340
		helpShell.setText(Messages.DefaultHelpUI_wtitle);
341
		helpShell.setSize(300, pbounds.height);
342
		if (context != null)
343
			f1Window.update(context, c);
344
		else
345
			f1Window.showSearch();
346
		if (!Platform.getWS().equals(Platform.WS_GTK))
347
			f1Window.dock(true);
348
		helpShell.addDisposeListener(new DisposeListener() {
349
350
			public void widgetDisposed(DisposeEvent e) {
351
				f1Window = null;
352
			}
340
			}
353
		});
341
		}
354
		helpShell.open();
342
		else {
343
			// someone else was occupying the tray; not supported
344
		}
355
	}
345
	}
356
346
357
	/**
347
	/**
(-)src/org/eclipse/help/ui/internal/Messages.java (+1 lines)
Lines 55-60 Link Here
55
	public static String ReusableHelpPart_openInfoCenterAction_label;
55
	public static String ReusableHelpPart_openInfoCenterAction_label;
56
	public static String ReusableHelpPart_openAction_label;
56
	public static String ReusableHelpPart_openAction_label;
57
	public static String ReusableHelpPart_openInHelpContentsAction_label;
57
	public static String ReusableHelpPart_openInHelpContentsAction_label;
58
	public static String ReusableHelpPart_closeAction_tooltip;
58
	public static String ReusableHelpPart_copyAction_label;
59
	public static String ReusableHelpPart_copyAction_label;
59
	public static String ReusableHelpPart_bookmarkAction_label;
60
	public static String ReusableHelpPart_bookmarkAction_label;
60
	public static String ReusableHelpPart_status;
61
	public static String ReusableHelpPart_status;
(-)META-INF/MANIFEST.MF (-1 / +1 lines)
Lines 13-19 Link Here
13
 org.eclipse.help.ui.internal.browser.embedded;x-internal:=true,
13
 org.eclipse.help.ui.internal.browser.embedded;x-internal:=true,
14
 org.eclipse.help.ui.internal.search;x-internal:=true,
14
 org.eclipse.help.ui.internal.search;x-internal:=true,
15
 org.eclipse.help.ui.internal.util;x-internal:=true,
15
 org.eclipse.help.ui.internal.util;x-internal:=true,
16
 org.eclipse.help.ui.internal.views;x-internal:=true
16
 org.eclipse.help.ui.internal.views;x-friends:="org.eclipse.ui.cheatsheets"
17
Require-Bundle: org.eclipse.help.base;bundle-version="[3.1.0,4.0.0)",
17
Require-Bundle: org.eclipse.help.base;bundle-version="[3.1.0,4.0.0)",
18
 org.eclipse.help.appserver;bundle-version="[3.1.0,4.0.0)",
18
 org.eclipse.help.appserver;bundle-version="[3.1.0,4.0.0)",
19
 org.eclipse.ui;bundle-version="[3.2.0,4.0.0)",
19
 org.eclipse.ui;bundle-version="[3.2.0,4.0.0)",
(-)src/org/eclipse/help/ui/internal/views/HelpTray.java (+249 lines)
Added Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2005 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.help.ui.internal.views;
12
13
import org.eclipse.help.ui.internal.IHelpUIConstants;
14
import org.eclipse.help.ui.internal.Messages;
15
import org.eclipse.jface.action.ContributionItem;
16
import org.eclipse.jface.action.IContributionItem;
17
import org.eclipse.jface.action.ToolBarManager;
18
import org.eclipse.jface.dialogs.DialogTray;
19
import org.eclipse.jface.dialogs.IDialogPage;
20
import org.eclipse.jface.dialogs.IPageChangeProvider;
21
import org.eclipse.jface.dialogs.IPageChangedListener;
22
import org.eclipse.jface.dialogs.PageChangedEvent;
23
import org.eclipse.jface.dialogs.TrayDialog;
24
import org.eclipse.swt.SWT;
25
import org.eclipse.swt.graphics.Color;
26
import org.eclipse.swt.graphics.GC;
27
import org.eclipse.swt.graphics.Image;
28
import org.eclipse.swt.graphics.ImageData;
29
import org.eclipse.swt.graphics.PaletteData;
30
import org.eclipse.swt.graphics.RGB;
31
import org.eclipse.swt.layout.GridData;
32
import org.eclipse.swt.layout.GridLayout;
33
import org.eclipse.swt.widgets.Composite;
34
import org.eclipse.swt.widgets.Control;
35
import org.eclipse.swt.widgets.Display;
36
import org.eclipse.swt.widgets.Event;
37
import org.eclipse.swt.widgets.Label;
38
import org.eclipse.swt.widgets.Listener;
39
import org.eclipse.swt.widgets.Shell;
40
import org.eclipse.swt.widgets.TabFolder;
41
import org.eclipse.swt.widgets.TabItem;
42
import org.eclipse.swt.widgets.ToolBar;
43
import org.eclipse.swt.widgets.ToolItem;
44
import org.eclipse.ui.PlatformUI;
45
import org.eclipse.ui.forms.HyperlinkGroup;
46
import org.eclipse.ui.forms.widgets.FormToolkit;
47
48
/**
49
 * The tray that appears on the side of dialogs when the user summons context
50
 * help or a cheat sheet follows the user into a dialog.
51
 */
52
public class HelpTray extends DialogTray implements IPageChangedListener {
53
	
54
	private static final int DEFAULT_WIDTH = 210;
55
	private FormToolkit toolkit;
56
	private ReusableHelpPart helpPart;
57
	private Shell shell;
58
	private IContributionItem closeAction;
59
	private Image normal;
60
	private Image hover;
61
	
62
	/**
63
	 * Creates any actions needed by the tray.
64
	 */
65
	private void createActions() {
66
		createImages();
67
		closeAction = new ContributionItem() {
68
			public void fill(ToolBar parent, int index) {
69
				final ToolItem item = new ToolItem(parent, SWT.PUSH);
70
				item.setImage(normal);
71
				item.setHotImage(hover);
72
				item.setToolTipText(Messages.ReusableHelpPart_closeAction_tooltip);
73
				item.addListener(SWT.Selection, new Listener() {
74
					public void handleEvent(Event event) {
75
						TrayDialog dialog = (TrayDialog)shell.getData();
76
						dialog.closeTray();
77
					}
78
				});
79
			}
80
		};
81
	}
82
	
83
	/**
84
	 * Creates the contents of the tray.
85
	 * 
86
	 * @param parent the parent composite that will contain the tray
87
	 */
88
	protected Control createContents(Composite parent) {
89
		toolkit = new FormToolkit(parent.getDisplay());
90
		toolkit.getHyperlinkGroup().setHyperlinkUnderlineMode(HyperlinkGroup.UNDERLINE_HOVER);
91
		toolkit.getColors().initializeSectionToolBarColors();
92
		Composite container = new Composite(parent, SWT.NONE);
93
		GridLayout layout = new GridLayout();
94
		layout.marginWidth = layout.marginHeight = 0;
95
		layout.verticalSpacing = 0;
96
		container.setLayout(layout);
97
		container.addListener(SWT.Dispose, new Listener() {
98
			public void handleEvent(Event event) {
99
				dispose();
100
			}
101
		});
102
		
103
		ToolBarManager tbm = new ToolBarManager(SWT.FLAT);
104
		tbm.createControl(container);
105
		GridData gd = new GridData(GridData.HORIZONTAL_ALIGN_END);
106
		gd.grabExcessHorizontalSpace = true;
107
		tbm.getControl().setLayoutData(gd);
108
		Label separator = new Label(container, SWT.SEPARATOR | SWT.HORIZONTAL);
109
		gd = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
110
		gd.heightHint = 1;
111
		separator.setLayoutData(gd);
112
		helpPart = new ReusableHelpPart(PlatformUI.getWorkbench().getProgressService());
113
		helpPart.init(null, tbm, null, null);
114
		helpPart.setDefaultContextHelpText(Messages.HelpView_defaultText);
115
		helpPart.createControl(container, toolkit);
116
		gd = new GridData(GridData.FILL_BOTH);
117
		gd.widthHint = DEFAULT_WIDTH;
118
		helpPart.getControl().setLayoutData(gd);
119
		
120
		createActions();
121
		tbm.add(closeAction);
122
		
123
		shell = parent.getShell();
124
		hookPageChangeListener(shell);
125
		helpPart.getControl().addListener(SWT.Dispose, new Listener() {
126
			public void handleEvent(Event event) {
127
				unhookPageChangeListener(shell);
128
			}
129
		});
130
		
131
		return container;
132
	}
133
134
	/**
135
	 * Creates any custom needed by the tray, such as the close button.
136
	 */
137
	private void createImages() {
138
		Display display = Display.getCurrent();
139
		int[] shape = new int[] { 
140
				3,  3, 5,  3, 7,  5, 8,  5, 10, 3, 12, 3, 
141
				12, 5, 10, 7, 10, 8, 12,10, 12,12,
142
				10,12, 8, 10, 7, 10, 5, 12, 3, 12,
143
				3, 10, 5,  8, 5,  7, 3,  5
144
		};
145
		
146
		/*
147
		 * Use magenta as transparency color since it is used infrequently.
148
		 */
149
		Color border = display.getSystemColor(SWT.COLOR_WIDGET_DARK_SHADOW);
150
		Color background = display.getSystemColor(SWT.COLOR_LIST_BACKGROUND);
151
		Color backgroundHot = new Color(display, new RGB(252, 160, 160));
152
		Color transparent = display.getSystemColor(SWT.COLOR_MAGENTA);
153
154
		PaletteData palette = new PaletteData(new RGB[] { transparent.getRGB(), border.getRGB(), background.getRGB(), backgroundHot.getRGB() });
155
		ImageData data = new ImageData(16, 16, 8, palette);
156
		data.transparentPixel = 0;
157
158
		normal = new Image(display, data);
159
		normal.setBackground(transparent);
160
		GC gc = new GC(normal);
161
		gc.setBackground(background);
162
		gc.fillPolygon(shape);
163
		gc.setForeground(border);
164
		gc.drawPolygon(shape);
165
		gc.dispose();
166
167
		hover = new Image(display, data);
168
		hover.setBackground(transparent);
169
		gc = new GC(hover);
170
		gc.setBackground(backgroundHot);
171
		gc.fillPolygon(shape);
172
		gc.setForeground(border);
173
		gc.drawPolygon(shape);
174
		gc.dispose();
175
		
176
		backgroundHot.dispose();
177
	}
178
179
	/**
180
	 * Disposes any resources used by the tray.
181
	 */
182
	private void dispose() {
183
		normal.dispose();
184
		hover.dispose();
185
		toolkit.dispose();
186
		helpPart.dispose();
187
	}
188
189
	/**
190
	 * Returns the ReusableHelpPart contained in the tray.
191
	 * 
192
	 * @return the tray's ReusableHelpPart
193
	 */
194
	public ReusableHelpPart getHelpPart() {
195
		return helpPart;
196
	}
197
	
198
	/**
199
	 * Add the listener that gets notified of page changes (to automatically
200
	 * update context help).
201
	 * 
202
	 * @param parent the Composite to hook the listener to
203
	 */
204
	private void hookPageChangeListener(Composite parent) {
205
		Object data = parent.getData();
206
		if (data instanceof IPageChangeProvider) {
207
			((IPageChangeProvider)data).addPageChangedListener(this);
208
		}
209
	}
210
211
	/**
212
	 * Called whenever the dialog we're inside has changed pages. This updates
213
	 * the context help page if it is visible.
214
	 * 
215
	 * @param event the page change event
216
	 */
217
	public void pageChanged(PageChangedEvent event) {
218
		if (IHelpUIConstants.HV_CONTEXT_HELP_PAGE.equals(helpPart.getCurrentPageId())) {
219
			Object page = event.getSelectedPage();
220
			Control c = null;
221
			if (page instanceof IDialogPage) {
222
				c = ((IDialogPage) page).getControl();
223
			} else {
224
				c = shell.getDisplay().getFocusControl();
225
				if (c instanceof TabFolder) {
226
					TabFolder folder = (TabFolder) c;
227
					TabItem[] selection = folder.getSelection();
228
					if (selection.length == 1) {
229
						c = selection[0].getControl();
230
					}
231
				}
232
			}
233
			helpPart.update(null, null, c);
234
		}
235
	}
236
	
237
	/**
238
	 * Remove the listener that gets notified of page changes (to automatically
239
	 * update context help).
240
	 * 
241
	 * @param parent the Composite that had the listener
242
	 */
243
	private void unhookPageChangeListener(Composite parent) {
244
		Object data = parent.getData();
245
		if (data instanceof IPageChangeProvider) {
246
			((IPageChangeProvider)data).removePageChangedListener(this);
247
		}
248
	}
249
}
(-)src/org/eclipse/help/ui/internal/views/IHelpPartPage.java (+37 lines)
Added Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2005 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.help.ui.internal.views;
12
13
import org.eclipse.jface.action.IToolBarManager;
14
import org.eclipse.ui.IMemento;
15
16
public interface IHelpPartPage {
17
	void addPart(String id, boolean flexible);
18
	void addPart(String id, boolean flexible, boolean grabVertical);
19
	boolean canOpen();
20
	void dispose();
21
	IHelpPart findPart(String id);
22
	int getHorizontalMargin();
23
	String getIconId();
24
	String getId();
25
	int getNumberOfFlexibleParts();
26
	String getText();
27
	IToolBarManager getToolBarManager();
28
	int getVerticalSpacing();
29
	void refilter();
30
	void saveState(IMemento memento);
31
	void setFocus();
32
	void setHorizontalMargin(int value);
33
	void setVerticalSpacing(int value);
34
	void setVisible(boolean visible);
35
	void stop();
36
	void toggleRoleFilter();
37
}
(-)cheatsheets/updates.xml (+6 lines)
Lines 31-36 Link Here
31
	<item
31
	<item
32
		href="/org.eclipse.pde.doc.user/guide/pde_creating.htm"
32
		href="/org.eclipse.pde.doc.user/guide/pde_creating.htm"
33
		title="Creating the plug-in project"
33
		title="Creating the plug-in project"
34
		dialog="true"
34
		skip="true">
35
		skip="true">
35
		<action
36
		<action
36
			pluginId="org.eclipse.pde.ui"
37
			pluginId="org.eclipse.pde.ui"
Lines 49-54 Link Here
49
	<item
50
	<item
50
		href="/org.eclipse.pde.doc.user/guide/pde_feature_setup.htm"
51
		href="/org.eclipse.pde.doc.user/guide/pde_feature_setup.htm"
51
		title="Creating the feature project"
52
		title="Creating the feature project"
53
		dialog="true"
52
		skip="true">
54
		skip="true">
53
		<action
55
		<action
54
			pluginId="org.eclipse.pde.ui"
56
			pluginId="org.eclipse.pde.ui"
Lines 83-88 Link Here
83
	<item
85
	<item
84
		href="/org.eclipse.pde.doc.user/guide/pde_site_setup.htm"
86
		href="/org.eclipse.pde.doc.user/guide/pde_site_setup.htm"
85
		title="Creating an update site project"
87
		title="Creating an update site project"
88
		dialog="true"
86
		skip="true">
89
		skip="true">
87
		<action
90
		<action
88
			pluginId="org.eclipse.pde.ui"
91
			pluginId="org.eclipse.pde.ui"
Lines 144-149 Link Here
144
	</item>
147
	</item>
145
	<item
148
	<item
146
		href="/org.eclipse.pde.doc.user/guide/pde_site_previewing.htm"
149
		href="/org.eclipse.pde.doc.user/guide/pde_site_previewing.htm"
150
		dialog="true"
147
		title="Testing the update site">
151
		title="Testing the update site">
148
		<action
152
		<action
149
			pluginId="org.eclipse.ui.ide"
153
			pluginId="org.eclipse.ui.ide"
Lines 168-173 Link Here
168
	</item>
172
	</item>
169
	<item
173
	<item
170
		href="/org.eclipse.pde.doc.user/guide/pde_site_previewing.htm"
174
		href="/org.eclipse.pde.doc.user/guide/pde_site_previewing.htm"
175
		dialog="true"
171
		title="Installing the feature">
176
		title="Installing the feature">
172
		<description>
177
		<description>
173
		   	When ready to test the feature itself, install
178
		   	When ready to test the feature itself, install
Lines 181-186 Link Here
181
	</item>
186
	</item>
182
	<item
187
	<item
183
		href="/org.eclipse.pde.doc.user/guide/pde_site_previewing.htm"
188
		href="/org.eclipse.pde.doc.user/guide/pde_site_previewing.htm"
189
		dialog="true"
184
		title="Verifying the installation">
190
		title="Verifying the installation">
185
		<description>
191
		<description>
186
			Upon restart, select <b>Help-&gt;Software Updates-&gt;Manage Configuration...</b>.
192
			Upon restart, select <b>Help-&gt;Software Updates-&gt;Manage Configuration...</b>.
(-)cheatsheets/rcpapp.xml (+3 lines)
Lines 15-20 Link Here
15
15
16
	<item
16
	<item
17
		href="/org.eclipse.pde.doc.user/guide/rcp_project.htm" 
17
		href="/org.eclipse.pde.doc.user/guide/rcp_project.htm" 
18
		dialog="true"
18
		title="Creating a New Plug-in Project">
19
		title="Creating a New Plug-in Project">
19
		<action
20
		<action
20
			pluginId="org.eclipse.pde.ui"
21
			pluginId="org.eclipse.pde.ui"
Lines 40-45 Link Here
40
    
41
    
41
	<item
42
	<item
42
		href="/org.eclipse.pde.doc.user/guide/product_configuration.htm"
43
		href="/org.eclipse.pde.doc.user/guide/product_configuration.htm"
44
		dialog="true"
43
		title="Defining a product configuration">
45
		title="Defining a product configuration">
44
		<action 
46
		<action 
45
			pluginId="org.eclipse.pde.ui"
47
			pluginId="org.eclipse.pde.ui"
Lines 69-74 Link Here
69
71
70
	<item
72
	<item
71
		href="/org.eclipse.pde.doc.user/guide/product_export.htm"
73
		href="/org.eclipse.pde.doc.user/guide/product_export.htm"
74
		dialog="true"
72
		title="Exporting a Rich Client Application">
75
		title="Exporting a Rich Client Application">
73
		<description>
76
		<description>
74
			The product configuration editor also allows you to export RCP
77
			The product configuration editor also allows you to export RCP
(-)cheatsheets/helloworld.xml (+4 lines)
Lines 16-21 Link Here
16
16
17
	<item
17
	<item
18
		href="/org.eclipse.pde.doc.user/guide/pde_configuring.htm"
18
		href="/org.eclipse.pde.doc.user/guide/pde_configuring.htm"
19
		dialog="true"
19
		title="Configuring PDE">
20
		title="Configuring PDE">
20
		<action
21
		<action
21
			pluginId="org.eclipse.pde.ui"
22
			pluginId="org.eclipse.pde.ui"
Lines 52-57 Link Here
52
	<item
53
	<item
53
		href="/org.eclipse.pde.doc.user/guide/pde_creating.htm" 
54
		href="/org.eclipse.pde.doc.user/guide/pde_creating.htm" 
54
		title="Creating a New Plug-in Project"
55
		title="Creating a New Plug-in Project"
56
		dialog="true"
55
		skip="true">
57
		skip="true">
56
		<action
58
		<action
57
			pluginId="org.eclipse.pde.ui"
59
			pluginId="org.eclipse.pde.ui"
Lines 127-132 Link Here
127
		
129
		
128
	<item
130
	<item
129
		href="/org.eclipse.pde.doc.user/guide/pde_running.htm"
131
		href="/org.eclipse.pde.doc.user/guide/pde_running.htm"
132
		dialog="true"
130
		title="Running the plug-in">
133
		title="Running the plug-in">
131
		<action
134
		<action
132
			pluginId="org.eclipse.pde.ui"
135
			pluginId="org.eclipse.pde.ui"
Lines 148-153 Link Here
148
151
149
	<item
152
	<item
150
		href="/org.eclipse.pde.doc.user/guide/pde_deploy.htm"
153
		href="/org.eclipse.pde.doc.user/guide/pde_deploy.htm"
154
		dialog="true"
151
		title="Deploying a plug-in">
155
		title="Deploying a plug-in">
152
		<action
156
		<action
153
			pluginId="org.eclipse.pde.ui"
157
			pluginId="org.eclipse.pde.ui"

Return to bug 69732