|
Lines 13-29
Link Here
|
| 13 |
|
13 |
|
| 14 |
import org.eclipse.jface.layout.GridDataFactory; |
14 |
import org.eclipse.jface.layout.GridDataFactory; |
| 15 |
import org.eclipse.mylyn.internal.provisional.commons.ui.CommonImages; |
15 |
import org.eclipse.mylyn.internal.provisional.commons.ui.CommonImages; |
|
|
16 |
import org.eclipse.mylyn.internal.tasks.core.TaskCategory; |
| 16 |
import org.eclipse.mylyn.internal.tasks.ui.editors.RepositoryTextViewerConfiguration.Mode; |
17 |
import org.eclipse.mylyn.internal.tasks.ui.editors.RepositoryTextViewerConfiguration.Mode; |
| 17 |
import org.eclipse.mylyn.internal.tasks.ui.util.AbstractRetrieveTitleFromUrlJob; |
18 |
import org.eclipse.mylyn.internal.tasks.ui.util.AbstractRetrieveTitleFromUrlJob; |
| 18 |
import org.eclipse.mylyn.tasks.ui.TasksUiImages; |
19 |
import org.eclipse.mylyn.tasks.ui.TasksUiImages; |
| 19 |
import org.eclipse.swt.SWT; |
20 |
import org.eclipse.swt.SWT; |
| 20 |
import org.eclipse.swt.layout.GridData; |
21 |
import org.eclipse.swt.layout.GridData; |
| 21 |
import org.eclipse.swt.layout.GridLayout; |
22 |
import org.eclipse.swt.layout.GridLayout; |
|
|
23 |
import org.eclipse.swt.layout.RowLayout; |
| 22 |
import org.eclipse.swt.widgets.Composite; |
24 |
import org.eclipse.swt.widgets.Composite; |
| 23 |
import org.eclipse.swt.widgets.Control; |
25 |
import org.eclipse.swt.widgets.Control; |
| 24 |
import org.eclipse.swt.widgets.Label; |
26 |
import org.eclipse.swt.widgets.Label; |
| 25 |
import org.eclipse.ui.forms.IFormColors; |
27 |
import org.eclipse.ui.forms.IFormColors; |
| 26 |
import org.eclipse.ui.forms.IFormPart; |
28 |
import org.eclipse.ui.forms.IFormPart; |
|
|
29 |
import org.eclipse.ui.forms.events.ExpansionAdapter; |
| 30 |
import org.eclipse.ui.forms.events.ExpansionEvent; |
| 27 |
import org.eclipse.ui.forms.events.HyperlinkAdapter; |
31 |
import org.eclipse.ui.forms.events.HyperlinkAdapter; |
| 28 |
import org.eclipse.ui.forms.events.HyperlinkEvent; |
32 |
import org.eclipse.ui.forms.events.HyperlinkEvent; |
| 29 |
import org.eclipse.ui.forms.widgets.ExpandableComposite; |
33 |
import org.eclipse.ui.forms.widgets.ExpandableComposite; |
|
Lines 52-58
Link Here
|
| 52 |
|
56 |
|
| 53 |
@Override |
57 |
@Override |
| 54 |
public Control createControl(Composite parent, FormToolkit toolkit) { |
58 |
public Control createControl(Composite parent, FormToolkit toolkit) { |
| 55 |
int style = ExpandableComposite.TITLE_BAR | ExpandableComposite.TWISTIE; |
59 |
int style = ExpandableComposite.TITLE_BAR | ExpandableComposite.TWISTIE |
|
|
60 |
| ExpandableComposite.LEFT_TEXT_CLIENT_ALIGNMENT; |
| 56 |
if (getTask().getUrl() != null && getTask().getUrl().length() > 0) { |
61 |
if (getTask().getUrl() != null && getTask().getUrl().length() > 0) { |
| 57 |
style |= ExpandableComposite.EXPANDED; |
62 |
style |= ExpandableComposite.EXPANDED; |
| 58 |
} |
63 |
} |
|
Lines 60-65
Link Here
|
| 60 |
Section section = toolkit.createSection(parent, style); |
65 |
Section section = toolkit.createSection(parent, style); |
| 61 |
section.setText(Messages.TaskPlanningEditor_Attributes); |
66 |
section.setText(Messages.TaskPlanningEditor_Attributes); |
| 62 |
GridDataFactory.fillDefaults().grab(true, false).applyTo(section); |
67 |
GridDataFactory.fillDefaults().grab(true, false).applyTo(section); |
|
|
68 |
createSectionClient(section, toolkit); |
| 63 |
|
69 |
|
| 64 |
// URL |
70 |
// URL |
| 65 |
Composite urlComposite = toolkit.createComposite(section); |
71 |
Composite urlComposite = toolkit.createComposite(section); |
|
Lines 101-106
Link Here
|
| 101 |
return section; |
107 |
return section; |
| 102 |
} |
108 |
} |
| 103 |
|
109 |
|
|
|
110 |
private void createSectionClient(final Section section, FormToolkit toolkit) { |
| 111 |
if (section.getTextClient() == null) { |
| 112 |
final Composite textClient = toolkit.createComposite(section); |
| 113 |
textClient.setBackground(null); |
| 114 |
RowLayout rowLayout = new RowLayout(); |
| 115 |
EditorUtil.center(rowLayout); |
| 116 |
rowLayout.marginLeft = 20; |
| 117 |
rowLayout.marginTop = 0; |
| 118 |
rowLayout.marginBottom = 0; |
| 119 |
textClient.setLayout(rowLayout); |
| 120 |
|
| 121 |
Label label = toolkit.createLabel(textClient, "Category:"); |
| 122 |
label.setForeground(toolkit.getColors().getColor(IFormColors.TITLE)); |
| 123 |
label.setBackground(null); |
| 124 |
|
| 125 |
label = toolkit.createLabel(textClient, TaskCategory.getParentTaskCategory(getTask()).getSummary()); |
| 126 |
label.setBackground(null); |
| 127 |
|
| 128 |
section.setTextClient(textClient); |
| 129 |
section.addExpansionListener(new ExpansionAdapter() { |
| 130 |
@Override |
| 131 |
public void expansionStateChanging(ExpansionEvent e) { |
| 132 |
textClient.setVisible(!e.getState()); |
| 133 |
} |
| 134 |
}); |
| 135 |
} |
| 136 |
} |
| 137 |
|
| 104 |
/** |
138 |
/** |
| 105 |
* Set the task summary to the page title from the specified url. |
139 |
* Set the task summary to the page title from the specified url. |
| 106 |
*/ |
140 |
*/ |