|
Link Here
|
| 7 |
* |
7 |
* |
| 8 |
* Contributors: |
8 |
* Contributors: |
| 9 |
* Atlassian - initial API and implementation |
9 |
* Atlassian - initial API and implementation |
|
|
10 |
* Robert Munteanu - fix for bug 361147 |
| 10 |
******************************************************************************/ |
11 |
******************************************************************************/ |
| 11 |
|
12 |
|
| 12 |
package org.eclipse.mylyn.internal.reviews.ui.annotations; |
13 |
package org.eclipse.mylyn.internal.reviews.ui.annotations; |
| 13 |
|
14 |
|
| 14 |
import org.eclipse.jface.action.Action; |
15 |
import org.eclipse.jface.action.Action; |
| 15 |
import org.eclipse.jface.dialogs.PopupDialog; |
16 |
import org.eclipse.jface.dialogs.PopupDialog; |
| 16 |
import org.eclipse.jface.layout.GridDataFactory; |
|
|
| 17 |
import org.eclipse.mylyn.internal.reviews.ui.IReviewActionListener; |
17 |
import org.eclipse.mylyn.internal.reviews.ui.IReviewActionListener; |
| 18 |
import org.eclipse.mylyn.internal.reviews.ui.editors.parts.TopicPart; |
18 |
import org.eclipse.mylyn.internal.reviews.ui.editors.parts.TopicPart; |
| 19 |
import org.eclipse.swt.SWT; |
19 |
import org.eclipse.swt.SWT; |
|
Link Here
|
| 25 |
import org.eclipse.swt.layout.GridLayout; |
25 |
import org.eclipse.swt.layout.GridLayout; |
| 26 |
import org.eclipse.swt.widgets.Composite; |
26 |
import org.eclipse.swt.widgets.Composite; |
| 27 |
import org.eclipse.swt.widgets.Control; |
27 |
import org.eclipse.swt.widgets.Control; |
| 28 |
import org.eclipse.swt.widgets.Label; |
|
|
| 29 |
import org.eclipse.swt.widgets.Shell; |
28 |
import org.eclipse.swt.widgets.Shell; |
| 30 |
import org.eclipse.ui.forms.IFormColors; |
|
|
| 31 |
import org.eclipse.ui.forms.widgets.FormToolkit; |
29 |
import org.eclipse.ui.forms.widgets.FormToolkit; |
| 32 |
|
30 |
|
| 33 |
/** |
31 |
/** |
|
Link Here
|
| 46 |
private FormToolkit toolkit; |
44 |
private FormToolkit toolkit; |
| 47 |
|
45 |
|
| 48 |
private Composite composite; |
46 |
private Composite composite; |
| 49 |
|
|
|
| 50 |
private Label focusLabel; |
| 51 |
|
47 |
|
| 52 |
private ScrolledComposite scrolledComposite; |
48 |
private ScrolledComposite scrolledComposite; |
| 53 |
|
49 |
|
|
Link Here
|
| 90 |
public void setFocus() { |
86 |
public void setFocus() { |
| 91 |
getShell().forceFocus(); |
87 |
getShell().forceFocus(); |
| 92 |
|
88 |
|
| 93 |
if (focusLabel != null) { |
|
|
| 94 |
focusLabel.dispose(); |
| 95 |
} |
| 96 |
|
| 97 |
if (composite.getChildren().length > 0) { |
89 |
if (composite.getChildren().length > 0) { |
| 98 |
composite.getChildren()[0].setFocus(); |
90 |
composite.getChildren()[0].setFocus(); |
| 99 |
} |
91 |
} |
| 100 |
|
92 |
|
|
|
93 |
recomputeSize(); |
| 94 |
} |
| 95 |
|
| 96 |
private void recomputeSize() { |
| 101 |
Point computeSize = composite.computeSize(SWT.DEFAULT, SWT.DEFAULT); |
97 |
Point computeSize = composite.computeSize(SWT.DEFAULT, SWT.DEFAULT); |
| 102 |
if (computeSize.y > scrolledComposite.getSize().y) { |
98 |
if (computeSize.y > scrolledComposite.getSize().y) { |
| 103 |
scrolledComposite.setExpandVertical(false); |
99 |
scrolledComposite.setExpandVertical(false); |
|
Link Here
|
| 185 |
|
181 |
|
| 186 |
getShell().setBackground(toolkit.getColors().getBackground()); |
182 |
getShell().setBackground(toolkit.getColors().getBackground()); |
| 187 |
} |
183 |
} |
| 188 |
focusLabel = toolkit.createLabel(composite, "Press 'F2' for focus."); |
184 |
|
| 189 |
focusLabel.setForeground(toolkit.getColors().getColor(IFormColors.TITLE)); |
185 |
recomputeSize(); |
| 190 |
GridDataFactory.fillDefaults().align(SWT.RIGHT, SWT.CENTER).applyTo(focusLabel); |
|
|
| 191 |
} else { |
186 |
} else { |
| 192 |
input = null; |
187 |
input = null; |
| 193 |
} |
188 |
} |