|
Lines 10-15
Link Here
|
| 10 |
|
10 |
|
| 11 |
package com.ibm.etools.symptom.presentation; |
11 |
package com.ibm.etools.symptom.presentation; |
| 12 |
|
12 |
|
|
|
13 |
import org.eclipse.core.runtime.Preferences; |
| 13 |
import org.eclipse.jface.action.Action; |
14 |
import org.eclipse.jface.action.Action; |
| 14 |
import org.eclipse.jface.action.IToolBarManager; |
15 |
import org.eclipse.jface.action.IToolBarManager; |
| 15 |
import org.eclipse.jface.dialogs.IInputValidator; |
16 |
import org.eclipse.jface.dialogs.IInputValidator; |
|
Lines 30-35
Link Here
|
| 30 |
import com.ibm.etools.symptom.editor.internal.SymptomEditorPluginImages; |
31 |
import com.ibm.etools.symptom.editor.internal.SymptomEditorPluginImages; |
| 31 |
import com.ibm.etools.symptom.editor.internal.util.GridUtil; |
32 |
import com.ibm.etools.symptom.editor.internal.util.GridUtil; |
| 32 |
import com.ibm.etools.symptom.editor.internal.util.SymptomEditMessages; |
33 |
import com.ibm.etools.symptom.editor.internal.util.SymptomEditMessages; |
|
|
34 |
import com.ibm.etools.symptom.editor.internal.util.SymptomEditorConstants; |
| 33 |
import org.eclipse.osgi.util.NLS; |
35 |
import org.eclipse.osgi.util.NLS; |
| 34 |
|
36 |
|
| 35 |
public class SymptomAnalysisViewer extends ViewPart { |
37 |
public class SymptomAnalysisViewer extends ViewPart { |
|
Lines 38-46
Link Here
|
| 38 |
private SymptomAnalysisPage _currentPage = null; |
40 |
private SymptomAnalysisPage _currentPage = null; |
| 39 |
private String _title = SymptomEditPlugin.INSTANCE.getString("15"); |
41 |
private String _title = SymptomEditPlugin.INSTANCE.getString("15"); |
| 40 |
private boolean _initializedMenu = false; |
42 |
private boolean _initializedMenu = false; |
| 41 |
private Action _pageUp, _pageDown, _gotoPage; |
43 |
private Action _sort, _pageUp, _pageDown, _gotoPage; |
| 42 |
|
44 |
private String STR_SORT_ORDER; |
| 43 |
|
|
|
| 44 |
/* (non-Javadoc) |
45 |
/* (non-Javadoc) |
| 45 |
* @see org.eclipse.ui.part.WorkbenchPart#createPartControl(org.eclipse.swt.widgets.Composite) |
46 |
* @see org.eclipse.ui.part.WorkbenchPart#createPartControl(org.eclipse.swt.widgets.Composite) |
| 46 |
*/ |
47 |
*/ |
|
Lines 50-56
Link Here
|
| 50 |
|
51 |
|
| 51 |
// Create the default page. |
52 |
// Create the default page. |
| 52 |
_defaultPage = createDefaultPage(_book); |
53 |
_defaultPage = createDefaultPage(_book); |
| 53 |
|
54 |
|
| 54 |
addViewPage(null); |
55 |
addViewPage(null); |
| 55 |
} |
56 |
} |
| 56 |
|
57 |
|
|
Lines 121-135
Link Here
|
| 121 |
tbm.removeAll(); |
122 |
tbm.removeAll(); |
| 122 |
getViewSite().getActionBars().updateActionBars(); |
123 |
getViewSite().getActionBars().updateActionBars(); |
| 123 |
} |
124 |
} |
|
|
125 |
|
| 124 |
|
126 |
|
| 125 |
public void makeActions(){ |
127 |
public void makeActions(){ |
| 126 |
if (isInitializedMenu()) |
128 |
if (isInitializedMenu()) |
| 127 |
return; |
129 |
return; |
| 128 |
|
130 |
initializedMenu(true); |
| 129 |
initializedMenu(true); |
131 |
|
|
|
132 |
STR_SORT_ORDER = SymptomEditPlugin.getPlugin().getPreferenceStore().getString( |
| 133 |
SymptomEditorConstants.SORT_ORDER); |
| 134 |
if ((STR_SORT_ORDER == null) || (STR_SORT_ORDER.equals(""))) |
| 135 |
STR_SORT_ORDER=SymptomEditMessages._189; |
| 136 |
_sort = new Action(STR_SORT_ORDER) { |
| 137 |
public void run() { |
| 138 |
if (_currentPage == null || !(_currentPage instanceof SymptomAnalysisPage)) |
| 139 |
return; |
| 140 |
BusyIndicator.showWhile(null, new Runnable() { |
| 141 |
public void run() { |
| 142 |
SymptomAnalysisTreeContentProvider provider = (SymptomAnalysisTreeContentProvider) ((SymptomAnalysisPage) _currentPage).getTreeViewer().getContentProvider(); |
| 143 |
_sort.setEnabled(provider.sort()); |
| 144 |
STR_SORT_ORDER = provider.sortTreeViewer(STR_SORT_ORDER); |
| 145 |
((SymptomAnalysisPage) _currentPage).update(); |
| 146 |
Preferences store = SymptomEditPlugin.getPlugin().getPluginPreferences(); |
| 147 |
store.setValue(SymptomEditorConstants.SORT_ORDER, STR_SORT_ORDER); |
| 148 |
} |
| 149 |
}); |
| 150 |
} |
| 151 |
}; |
| 152 |
getViewSite().getActionBars().setGlobalActionHandler(ActionFactory.PREVIOUS.getId(), _sort); |
| 153 |
if (STR_SORT_ORDER.equalsIgnoreCase("Descending")){ |
| 154 |
SymptomEditorPluginImages.setImageDescriptors(_sort, |
| 155 |
SymptomEditorPluginImages.T_LCL, |
| 156 |
SymptomEditorPluginImages.IMG_SORT_DSC); |
| 157 |
_sort.setDescription(SymptomEditMessages._188); |
| 158 |
_sort.setToolTipText(SymptomEditMessages._188); |
| 159 |
} |
| 160 |
else if (STR_SORT_ORDER.equalsIgnoreCase("Ascending")){ |
| 161 |
SymptomEditorPluginImages.setImageDescriptors(_sort, |
| 162 |
SymptomEditorPluginImages.T_LCL, |
| 163 |
SymptomEditorPluginImages.IMG_SORT_ASC); |
| 164 |
_sort.setDescription(SymptomEditMessages._187); |
| 165 |
_sort.setToolTipText(SymptomEditMessages._187); |
| 166 |
|
| 167 |
} |
| 168 |
|
| 130 |
String STR_PAGE_UP = SymptomEditMessages._123; |
169 |
String STR_PAGE_UP = SymptomEditMessages._123; |
| 131 |
_pageUp = new Action(STR_PAGE_UP) { |
170 |
_pageUp = new Action(STR_PAGE_UP) { |
| 132 |
public void run() { |
171 |
public void run() { |
|
|
172 |
|
| 173 |
|
| 133 |
if (_currentPage == null || !(_currentPage instanceof SymptomAnalysisPage)) |
174 |
if (_currentPage == null || !(_currentPage instanceof SymptomAnalysisPage)) |
| 134 |
return; |
175 |
return; |
| 135 |
|
176 |
|
|
Lines 221-226
Link Here
|
| 221 |
_gotoPage.setToolTipText(STR_GO_TO_PAGE); |
262 |
_gotoPage.setToolTipText(STR_GO_TO_PAGE); |
| 222 |
|
263 |
|
| 223 |
IToolBarManager tbm = getViewSite().getActionBars().getToolBarManager(); |
264 |
IToolBarManager tbm = getViewSite().getActionBars().getToolBarManager(); |
|
|
265 |
tbm.add(_sort); |
| 224 |
tbm.add(_pageUp); |
266 |
tbm.add(_pageUp); |
| 225 |
tbm.add(_pageDown); |
267 |
tbm.add(_pageDown); |
| 226 |
tbm.add(_gotoPage); |
268 |
tbm.add(_gotoPage); |
|
Lines 255-260
Link Here
|
| 255 |
} |
297 |
} |
| 256 |
} |
298 |
} |
| 257 |
|
299 |
|
|
|
300 |
public Action getSortAction(){ |
| 301 |
return _sort; |
| 302 |
} |
| 303 |
|
| 304 |
|
| 258 |
public Action getPageUpAction(){ |
305 |
public Action getPageUpAction(){ |
| 259 |
return _pageUp; |
306 |
return _pageUp; |
| 260 |
} |
307 |
} |
|
Lines 266-271
Link Here
|
| 266 |
public Action getGotoPageAction(){ |
313 |
public Action getGotoPageAction(){ |
| 267 |
return _gotoPage; |
314 |
return _gotoPage; |
| 268 |
} |
315 |
} |
|
|
316 |
|
| 269 |
|
317 |
|
| 270 |
// ///////////////// |
318 |
// ///////////////// |
| 271 |
// public void fakeData(){ |
319 |
// public void fakeData(){ |