Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 303001
Collapse All | Expand All

(-)plugin.xml (-52 lines)
Lines 1850-1865 Link Here
1850
               mnemonic="%command.configureColumns.mnemonic"
1850
               mnemonic="%command.configureColumns.mnemonic"
1851
               style="push">
1851
               style="push">
1852
         </command>
1852
         </command>
1853
         <command
1854
               commandId="org.eclipse.ui.window.preferences"
1855
               label="%command.preferences.label"
1856
               mnemonic="%command.preferences.mnemonic"
1857
               style="push">
1858
            <parameter
1859
                  name="preferencePageId"
1860
                  value="org.eclipse.ui.ide.markers">
1861
            </parameter>
1862
         </command>
1863
      </menuContribution>
1853
      </menuContribution>
1864
      <menuContribution
1854
      <menuContribution
1865
            locationURI="menu:org.eclipse.ui.views.TaskList">
1855
            locationURI="menu:org.eclipse.ui.views.TaskList">
Lines 1913-1928 Link Here
1913
               mnemonic="%command.configureColumns.mnemonic"
1903
               mnemonic="%command.configureColumns.mnemonic"
1914
               style="push">
1904
               style="push">
1915
         </command>
1905
         </command>
1916
         <command
1917
               commandId="org.eclipse.ui.window.preferences"
1918
               label="%command.preferences.label"
1919
               mnemonic="%command.preferences.mnemonic"
1920
               style="push">
1921
            <parameter
1922
                  name="preferencePageId"
1923
                  value="org.eclipse.ui.ide.markers">
1924
            </parameter>
1925
         </command>
1926
      </menuContribution>
1906
      </menuContribution>
1927
      <menuContribution
1907
      <menuContribution
1928
            locationURI="menu:org.eclipse.ui.views.BookmarkView">
1908
            locationURI="menu:org.eclipse.ui.views.BookmarkView">
Lines 1986-2001 Link Here
1986
               mnemonic="%command.configureColumns.mnemonic"
1966
               mnemonic="%command.configureColumns.mnemonic"
1987
               style="push">
1967
               style="push">
1988
         </command>
1968
         </command>
1989
         <command
1990
               commandId="org.eclipse.ui.window.preferences"
1991
               label="%command.preferences.label"
1992
               mnemonic="%command.preferences.mnemonic"
1993
               style="push">
1994
            <parameter
1995
                  name="preferencePageId"
1996
                  value="org.eclipse.ui.ide.markers">
1997
            </parameter>
1998
         </command>
1999
      </menuContribution>
1969
      </menuContribution>
2000
      <menuContribution
1970
      <menuContribution
2001
            locationURI="menu:org.eclipse.ui.views.AllMarkersView">
1971
            locationURI="menu:org.eclipse.ui.views.AllMarkersView">
Lines 2049-2064 Link Here
2049
               mnemonic="%command.configureColumns.mnemonic"
2019
               mnemonic="%command.configureColumns.mnemonic"
2050
               style="push">
2020
               style="push">
2051
         </command>
2021
         </command>
2052
         <command
2053
               commandId="org.eclipse.ui.window.preferences"
2054
               label="%command.preferences.label"
2055
               mnemonic="%command.preferences.mnemonic"
2056
               style="push">
2057
            <parameter
2058
                  name="preferencePageId"
2059
                  value="org.eclipse.ui.ide.markers">
2060
            </parameter>
2061
         </command>
2062
      </menuContribution>
2022
      </menuContribution>
2063
   </extension>
2023
   </extension>
2064
   <extension
2024
   <extension
Lines 2240-2257 Link Here
2240
            </iterate>
2200
            </iterate>
2241
         </enabledWhen>
2201
         </enabledWhen>
2242
      </handler>
2202
      </handler>
2243
      <handler
2244
            class="org.eclipse.ui.internal.views.markers.MarkerPreferencesHandler"
2245
            commandId="org.eclipse.ui.window.preferences">
2246
         <activeWhen>
2247
            <with
2248
                  variable="activePart">
2249
               <instanceof
2250
                     value="org.eclipse.ui.views.markers.MarkerSupportView">
2251
               </instanceof>
2252
            </with>
2253
         </activeWhen>
2254
      </handler>
2255
   </extension>
2203
   </extension>
2256
   <extension
2204
   <extension
2257
         point="org.eclipse.core.expressions.propertyTesters">
2205
         point="org.eclipse.core.expressions.propertyTesters">
(-)src/org/eclipse/ui/internal/views/markers/ConfigureColumnsHandler.java (-2 / +1 lines)
Lines 12-18 Link Here
12
12
13
import org.eclipse.core.commands.ExecutionEvent;
13
import org.eclipse.core.commands.ExecutionEvent;
14
import org.eclipse.core.commands.IHandler;
14
import org.eclipse.core.commands.IHandler;
15
import org.eclipse.jface.util.ConfigureColumns;
16
import org.eclipse.ui.views.markers.MarkerViewHandler;
15
import org.eclipse.ui.views.markers.MarkerViewHandler;
17
16
18
/**
17
/**
Lines 33-39 Link Here
33
		ExtendedMarkersView view = getView(event);
32
		ExtendedMarkersView view = getView(event);
34
		if (view == null)
33
		if (view == null)
35
			return this;
34
			return this;
36
		ConfigureColumns.forTree(view.getViewer().getTree(), view.getSite());
35
		new MarkersViewSettingDialog(view).open();
37
		return this;
36
		return this;
38
	}
37
	}
39
38
(-)src/org/eclipse/ui/internal/views/markers/ExtendedMarkersView.java (-31 / +48 lines)
Lines 117-127 Link Here
117
	 */
117
	 */
118
	public final Object MARKERSVIEW_UPDATE_JOB_FAMILY = new Object();
118
	public final Object MARKERSVIEW_UPDATE_JOB_FAMILY = new Object();
119
119
120
	static final String MARKER_FIELD = "MARKER_FIELD"; //$NON-NLS-1$
121
	
120
	private static int instanceCount = 1;
122
	private static int instanceCount = 1;
121
	private static final String TAG_GENERATOR = "markerContentGenerator"; //$NON-NLS-1$
123
	private static final String TAG_GENERATOR = "markerContentGenerator"; //$NON-NLS-1$
122
124
123
	private static final String MARKER_FIELD = "MARKER_FIELD"; //$NON-NLS-1$
124
125
	private static final String TAG_EXPANDED = "expanded"; //$NON-NLS-1$
125
	private static final String TAG_EXPANDED = "expanded"; //$NON-NLS-1$
126
126
127
	private static final String TAG_CATEGORY = "category"; //$NON-NLS-1$
127
	private static final String TAG_CATEGORY = "category"; //$NON-NLS-1$
Lines 240-246 Link Here
240
				/*| SWT.VIRTUAL */| SWT.V_SCROLL | SWT.MULTI | SWT.FULL_SELECTION));
240
				/*| SWT.VIRTUAL */| SWT.V_SCROLL | SWT.MULTI | SWT.FULL_SELECTION));
241
		viewer.getTree().setLinesVisible(true);
241
		viewer.getTree().setLinesVisible(true);
242
		viewer.setUseHashlookup(true);
242
		viewer.setUseHashlookup(true);
243
		createColumns(new TreeColumn[0]);
243
		createColumns(new TreeColumn[0], new int[0]);
244
		viewer.setContentProvider(getContentProvider());
244
		viewer.setContentProvider(getContentProvider());
245
	}
245
	}
246
246
Lines 249-270 Link Here
249
	 * 
249
	 * 
250
	 * @param currentColumns
250
	 * @param currentColumns
251
	 *            the columns to refresh
251
	 *            the columns to refresh
252
	 * @param widths 
252
	 */
253
	 */
253
	private void createColumns(TreeColumn[] currentColumns) {
254
	private void createColumns(TreeColumn[] currentColumns, int[] widths) {
254
255
255
		Tree tree = viewer.getTree();
256
		Tree tree = viewer.getTree();
256
		TableLayout layout = new TableLayout();
257
		TableLayout layout = new TableLayout();
257
258
258
		MarkerField[] fields = generator.getVisibleFields();
259
		MarkerField[] fields = generator.getVisibleFields();
259
260
260
		IMemento columnWidths = null;
261
		if (memento != null)
262
			columnWidths = memento.getChild(TAG_COLUMN_WIDTHS);
263
264
		for (int i = 0; i < fields.length; i++) {
261
		for (int i = 0; i < fields.length; i++) {
265
			MarkerField markerField = fields[i];
262
			MarkerField markerField = fields[i];
266
263
			TreeViewerColumn column = null;
267
			TreeViewerColumn column;
268
			if (i < currentColumns.length)
264
			if (i < currentColumns.length)
269
				column = new TreeViewerColumn(viewer, currentColumns[i]);
265
				column = new TreeViewerColumn(viewer, currentColumns[i]);
270
			else {
266
			else {
Lines 289-315 Link Here
289
			if (builder.getPrimarySortField().equals(markerField))
285
			if (builder.getPrimarySortField().equals(markerField))
290
				updateDirectionIndicator(column.getColumn(), markerField);
286
				updateDirectionIndicator(column.getColumn(), markerField);
291
287
292
			int columnWidth = -1;
288
			IMemento columnWidths = null;
293
289
			if (memento != null){
294
			if (i == 0) {
290
				columnWidths = memento.getChild(TAG_COLUMN_WIDTHS);
295
				// Compute and store a font metric
296
				GC gc = new GC(tree);
297
				gc.setFont(tree.getFont());
298
				FontMetrics fontMetrics = gc.getFontMetrics();
299
				gc.dispose();
300
				columnWidth = Math.max(markerField.getDefaultColumnWidth(tree),
301
						fontMetrics.getAverageCharWidth() * 5);
302
			}
291
			}
303
292
			int columnWidth = -1;
304
			if (columnWidths != null) {
293
			if(i < widths.length){
305
				Integer value = columnWidths.getInteger(getFieldId(column
294
				columnWidth = widths[i];
306
						.getColumn()));
295
				if (columnWidths != null) {
307
296
					//save it
308
				// Make sure we get a useful value
297
					columnWidths.putInteger(markerField.getConfigurationElement().getAttribute(
309
				if (value != null && value.intValue() > 0)
298
							MarkerSupportInternalUtilities.ATTRIBUTE_ID), columnWidth);
310
					columnWidth = value.intValue();
299
				}
300
			}else{
301
				columnWidth = getFieldWidth(markerField, columnWidth);
311
			}
302
			}
312
313
			// Take trim into account if we are using the default value, but not
303
			// Take trim into account if we are using the default value, but not
314
			// if it is restored.
304
			// if it is restored.
315
			if (columnWidth < 0)
305
			if (columnWidth < 0)
Lines 334-339 Link Here
334
		tree.layout(true);
324
		tree.layout(true);
335
325
336
	}
326
	}
327
	
328
	int getFieldWidth(MarkerField markerField, int columnWidth) {
329
		Tree tree = getViewer().getTree();
330
331
		if (columnWidth < 0 && memento != null) {
332
			IMemento columnWidths = memento.getChild(TAG_COLUMN_WIDTHS);
333
			if (columnWidths != null) {
334
				Integer value = columnWidths.getInteger(markerField
335
						.getConfigurationElement().getAttribute(
336
								MarkerSupportInternalUtilities.ATTRIBUTE_ID));
337
				// Make sure we get a useful value
338
				if (value != null && value.intValue() > 0)
339
					columnWidth = value.intValue();
340
			}
341
		}
342
		if (columnWidth <= 0) {
343
			// Compute and store a font metric
344
			GC gc = new GC(tree);
345
			gc.setFont(tree.getFont());
346
			FontMetrics fontMetrics = gc.getFontMetrics();
347
			gc.dispose();
348
			columnWidth = Math.max(markerField.getDefaultColumnWidth(tree),
349
					fontMetrics.getAverageCharWidth() * 5);
350
		}
351
352
		return columnWidth;
353
	}
337
354
338
	/*
355
	/*
339
	 * (non-Javadoc)
356
	 * (non-Javadoc)
Lines 1460-1470 Link Here
1460
	/**
1477
	/**
1461
	 * @param visible
1478
	 * @param visible
1462
	 */
1479
	 */
1463
	void setVisibleFields(Collection visible) {
1480
	void setVisibleFields(Collection visible,int[] widths) {
1464
		generator.setVisibleFields(visible);
1481
		generator.setVisibleFields(visible);
1465
		//viewer.setSelection(new StructuredSelection());
1482
		//viewer.setSelection(new StructuredSelection());
1466
		//viewer.removeAndClearAll();
1483
		//viewer.removeAndClearAll();
1467
		createColumns(viewer.getTree().getColumns());
1484
		createColumns(viewer.getTree().getColumns(), widths);
1468
		scheduleUpdate(0L);
1485
		scheduleUpdate(0L);
1469
	}
1486
	}
1470
1487
(-)src/org/eclipse/ui/internal/views/markers/MarkerPreferencesDialog.java (-483 lines)
Removed Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2008, 2009 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
12
package org.eclipse.ui.internal.views.markers;
13
14
import java.util.ArrayList;
15
import java.util.List;
16
17
import org.eclipse.jface.dialogs.IDialogConstants;
18
import org.eclipse.jface.preference.IntegerFieldEditor;
19
import org.eclipse.jface.resource.JFaceColors;
20
import org.eclipse.jface.viewers.IStructuredContentProvider;
21
import org.eclipse.jface.viewers.IStructuredSelection;
22
import org.eclipse.jface.viewers.LabelProvider;
23
import org.eclipse.jface.viewers.ListViewer;
24
import org.eclipse.jface.viewers.Viewer;
25
import org.eclipse.swt.SWT;
26
import org.eclipse.swt.events.SelectionAdapter;
27
import org.eclipse.swt.events.SelectionEvent;
28
import org.eclipse.swt.layout.FormAttachment;
29
import org.eclipse.swt.layout.FormData;
30
import org.eclipse.swt.layout.FormLayout;
31
import org.eclipse.swt.layout.GridData;
32
import org.eclipse.swt.layout.GridLayout;
33
import org.eclipse.swt.widgets.Button;
34
import org.eclipse.swt.widgets.Composite;
35
import org.eclipse.swt.widgets.Control;
36
import org.eclipse.swt.widgets.Group;
37
import org.eclipse.swt.widgets.Label;
38
import org.eclipse.swt.widgets.Shell;
39
import org.eclipse.ui.internal.ide.IDEInternalPreferences;
40
import org.eclipse.ui.internal.ide.IDEWorkbenchPlugin;
41
import org.eclipse.ui.preferences.ViewSettingsDialog;
42
import org.eclipse.ui.views.markers.MarkerField;
43
import org.eclipse.ui.views.markers.internal.MarkerMessages;
44
45
/**
46
 * MarkerPreferencesDialog is the dialog for showing marker preferences.
47
 * 
48
 * @since 3.4
49
 * 
50
 */
51
public class MarkerPreferencesDialog extends ViewSettingsDialog {
52
53
	private IntegerFieldEditor limitEditor;
54
55
	private Button enablementButton;
56
57
	private Composite editArea;
58
59
	private Label messageLabel;
60
61
	private ExtendedMarkersView extendedView;
62
63
	private ArrayList visible;
64
65
	private ArrayList hidden;
66
67
	private ListViewer visibleViewer;
68
69
	private ListViewer nonVisibleViewer;
70
71
	/**
72
	 * Create a new instance of the receiver.
73
	 * 
74
	 * @param view -
75
	 *            the view this is being launched from
76
	 */
77
	public MarkerPreferencesDialog(ExtendedMarkersView view) {
78
		super(view.getSite().getShell());
79
		this.extendedView = view;
80
81
		Object[] visibleFields = view.getVisibleFields();
82
		Object[] hiddenFields = view.getHiddenFields();
83
84
		visible = new ArrayList();
85
		hidden = new ArrayList();
86
87
		for (int i = 0; i < visibleFields.length; i++) {
88
			visible.add(visibleFields[i]);
89
		}
90
91
		for (int i = 0; i < hiddenFields.length; i++) {
92
			hidden.add(hiddenFields[i]);
93
		}
94
	}
95
96
	/*
97
	 * (non-Javadoc)
98
	 * 
99
	 * @see org.eclipse.jface.window.Window#configureShell(org.eclipse.swt.widgets.Shell)
100
	 */
101
	protected void configureShell(Shell newShell) {
102
		super.configureShell(newShell);
103
		newShell.setText(MarkerMessages.MarkerPreferences_DialogTitle);
104
	}
105
106
	/*
107
	 * (non-Javadoc)
108
	 * 
109
	 * @see org.eclipse.jface.window.Window#getShellStyle()
110
	 */
111
	protected int getShellStyle() {
112
		return super.getShellStyle() | SWT.RESIZE;
113
	}
114
115
	/*
116
	 * (non-Javadoc)
117
	 * 
118
	 * @see org.eclipse.jface.dialogs.Dialog#createDialogArea(org.eclipse.swt.widgets.Composite)
119
	 */
120
	protected Control createDialogArea(Composite parent) {
121
122
		Composite dialogArea = (Composite) super.createDialogArea(parent);
123
124
		boolean checked = IDEWorkbenchPlugin.getDefault().getPreferenceStore()
125
				.getBoolean(IDEInternalPreferences.USE_MARKER_LIMITS);
126
		enablementButton = new Button(dialogArea, SWT.CHECK);
127
		enablementButton.setText(MarkerMessages.MarkerPreferences_MarkerLimits);
128
		enablementButton.setSelection(checked);
129
130
		editArea = new Composite(dialogArea, SWT.NONE);
131
		editArea.setLayout(new GridLayout());
132
		GridData editData = new GridData(GridData.FILL_BOTH
133
				| GridData.GRAB_HORIZONTAL | GridData.GRAB_VERTICAL);
134
		editData.horizontalIndent = 10;
135
		editArea.setLayoutData(editData);
136
137
		limitEditor = new IntegerFieldEditor(
138
				"limit", MarkerMessages.MarkerPreferences_VisibleItems, editArea) { //$NON-NLS-1$
139
			/*
140
			 * (non-Javadoc)
141
			 * 
142
			 * @see org.eclipse.jface.preference.IntegerFieldEditor#checkState()
143
			 */
144
			protected boolean checkState() {
145
				boolean state = super.checkState();
146
				setValid(state, getErrorMessage());
147
				return state;
148
			}
149
		};
150
		limitEditor.setPreferenceStore(IDEWorkbenchPlugin.getDefault()
151
				.getPreferenceStore());
152
		limitEditor
153
				.setPreferenceName(IDEInternalPreferences.MARKER_LIMITS_VALUE);
154
		limitEditor.load();
155
156
		GridData checkedData = new GridData(SWT.FILL, SWT.NONE, true, false);
157
		checkedData.horizontalSpan = limitEditor.getNumberOfControls();
158
		enablementButton.setLayoutData(checkedData);
159
160
		enablementButton.addSelectionListener(new SelectionAdapter() {
161
			public void widgetSelected(SelectionEvent e) {
162
				setLimitEditorEnablement(editArea, enablementButton
163
						.getSelection());
164
			}
165
		});
166
167
		setLimitEditorEnablement(editArea, checked);
168
169
		messageLabel = new Label(dialogArea, SWT.NONE);
170
171
		messageLabel.setBackground(JFaceColors.getErrorBackground(dialogArea
172
				.getDisplay()));
173
		messageLabel.setForeground(JFaceColors.getErrorText(dialogArea
174
				.getDisplay()));
175
		messageLabel
176
				.setLayoutData(new GridData(SWT.FILL, SWT.NONE, true, false));
177
178
		createColumnsArea(dialogArea);
179
180
		applyDialogFont(dialogArea);
181
		return dialogArea;
182
	}
183
184
	/**
185
	 * Create an area for the selected columns
186
	 * 
187
	 * @param dialogArea
188
	 */
189
	private void createColumnsArea(Composite dialogArea) {
190
191
		initializeDialogUnits(dialogArea);
192
		Group columnsComposite = new Group(dialogArea, SWT.NONE);
193
		columnsComposite.setText(MarkerMessages.MarkerPreferences_ColumnGroupTitle);
194
		FormLayout layout = new FormLayout();
195
		columnsComposite.setLayout(layout);
196
197
		columnsComposite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true,
198
				true));
199
		Label visibleItemsLabel = new Label(columnsComposite, SWT.NONE);
200
		visibleItemsLabel.setText(MarkerMessages.MarkerPreferences_VisibleColumnsTitle);
201
		FormData visibleLabelData = new FormData();
202
		visibleLabelData.right = new FormAttachment(45, 0);
203
		visibleLabelData.left = new FormAttachment(
204
				IDialogConstants.BUTTON_MARGIN);
205
		visibleLabelData.top = new FormAttachment(0);
206
		visibleItemsLabel.setLayoutData(visibleLabelData);
207
208
		int rightMargin = IDialogConstants.BUTTON_MARGIN * -1;
209
210
		Label nonVisibleLabel = new Label(columnsComposite, SWT.NONE);
211
		nonVisibleLabel.setText(MarkerMessages.MarkerPreferences_HiddenColumnsTitle);
212
		FormData nonVisibleLabelData = new FormData();
213
		nonVisibleLabelData.right = new FormAttachment(100);
214
		nonVisibleLabelData.left = new FormAttachment(55, 0);
215
		nonVisibleLabelData.top = new FormAttachment(0);
216
		nonVisibleLabel.setLayoutData(nonVisibleLabelData);
217
218
		visibleViewer = new ListViewer(columnsComposite,
219
				SWT.BORDER);
220
221
		FormData visibleViewerData = new FormData();
222
		visibleViewerData.right = new FormAttachment(visibleItemsLabel, 0,
223
				SWT.RIGHT);
224
		visibleViewerData.left = new FormAttachment(visibleItemsLabel, 0,
225
				SWT.LEFT);
226
		visibleViewerData.top = new FormAttachment(visibleItemsLabel,
227
				IDialogConstants.BUTTON_MARGIN);
228
		visibleViewerData.bottom = new FormAttachment(100, rightMargin);
229
		visibleViewerData.height = convertHeightInCharsToPixels(15);
230
		visibleViewerData.width = convertWidthInCharsToPixels(25);
231
232
		visibleViewer.getControl().setLayoutData(visibleViewerData);
233
234
		visibleViewer.setContentProvider(new IStructuredContentProvider() {
235
236
			/*
237
			 * (non-Javadoc)
238
			 * 
239
			 * @see org.eclipse.jface.viewers.IStructuredContentProvider#getElements(java.lang.Object)
240
			 */
241
			public Object[] getElements(Object inputElement) {
242
				return visible.toArray();
243
			}
244
245
			/*
246
			 * (non-Javadoc)
247
			 * 
248
			 * @see org.eclipse.jface.viewers.IContentProvider#dispose()
249
			 */
250
			public void dispose() {
251
			}
252
253
			/*
254
			 * (non-Javadoc)
255
			 * 
256
			 * @see org.eclipse.jface.viewers.IContentProvider#inputChanged(org.eclipse.jface.viewers.Viewer,
257
			 *      java.lang.Object, java.lang.Object)
258
			 */
259
			public void inputChanged(Viewer viewer, Object oldInput,
260
					Object newInput) {
261
			}
262
263
		});
264
265
		visibleViewer.setLabelProvider(markerFieldLabelProvider());
266
267
		visibleViewer.setInput(this);
268
269
		nonVisibleViewer = new ListViewer(columnsComposite,
270
				SWT.BORDER);
271
272
		nonVisibleViewer.setLabelProvider(markerFieldLabelProvider());
273
274
		nonVisibleViewer.setContentProvider(new IStructuredContentProvider() {
275
276
			/*
277
			 * (non-Javadoc)
278
			 * 
279
			 * @see org.eclipse.jface.viewers.IStructuredContentProvider#getElements(java.lang.Object)
280
			 */
281
			public Object[] getElements(Object inputElement) {
282
				return hidden.toArray();
283
			}
284
285
			/*
286
			 * (non-Javadoc)
287
			 * 
288
			 * @see org.eclipse.jface.viewers.IContentProvider#dispose()
289
			 */
290
			public void dispose() {
291
			}
292
293
			/*
294
			 * (non-Javadoc)
295
			 * 
296
			 * @see org.eclipse.jface.viewers.IContentProvider#inputChanged(org.eclipse.jface.viewers.Viewer,
297
			 *      java.lang.Object, java.lang.Object)
298
			 */
299
			public void inputChanged(Viewer viewer, Object oldInput,
300
					Object newInput) {
301
			}
302
303
		});
304
		nonVisibleViewer.setInput(this);
305
306
		FormData nonVisibleViewerData = new FormData();
307
		nonVisibleViewerData.right = new FormAttachment(nonVisibleLabel, 0,
308
				SWT.RIGHT);
309
		nonVisibleViewerData.left = new FormAttachment(nonVisibleLabel, 0,
310
				SWT.LEFT);
311
		nonVisibleViewerData.top = new FormAttachment(nonVisibleLabel,
312
				IDialogConstants.BUTTON_MARGIN);
313
		nonVisibleViewerData.bottom = new FormAttachment(100, rightMargin);
314
		nonVisibleViewerData.height = convertHeightInCharsToPixels(15);
315
		nonVisibleViewerData.width = convertWidthInCharsToPixels(25);
316
317
		nonVisibleViewer.getControl().setLayoutData(nonVisibleViewerData);
318
319
		Button toNonVisibleButton = new Button(columnsComposite, SWT.PUSH);
320
		toNonVisibleButton
321
				.setText(getDefaultOrientation() == SWT.RIGHT_TO_LEFT ? MarkerMessages.MarkerPreferences_MoveLeft
322
						: MarkerMessages.MarkerPreferences_MoveRight);
323
324
		FormData toNonVisibleButtonData = new FormData();
325
326
		toNonVisibleButtonData.top = new FormAttachment(visibleViewer
327
				.getControl(), IDialogConstants.BUTTON_BAR_HEIGHT, SWT.TOP);
328
		toNonVisibleButtonData.left = new FormAttachment(visibleViewer
329
				.getControl(), IDialogConstants.BUTTON_MARGIN);
330
		toNonVisibleButtonData.right = new FormAttachment(nonVisibleViewer
331
				.getControl(), rightMargin);
332
		toNonVisibleButton.setLayoutData(toNonVisibleButtonData);
333
334
		toNonVisibleButton.addSelectionListener(new SelectionAdapter() {
335
			/*
336
			 * (non-Javadoc)
337
			 * 
338
			 * @see org.eclipse.swt.events.SelectionAdapter#widgetSelected(org.eclipse.swt.events.SelectionEvent)
339
			 */
340
			public void widgetSelected(SelectionEvent e) {
341
				List selection = ((IStructuredSelection) visibleViewer
342
						.getSelection()).toList();
343
				hidden.addAll(selection);
344
				visible.removeAll(selection);
345
				visibleViewer.refresh();
346
				nonVisibleViewer.refresh();
347
				setValid(
348
						visible.size() > 0,
349
						MarkerMessages.MarkerPreferences_AtLeastOneVisibleColumn);
350
			}
351
		});
352
353
		Button toVisibleButton = new Button(columnsComposite, SWT.PUSH);
354
		toVisibleButton
355
				.setText(getDefaultOrientation() == SWT.RIGHT_TO_LEFT ? MarkerMessages.MarkerPreferences_MoveRight
356
						: MarkerMessages.MarkerPreferences_MoveLeft);
357
358
		FormData toVisibleButtonData = new FormData();
359
360
		toVisibleButtonData.top = new FormAttachment(toNonVisibleButton,
361
				IDialogConstants.BUTTON_MARGIN);
362
		toVisibleButtonData.left = new FormAttachment(visibleViewer
363
				.getControl(), IDialogConstants.BUTTON_MARGIN);
364
		toVisibleButtonData.right = new FormAttachment(nonVisibleViewer
365
				.getControl(), rightMargin);
366
		toVisibleButton.setLayoutData(toVisibleButtonData);
367
368
		toVisibleButton.addSelectionListener(new SelectionAdapter() {
369
			/*
370
			 * (non-Javadoc)
371
			 * 
372
			 * @see org.eclipse.swt.events.SelectionAdapter#widgetSelected(org.eclipse.swt.events.SelectionEvent)
373
			 */
374
			public void widgetSelected(SelectionEvent e) {
375
				List selection = ((IStructuredSelection) nonVisibleViewer
376
						.getSelection()).toList();
377
				hidden.removeAll(selection);
378
				visible.addAll(selection);
379
				visibleViewer.refresh();
380
				nonVisibleViewer.refresh();
381
				setValid(
382
						visible.size() > 0,
383
						MarkerMessages.MarkerPreferences_AtLeastOneVisibleColumn);
384
			}
385
		});
386
387
	}
388
389
	/**
390
	 * Return a label provider for fields.
391
	 * @return LabelProvider
392
	 */
393
	private LabelProvider markerFieldLabelProvider() {
394
		return new LabelProvider() {
395
			/*
396
			 * (non-Javadoc)
397
			 * 
398
			 * @see org.eclipse.jface.viewers.LabelProvider#getText(java.lang.Object)
399
			 */
400
			public String getText(Object element) {
401
				return ((MarkerField) element).getName();
402
			}
403
		};
404
	}
405
406
	/**
407
	 * Set the enabled state of the OK button by state.
408
	 * 
409
	 * @param state
410
	 */
411
	protected void setValid(boolean state, String errorMessage) {
412
		Button okButton = getButton(IDialogConstants.OK_ID);
413
414
		if (okButton == null)
415
			return;
416
417
		if (state)
418
			messageLabel.setText(MarkerSupportInternalUtilities.EMPTY_STRING);
419
		else
420
			messageLabel.setText(errorMessage);
421
422
		okButton.setEnabled(state);
423
424
	}
425
426
	/**
427
	 * Enable the limitEditor based on checked.
428
	 * 
429
	 * @param control
430
	 *            The parent of the editor
431
	 * @param checked
432
	 */
433
	private void setLimitEditorEnablement(Composite control, boolean checked) {
434
		limitEditor.setEnabled(checked, control);
435
	}
436
437
	/*
438
	 * (non-Javadoc)
439
	 * 
440
	 * @see org.eclipse.jface.dialogs.Dialog#okPressed()
441
	 */
442
	protected void okPressed() {
443
444
		limitEditor.store();
445
		IDEWorkbenchPlugin.getDefault().getPreferenceStore().setValue(
446
				IDEInternalPreferences.USE_MARKER_LIMITS,
447
				enablementButton.getSelection());
448
		IDEWorkbenchPlugin.getDefault().savePluginPreferences();
449
450
		extendedView.setVisibleFields(visible);
451
452
		super.okPressed();
453
	}
454
455
	/*
456
	 * (non-Javadoc)
457
	 * 
458
	 * @see org.eclipse.ui.preferences.ViewSettingsDialog#performDefaults()
459
	 */
460
	protected void performDefaults() {
461
		super.performDefaults();
462
		limitEditor.loadDefault();
463
		boolean checked = IDEWorkbenchPlugin.getDefault().getPreferenceStore()
464
				.getDefaultBoolean(IDEInternalPreferences.USE_MARKER_LIMITS);
465
		enablementButton.setSelection(checked);
466
		setLimitEditorEnablement(editArea, checked);
467
468
		Object[] visibleFields=extendedView.getBuilder().getGenerator().getInitialVisible();
469
		Object[] allFields=extendedView.getBuilder().getGenerator().getAllFields();
470
		visible.clear();
471
		hidden.clear();
472
		for (int i = 0; i < allFields.length; i++) {
473
			hidden.add(allFields[i]);
474
		}
475
		for (int i = 0; i < visibleFields.length; i++) {
476
			hidden.remove(visibleFields[i]);
477
			visible.add(visibleFields[i]);
478
		}
479
		visibleViewer.refresh();
480
		nonVisibleViewer.refresh();
481
	}
482
483
}
(-)src/org/eclipse/ui/internal/views/markers/MarkerPreferencesHandler.java (-38 lines)
Removed Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2005, 2008 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.views.markers;
12
13
import org.eclipse.core.commands.ExecutionEvent;
14
import org.eclipse.core.commands.IHandler;
15
import org.eclipse.ui.views.markers.MarkerViewHandler;
16
17
/**
18
 * MarkerPreferencesHandler is the handler for opening the marker preferences dialog.
19
 * @since 3.4
20
 *
21
 */
22
public class MarkerPreferencesHandler extends MarkerViewHandler implements
23
		IHandler {
24
25
	/* (non-Javadoc)
26
	 * @see org.eclipse.core.commands.IHandler#execute(org.eclipse.core.commands.ExecutionEvent)
27
	 */
28
	public Object execute(ExecutionEvent event) {
29
		
30
		ExtendedMarkersView view = getView(event);
31
		if(view == null)
32
			return this;
33
		
34
		new MarkerPreferencesDialog(view).open();
35
		return this;
36
	}
37
38
}
(-)src/org/eclipse/ui/internal/views/markers/MarkerSupportInternalUtilities.java (-8 / +5 lines)
Lines 317-331 Link Here
317
	 */
317
	 */
318
	static int getMarkerLimit() {
318
	static int getMarkerLimit() {
319
319
320
		// If limits are enabled return it. Otherwise return -1
320
		int value = IDEWorkbenchPlugin.getDefault().getPreferenceStore()
321
		if (IDEWorkbenchPlugin.getDefault().getPreferenceStore().getBoolean(
321
				.getInt(IDEInternalPreferences.MARKER_LIMITS_VALUE);
322
				IDEInternalPreferences.USE_MARKER_LIMITS)) {
322
		if (value <= 0) {
323
			return IDEWorkbenchPlugin.getDefault().getPreferenceStore().getInt(
323
			return -1;
324
					IDEInternalPreferences.MARKER_LIMITS_VALUE);
325
326
		}
324
		}
327
		return -1;
325
		return value;
328
329
	}
326
	}
330
327
331
	/**
328
	/**
(-)src/org/eclipse/ui/internal/views/markers/Markers.java (-43 / +46 lines)
Lines 29-36 Link Here
29
import org.eclipse.ui.views.markers.internal.MarkerMessages;
29
import org.eclipse.ui.views.markers.internal.MarkerMessages;
30
30
31
/**
31
/**
32
 * The Markers object contains the MarkerEntry(s) collected and updated by the system,
32
 * The Markers object contains the MarkerEntry(s) collected and updated by the
33
 * also  maintains the categories that markers are grouped into.
33
 * system, also maintains the categories that markers are grouped into.
34
 * 
34
 * @since 3.6
35
 * @since 3.6
35
 * 
36
 * 
36
 */
37
 */
Lines 39-79 Link Here
39
	static final MarkerCategory[] EMPTY_CATEGORY_ARRAY = new MarkerCategory[0];
40
	static final MarkerCategory[] EMPTY_CATEGORY_ARRAY = new MarkerCategory[0];
40
	static final MarkerEntry[] EMPTY_ENTRY_ARRAY = new MarkerEntry[0];
41
	static final MarkerEntry[] EMPTY_ENTRY_ARRAY = new MarkerEntry[0];
41
42
42
	 //the marker entries
43
	// the marker entries
43
	private MarkerEntry[] markerEntryArray = EMPTY_ENTRY_ARRAY;
44
	private MarkerEntry[] markerEntryArray = EMPTY_ENTRY_ARRAY;
44
	//the categories
45
	// the categories
45
	private MarkerCategory[] categories = EMPTY_CATEGORY_ARRAY;
46
	private MarkerCategory[] categories = EMPTY_CATEGORY_ARRAY;
46
47
47
	
48
	private CachedMarkerBuilder builder;
48
	private CachedMarkerBuilder builder;
49
	
49
50
	private boolean inChange=false;
50
	private boolean inChange = false;
51
51
52
	// markerToEntryMap is a lazily created map from the markers to thier
52
	// markerToEntryMap is a lazily created map from the markers to thier
53
	// corresponding entry
53
	// corresponding entry
54
	private Map markerToEntryMap = null;
54
	private Map markerToEntryMap = null;
55
	private Integer[] markerCounts;
55
	private Integer[] markerCounts;
56
56
57
58
	Markers(CachedMarkerBuilder builder) {
57
	Markers(CachedMarkerBuilder builder) {
59
		this.builder = builder;
58
		this.builder = builder;
60
		inChange=false;
59
		inChange = false;
61
	}
60
	}
62
61
63
	/**
62
	/**
64
	 * Update with newly collected markers
63
	 * Update with newly collected markers
65
	 * 
64
	 * 
66
	 * @param markerEntries
65
	 * @param markerEntries
67
	 * 						the new marker entries 
66
	 *            the new marker entries
68
	 * @param sortAndGroup
67
	 * @param sortAndGroup
69
	 * 			true 	sort and group them
68
	 *            true sort and group them
70
	 * @param monitor
69
	 * @param monitor
71
	 */
70
	 */
72
	synchronized boolean updateWithNewMarkers(Collection markerEntries,
71
	synchronized boolean updateWithNewMarkers(Collection markerEntries,
73
			boolean sortAndGroup, IProgressMonitor monitor) {
72
			boolean sortAndGroup, IProgressMonitor monitor) {
74
		boolean initialVal=inChange;
73
		boolean initialVal = inChange;
75
		try {
74
		try {
76
			inChange=true;
75
			inChange = true;
77
			if (markerToEntryMap != null) {
76
			if (markerToEntryMap != null) {
78
				markerToEntryMap.clear();
77
				markerToEntryMap.clear();
79
				markerToEntryMap = null;
78
				markerToEntryMap = null;
Lines 103-109 Link Here
103
			}
102
			}
104
			return true;
103
			return true;
105
		} finally {
104
		} finally {
106
			inChange=initialVal;
105
			inChange = initialVal;
107
		}
106
		}
108
	}
107
	}
109
108
Lines 113-121 Link Here
113
	 * @param monitor
112
	 * @param monitor
114
	 */
113
	 */
115
	synchronized boolean sortAndMakeCategories(IProgressMonitor monitor) {
114
	synchronized boolean sortAndMakeCategories(IProgressMonitor monitor) {
116
		boolean initialVal=inChange;
115
		boolean initialVal = inChange;
117
		try {
116
		try {
118
			inChange=true;
117
			inChange = true;
119
			// Sort by Category first
118
			// Sort by Category first
120
			if (builder.isShowingHierarchy()) {
119
			if (builder.isShowingHierarchy()) {
121
				MarkerCategory[] markerCategories = groupIntoCategories(
120
				MarkerCategory[] markerCategories = groupIntoCategories(
Lines 132-138 Link Here
132
131
133
			return sortMarkerEntries(monitor);
132
			return sortMarkerEntries(monitor);
134
		} finally {
133
		} finally {
135
			inChange=initialVal;
134
			inChange = initialVal;
136
		}
135
		}
137
	}
136
	}
138
137
Lines 143-151 Link Here
143
		if (monitor.isCanceled()) {
142
		if (monitor.isCanceled()) {
144
			return false;
143
			return false;
145
		}
144
		}
146
		boolean initialVal=inChange;
145
		boolean initialVal = inChange;
147
		try {
146
		try {
148
			inChange=true;
147
			inChange = true;
149
			if (builder.isShowingHierarchy()) {
148
			if (builder.isShowingHierarchy()) {
150
				Comparator comparator = builder.getComparator()
149
				Comparator comparator = builder.getComparator()
151
						.getFieldsComparator();
150
						.getFieldsComparator();
Lines 168-175 Link Here
168
				}
167
				}
169
				int avaialble = markerEntryArray.length - 1;
168
				int avaialble = markerEntryArray.length - 1;
170
				int effLimit = getShowingLimit(avaialble);
169
				int effLimit = getShowingLimit(avaialble);
171
				MarkerSortUtil.sortStartingKElement(markerEntryArray, builder
170
				MarkerSortUtil.sortStartingKElement(markerEntryArray,
172
						.getComparator(), effLimit, monitor);
171
						builder.getComparator(), effLimit, monitor);
173
			}
172
			}
174
			if (monitor.isCanceled()) {
173
			if (monitor.isCanceled()) {
175
				return false;
174
				return false;
Lines 177-194 Link Here
177
			monitor.worked(50);
176
			monitor.worked(50);
178
			return true;
177
			return true;
179
		} finally {
178
		} finally {
180
			inChange=initialVal;
179
			inChange = initialVal;
181
		}
180
		}
182
	}
181
	}
183
182
184
	/**
183
	/**
185
	 * get marker limit to show, if any.
184
	 * get marker limit to show, if any.
185
	 * 
186
	 * @param avaliable
186
	 * @param avaliable
187
	 */
187
	 */
188
	private int getShowingLimit(int avaliable) {
188
	private int getShowingLimit(int avaliable) {
189
		int limit = MarkerSupportInternalUtilities.getMarkerLimit();
189
		int limit = MarkerSupportInternalUtilities.getMarkerLimit();
190
		int effLimit = limit;
190
		int effLimit = limit;
191
		if (avaliable < effLimit || limit == -1) {
191
		if (avaliable < effLimit || limit <= 0) {
192
			effLimit = avaliable;
192
			effLimit = avaliable;
193
		}
193
		}
194
		return effLimit;
194
		return effLimit;
Lines 203-210 Link Here
203
	 */
203
	 */
204
	MarkerCategory[] groupIntoCategories(IProgressMonitor monitor,
204
	MarkerCategory[] groupIntoCategories(IProgressMonitor monitor,
205
			MarkerEntry[] newMarkers) {
205
			MarkerEntry[] newMarkers) {
206
		Map boundaryInfoMap = groupMarkerEntries(newMarkers, builder
206
		Map boundaryInfoMap = groupMarkerEntries(newMarkers,
207
				.getCategoryGroup(), newMarkers.length - 1, monitor);
207
				builder.getCategoryGroup(), newMarkers.length - 1, monitor);
208
		Iterator iterator = boundaryInfoMap.keySet().iterator();
208
		Iterator iterator = boundaryInfoMap.keySet().iterator();
209
		int start = 0;
209
		int start = 0;
210
		MarkerCategory[] markerCategories = new MarkerCategory[boundaryInfoMap
210
		MarkerCategory[] markerCategories = new MarkerCategory[boundaryInfoMap
Lines 215-222 Link Here
215
			Object key = iterator.next();
215
			Object key = iterator.next();
216
			end = ((Integer) boundaryInfoMap.get(key)).intValue();
216
			end = ((Integer) boundaryInfoMap.get(key)).intValue();
217
			markerCategories[i++] = new MarkerCategory(this, start, end,
217
			markerCategories[i++] = new MarkerCategory(this, start, end,
218
					builder.getCategoryGroup().getMarkerField().getValue(
218
					builder.getCategoryGroup().getMarkerField()
219
							newMarkers[start]));
219
							.getValue(newMarkers[start]));
220
			start = end + 1;
220
			start = end + 1;
221
		}
221
		}
222
		return markerCategories;
222
		return markerCategories;
Lines 234-254 Link Here
234
	 * @return {@link Map}
234
	 * @return {@link Map}
235
	 * 
235
	 * 
236
	 */
236
	 */
237
	private Map groupMarkerEntries(MarkerEntry[] entries, MarkerGroup group, int k,
237
	private Map groupMarkerEntries(MarkerEntry[] entries, MarkerGroup group,
238
			IProgressMonitor monitor) {
238
			int k, IProgressMonitor monitor) {
239
		TreeMap map = new TreeMap(group.getEntriesComparator());
239
		TreeMap map = new TreeMap(group.getEntriesComparator());
240
		for (int i = 0; i <= k; i++) {
240
		for (int i = 0; i <= k; i++) {
241
			IMarker marker = entries[i].getMarker();
241
			IMarker marker = entries[i].getMarker();
242
			if (marker == null) {
242
			if (marker == null) {
243
				continue;// skip stale markers
243
				continue;// skip stale markers
244
			}
244
			}
245
			if(monitor.isCanceled()){
245
			if (monitor.isCanceled()) {
246
				map.clear();
246
				map.clear();
247
				return map;
247
				return map;
248
			}
248
			}
249
			try {
249
			try {
250
				MarkerGroupingEntry groupingEntry = group.findGroupValue(marker
250
				MarkerGroupingEntry groupingEntry = group.findGroupValue(
251
						.getType(), marker);
251
						marker.getType(), marker);
252
				List list = (List) map.get(groupingEntry);
252
				List list = (List) map.get(groupingEntry);
253
				if (list == null) {
253
				if (list == null) {
254
					list = new ArrayList();
254
					list = new ArrayList();
Lines 262-268 Link Here
262
		Iterator keys = map.keySet().iterator();
262
		Iterator keys = map.keySet().iterator();
263
		int i = 0;
263
		int i = 0;
264
		while (keys.hasNext()) {
264
		while (keys.hasNext()) {
265
			if(monitor.isCanceled()){
265
			if (monitor.isCanceled()) {
266
				map.clear();
266
				map.clear();
267
				return map;
267
				return map;
268
			}
268
			}
Lines 287-302 Link Here
287
	 */
287
	 */
288
	Integer[] getMarkerCounts() {
288
	Integer[] getMarkerCounts() {
289
		if (markerCounts == null) {
289
		if (markerCounts == null) {
290
			markerCounts=getMarkerCounts(markerEntryArray);
290
			markerCounts = getMarkerCounts(markerEntryArray);
291
291
292
		}
292
		}
293
		return markerCounts;
293
		return markerCounts;
294
	}
294
	}
295
295
296
	/**
296
	/**
297
	 * Returns an array of marker counts for the given MarkerEntry array
297
	 * Returns an array of marker counts for the given MarkerEntry array , where
298
	 * , where getMarkerCounts()[severity] is the number of markers in 
298
	 * getMarkerCounts()[severity] is the number of markers in the list with the
299
	 * the list with the given severity.
299
	 * given severity.
300
	 * 
300
	 * 
301
	 * @return an array of {@link Integer} where index indicates
301
	 * @return an array of {@link Integer} where index indicates
302
	 *         [errors,warnings,infos,others]
302
	 *         [errors,warnings,infos,others]
Lines 366-372 Link Here
366
	 * @return MarkerSupportItem[]
366
	 * @return MarkerSupportItem[]
367
	 */
367
	 */
368
	public MarkerSupportItem[] getElements() {
368
	public MarkerSupportItem[] getElements() {
369
		if(builder.isShowingHierarchy()){
369
		if (builder.isShowingHierarchy()) {
370
			return categories;
370
			return categories;
371
		}
371
		}
372
		return markerEntryArray;
372
		return markerEntryArray;
Lines 378-387 Link Here
378
	CachedMarkerBuilder getBuilder() {
378
	CachedMarkerBuilder getBuilder() {
379
		return builder;
379
		return builder;
380
	}
380
	}
381
	
381
382
	/**
382
	/**
383
	 * Use clone where thread safety is concerned.
383
	 * Use clone where thread safety is concerned. The method is non-blocking.
384
	 * The method is non-blocking.
385
	 */
384
	 */
386
	Markers getClone() {
385
	Markers getClone() {
387
		Markers markers = new Markers(builder);
386
		Markers markers = new Markers(builder);
Lines 399-405 Link Here
399
		return inChange;
398
		return inChange;
400
	}
399
	}
401
400
402
	/* (non-Javadoc)
401
	/*
402
	 * (non-Javadoc)
403
	 * 
403
	 * @see java.lang.Object#hashCode()
404
	 * @see java.lang.Object#hashCode()
404
	 */
405
	 */
405
	public int hashCode() {
406
	public int hashCode() {
Lines 409-415 Link Here
409
		return result;
410
		return result;
410
	}
411
	}
411
412
412
	/* (non-Javadoc)
413
	/*
414
	 * (non-Javadoc)
415
	 * 
413
	 * @see java.lang.Object#equals(java.lang.Object)
416
	 * @see java.lang.Object#equals(java.lang.Object)
414
	 */
417
	 */
415
	public boolean equals(Object obj) {
418
	public boolean equals(Object obj) {
(-)src/org/eclipse/ui/internal/views/markers/MarkersViewSettingDialog.java (+318 lines)
Added Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2008, 2009 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
12
package org.eclipse.ui.internal.views.markers;
13
14
import java.util.ArrayList;
15
import java.util.Collection;
16
import java.util.Iterator;
17
import java.util.List;
18
19
import org.eclipse.jface.viewers.ITableLabelProvider;
20
import org.eclipse.swt.SWT;
21
import org.eclipse.swt.widgets.Composite;
22
import org.eclipse.swt.widgets.Control;
23
import org.eclipse.swt.widgets.Shell;
24
import org.eclipse.ui.internal.ide.IDEInternalPreferences;
25
import org.eclipse.ui.internal.ide.IDEWorkbenchPlugin;
26
import org.eclipse.ui.views.markers.MarkerField;
27
import org.eclipse.ui.views.markers.internal.MarkerMessages;
28
29
/**
30
 * MarkersViewSettingDialog is the dialog for showing marker preferences.
31
 * 
32
 * 
33
 * @since 3.7
34
 * @author Hitesh Soliwal
35
 * 
36
 */
37
public class MarkersViewSettingDialog extends ViewerColumnsDialog {
38
39
	private ExtendedMarkersView extendedView;
40
41
	/**
42
	 * Create a new instance of the receiver.
43
	 * 
44
	 * @param view
45
	 *            - the view this is being launched from
46
	 */
47
	public MarkersViewSettingDialog(ExtendedMarkersView view) {
48
		super(view.getSite().getShell());
49
		this.extendedView = view;
50
		initialize(convert(extendedView.getBuilder().getGenerator()
51
				.getVisibleFields()), convert(extendedView.getBuilder()
52
				.getGenerator().getAllFields()), false);
53
		setLimitValue(IDEWorkbenchPlugin.getDefault().getPreferenceStore()
54
				.getInt(IDEInternalPreferences.MARKER_LIMITS_VALUE));
55
	}
56
57
	/*
58
	 * (non-Javadoc)
59
	 * 
60
	 * @see
61
	 * org.eclipse.jface.window.Window#configureShell(org.eclipse.swt.widgets
62
	 * .Shell)
63
	 */
64
	protected void configureShell(Shell newShell) {
65
		super.configureShell(newShell);
66
		newShell.setText(MarkerMessages.MarkerPreferences_DialogTitle);
67
	}
68
69
	/*
70
	 * (non-Javadoc)
71
	 * 
72
	 * @see org.eclipse.jface.window.Window#getShellStyle()
73
	 */
74
	protected int getShellStyle() {
75
		return super.getShellStyle() | SWT.RESIZE;
76
	}
77
78
	/*
79
	 * (non-Javadoc)
80
	 * 
81
	 * @see
82
	 * org.eclipse.jface.dialogs.Dialog#createDialogArea(org.eclipse.swt.widgets
83
	 * .Composite)
84
	 */
85
	protected Control createDialogArea(Composite parent) {
86
		Control control = super.createDialogArea(parent);
87
		return control;
88
	}
89
90
	/*
91
	 * (non-Javadoc)
92
	 * 
93
	 * @see org.eclipse.jface.dialogs.Dialog#okPressed()
94
	 */
95
	protected void okPressed() {
96
		IDEWorkbenchPlugin
97
				.getDefault()
98
				.getPreferenceStore()
99
				.setValue(IDEInternalPreferences.MARKER_LIMITS_VALUE,
100
						getLimitValue());
101
		IDEWorkbenchPlugin.getDefault().savePluginPreferences();
102
		extendedView.setVisibleFields(getVisibleFields(), getNewWidths());
103
		super.okPressed();
104
	}
105
106
	/**
107
	 */
108
	private int[] getNewWidths() {
109
		List visible = getVisible();
110
		int[] widths = new int[visible.size()];
111
		int i = 0;
112
		Iterator iterator = visible.iterator();
113
		while (iterator.hasNext()) {
114
			widths[i++] = ((FieldEntry) iterator.next()).width;
115
		}
116
		return widths;
117
118
	}
119
120
	private Collection getVisibleFields() {
121
		List visible = getVisible();
122
		List list = new ArrayList(visible.size());
123
		Iterator iterator = visible.iterator();
124
		while (iterator.hasNext()) {
125
			list.add(((FieldEntry) iterator.next()).field);
126
		}
127
		return list;
128
	}
129
130
	/*
131
	 * (non-Javadoc)
132
	 * 
133
	 * @see org.eclipse.ui.preferences.ViewSettingsDialog#performDefaults()
134
	 */
135
	protected void performDefaults() {
136
		initialize(convert(extendedView.getBuilder().getGenerator()
137
				.getInitialVisible()), convert(extendedView.getBuilder()
138
				.getGenerator().getAllFields()), true);
139
		setLimitValue(IDEWorkbenchPlugin.getDefault().getPreferenceStore()
140
				.getDefaultInt(IDEInternalPreferences.MARKER_LIMITS_VALUE));
141
		super.performDefaults();
142
	}
143
144
	/**
145
	 * @param visibleFields
146
	 * @param allFields
147
	 */
148
	void initialize(FieldEntry[] visibleFields, FieldEntry[] allFields,
149
			boolean defaultWidths) {
150
		List visible = getVisible();
151
		List nonVisible = getNonVisible();
152
		visible.clear();
153
		nonVisible.clear();
154
		for (int i = 0; i < allFields.length; i++) {
155
			nonVisible.add(allFields[i]);
156
		}
157
		for (int i = 0; i < visibleFields.length; i++) {
158
			nonVisible.remove(visibleFields[i]);
159
			visible.add(visibleFields[i]);
160
			visibleFields[i].visible = true;
161
			if (defaultWidths) {
162
				visibleFields[i].width = visibleFields[i].field
163
						.getDefaultColumnWidth(extendedView.getViewer()
164
								.getControl());
165
			} else {
166
				visibleFields[i].width = extendedView.getFieldWidth(
167
						visibleFields[i].field, -1);
168
			}
169
		}
170
	}
171
172
	/*
173
	 * (non-Javadoc)
174
	 * 
175
	 * @see
176
	 * org.eclipse.ui.internal.views.markers.ViewerColumnsDialog#getLabelProvider
177
	 * ()
178
	 */
179
	protected ITableLabelProvider getLabelProvider() {
180
		return new TableLabelProvider() {
181
			public String getText(Object element) {
182
				return ((FieldEntry) element).field.getName();
183
			}
184
		};
185
	}
186
187
	/*
188
	 * (non-Javadoc)
189
	 * 
190
	 * @see org.eclipse.ui.internal.views.markers.ViewerColumnsDialog#
191
	 * getColumnInfoProvider()
192
	 */
193
	protected IColumnInfoProvider getColumnInfoProvider() {
194
195
		return new IColumnInfoProvider() {
196
			public int getColumnIndex(Object columnObj) {
197
				return getVisible().indexOf(columnObj);
198
			}
199
200
			public int getColumnWidth(Object columnObj) {
201
				FieldEntry field = (FieldEntry) columnObj;
202
				return extendedView.getFieldWidth(field.field, field.width);
203
			}
204
205
			public boolean isColumnVisible(Object columnObj) {
206
				return ((FieldEntry) columnObj).visible;
207
			}
208
209
			public boolean isColumnMovable(Object columnObj) {
210
				return true;
211
			}
212
213
			public boolean isColumnResizable(Object columnObj) {
214
				return true;
215
			}
216
		};
217
	}
218
219
	/*
220
	 * (non-Javadoc)
221
	 * 
222
	 * @see
223
	 * org.eclipse.ui.internal.views.markers.ViewerColumnsDialog#getColumnUpdater
224
	 * ()
225
	 */
226
	protected IColumnUpdater getColumnUpdater() {
227
228
		return new IColumnUpdater() {
229
			public void setColumnVisible(Object columnObj, boolean visible) {
230
				((FieldEntry) columnObj).visible = visible;
231
			}
232
233
			public void setColumnMovable(Object columnObj, boolean movable) {
234
				// not implemented
235
			}
236
237
			public void setColumnIndex(Object columnObj, int index) {
238
				// ignore
239
			}
240
241
			public void setColumnResizable(Object columnObj, boolean resizable) {
242
				// ignore
243
			}
244
245
			public void setColumnWidth(Object columnObj, int newWidth) {
246
				((FieldEntry) columnObj).width = newWidth;
247
			}
248
		};
249
	}
250
251
	private static FieldEntry[] convert(Object[] fields) {
252
		FieldEntry[] entries = new FieldEntry[fields.length];
253
		for (int i = 0; i < entries.length; i++) {
254
			entries[i] = new FieldEntry((MarkerField) fields[i], i);
255
		}
256
		return entries;
257
	}
258
259
	static class FieldEntry {
260
		final MarkerField field;
261
		int width;
262
		boolean visible;
263
264
		FieldEntry(MarkerField field, int width) {
265
			this.field = field;
266
			this.width = width;
267
			visible = false;
268
		}
269
270
		/*
271
		 * (non-Javadoc)
272
		 * 
273
		 * @see java.lang.Object#toString()
274
		 */
275
		public String toString() {
276
			// TODO Auto-generated method stub
277
			return super.toString();
278
		}
279
280
		/*
281
		 * (non-Javadoc)
282
		 * 
283
		 * @see java.lang.Object#hashCode()
284
		 */
285
		public int hashCode() {
286
			final int prime = 31;
287
			int result = 1;
288
			result = prime * result + ((field == null) ? 0 : field.hashCode());
289
			return result;
290
		}
291
292
		/*
293
		 * (non-Javadoc)
294
		 * 
295
		 * @see java.lang.Object#equals(java.lang.Object)
296
		 */
297
		public boolean equals(Object obj) {
298
			if (this == obj) {
299
				return true;
300
			}
301
			if (obj == null) {
302
				return false;
303
			}
304
			if (!(obj instanceof FieldEntry)) {
305
				return false;
306
			}
307
			FieldEntry other = (FieldEntry) obj;
308
			if (field == null) {
309
				if (other.field != null) {
310
					return false;
311
				}
312
			} else if (!field.equals(other.field)) {
313
				return false;
314
			}
315
			return true;
316
		}
317
	}
318
}
(-)src/org/eclipse/ui/internal/views/markers/ViewerColumnsDialog.java (+1135 lines)
Added Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2010 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
12
package org.eclipse.ui.internal.views.markers;
13
14
import java.util.ArrayList;
15
import java.util.Arrays;
16
import java.util.Iterator;
17
import java.util.List;
18
import java.util.ListIterator;
19
import java.util.Random;
20
21
import org.eclipse.jface.dialogs.Dialog;
22
import org.eclipse.jface.resource.JFaceResources;
23
import org.eclipse.jface.viewers.ISelection;
24
import org.eclipse.jface.viewers.ISelectionChangedListener;
25
import org.eclipse.jface.viewers.IStructuredContentProvider;
26
import org.eclipse.jface.viewers.IStructuredSelection;
27
import org.eclipse.jface.viewers.ITableLabelProvider;
28
import org.eclipse.jface.viewers.LabelProvider;
29
import org.eclipse.jface.viewers.SelectionChangedEvent;
30
import org.eclipse.jface.viewers.TableViewer;
31
import org.eclipse.jface.viewers.Viewer;
32
import org.eclipse.swt.SWT;
33
import org.eclipse.swt.custom.CLabel;
34
import org.eclipse.swt.events.ModifyEvent;
35
import org.eclipse.swt.events.ModifyListener;
36
import org.eclipse.swt.graphics.Image;
37
import org.eclipse.swt.layout.FillLayout;
38
import org.eclipse.swt.layout.GridData;
39
import org.eclipse.swt.layout.GridLayout;
40
import org.eclipse.swt.widgets.Button;
41
import org.eclipse.swt.widgets.Composite;
42
import org.eclipse.swt.widgets.Control;
43
import org.eclipse.swt.widgets.Display;
44
import org.eclipse.swt.widgets.Event;
45
import org.eclipse.swt.widgets.Group;
46
import org.eclipse.swt.widgets.Label;
47
import org.eclipse.swt.widgets.Listener;
48
import org.eclipse.swt.widgets.Shell;
49
import org.eclipse.swt.widgets.Table;
50
import org.eclipse.swt.widgets.TableColumn;
51
import org.eclipse.swt.widgets.Text;
52
import org.eclipse.ui.preferences.ViewSettingsDialog;
53
import org.eclipse.ui.views.markers.internal.MarkerMessages;
54
55
/**
56
 * This was introduced as a fix to Bug , as an effort to combine the columns and
57
 * preference dialogs into one. It should be noted that the class can be re-used
58
 * or turned into a tool for column viewers in general.
59
 * 
60
 * @since 3.7
61
 * 
62
 * @author Hitesh Soliwal
63
 * 
64
 */
65
abstract class ViewerColumnsDialog extends ViewSettingsDialog {
66
67
	/** The list contains columns that are currently visible in viewer */
68
	private List visible;
69
70
	/** The list contains columns that are note shown in viewer */
71
	private List nonVisible;
72
73
	/**
74
	 * The number of elements to show at Max. A zero value may indicate
75
	 * disablement of limit
76
	 */
77
	private int limitValue;
78
79
	/** The message area */
80
	private CLabel messageLabel;
81
82
	private TableViewer visibleViewer, nonVisibleViewer;
83
84
	private Button upButton, downButton;
85
86
	private Button toVisibleBtt, toNonVisibleBtt;
87
88
	private Text widthText, limitEditor;
89
90
	/**
91
	 * A listener to validate positive integer numbers only
92
	 */
93
	Listener postivIntTextListener = new Listener() {
94
95
		private String intialValue;
96
97
		public void handleEvent(Event event) {
98
			String string = isValidNumber(event);
99
			if (string != null) {
100
				setValid(false, string);
101
				if (event.type == SWT.FocusOut) {
102
					Text text = (Text) event.widget;
103
					text.setText(intialValue != null ? intialValue : Integer
104
							.toString(0));
105
					text.setFocus();
106
					text.selectAll();
107
				} else {
108
					event.doit = false;
109
				}
110
				return;
111
			} else if (event.type == SWT.FocusOut) {
112
				Text text = (Text) event.widget;
113
				intialValue = text.getText().trim();
114
			} else if (event.type == SWT.FocusIn) {
115
				intialValue = string;
116
			}
117
			setValid(true, null);
118
		}
119
120
		private String isValidNumber(Event event) {
121
			Text text = (Text) event.widget;
122
			String value = text.getText().trim();
123
			switch (event.type) {
124
			case SWT.KeyDown:
125
				return ((Character.isISOControl(event.character) && value
126
						.length() != 0) || Character.isDigit(event.character)) ? null
127
						: errorMessage();
128
			case SWT.FocusOut:
129
				if (value.length() == 0) {
130
					text.setText(intialValue != null ? intialValue : Integer
131
							.toString(0));
132
					text.selectAll();
133
					return null;
134
				}
135
				try {
136
					Integer.parseInt(value);
137
					return null;
138
				} catch (Exception e) {
139
					return e.getLocalizedMessage();
140
				}
141
			}
142
			return null;
143
		}
144
	};
145
146
	/**
147
	 * Create a new instance of the receiver.
148
	 * 
149
	 * @param parentShell
150
	 */
151
	ViewerColumnsDialog(Shell parentShell) {
152
		super(parentShell);
153
	}
154
155
	/**
156
	 * Initialize visible /non-visible columns.
157
	 * 
158
	 * @param columnObjs
159
	 */
160
	void setColumnsObjs(Object[] columnObjs) {
161
		IColumnInfoProvider columnInfo = doGetColumnInfoProvider();
162
		IColumnUpdater updater = doGetColumnUpdater();
163
		List visible = getVisible();
164
		List nonVisible = getNonVisible();
165
		visible.clear();
166
		nonVisible.clear();
167
		Object data = null;
168
		for (int i = 0; i < columnObjs.length; i++) {
169
			data = columnObjs[i];
170
			if (columnInfo.isColumnVisible(data)) {
171
				updater.setColumnVisible(data, true);
172
				updater.setColumnIndex(data, visible.size());
173
				visible.add(data);
174
			} else {
175
				updater.setColumnVisible(data, false);
176
				updater.setColumnIndex(data, nonVisible.size());
177
				nonVisible.add(data);
178
			}
179
		}
180
	}
181
182
	/*
183
	 * (non-Javadoc)
184
	 * 
185
	 * @see
186
	 * org.eclipse.jface.window.Window#configureShell(org.eclipse.swt.widgets
187
	 * .Shell)
188
	 */
189
	protected void configureShell(Shell newShell) {
190
		super.configureShell(newShell);
191
		newShell.setText(JFaceResources
192
				.getString("ConfigureColumnsDialog_Title")); //$NON-NLS-1$
193
	}
194
195
	/*
196
	 * (non-Javadoc)
197
	 * 
198
	 * @see org.eclipse.jface.window.Window#getShellStyle()
199
	 */
200
	protected int getShellStyle() {
201
		return super.getShellStyle() | SWT.RESIZE;
202
	}
203
204
	/*
205
	 * (non-Javadoc)
206
	 * 
207
	 * @see
208
	 * org.eclipse.jface.dialogs.Dialog#createDialogArea(org.eclipse.swt.widgets
209
	 * .Composite)
210
	 */
211
	protected Control createDialogArea(Composite parent) {
212
213
		Composite dialogArea = (Composite) super.createDialogArea(parent);
214
215
		dialogArea.setLayout(new GridLayout(1, true));
216
217
		initializeDialogUnits(dialogArea);
218
219
		createMessageArea(dialogArea);
220
221
		createLimitArea(dialogArea);
222
223
		createColumnsArea(dialogArea);
224
225
		applyDialogFont(dialogArea);
226
227
		return dialogArea;
228
	}
229
230
	/**
231
	 * Create message area.
232
	 * 
233
	 * @param parent
234
	 */
235
	void createMessageArea(Composite parent) {
236
		messageLabel = new CLabel(parent, SWT.NONE);
237
		messageLabel.setImage(JFaceResources
238
				.getImage(Dialog.DLG_IMG_MESSAGE_INFO));
239
		messageLabel
240
				.setLayoutData(new GridData(SWT.FILL, SWT.NONE, true, false));
241
	}
242
243
	/**
244
	 * Create element limit area.
245
	 * 
246
	 * @param parent
247
	 */
248
	void createLimitArea(Composite parent) {
249
		Composite composite = new Group(parent, SWT.NONE);
250
		composite.setLayout(new GridLayout(2, false));
251
		composite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
252
253
		CLabel cLabel = new CLabel(composite, SWT.NONE);
254
		cLabel.setText(MarkerMessages.MarkerPreferences_VisibleItems);
255
		cLabel.setLayoutData(new GridData());
256
257
		limitEditor = new Text(composite, SWT.BORDER);
258
		limitEditor.setText(Integer.toString(getLimitValue()));
259
		limitEditor.setLayoutData(new GridData());
260
		limitEditor.addListener(SWT.FocusIn, postivIntTextListener);
261
		limitEditor.addListener(SWT.FocusOut, postivIntTextListener);
262
		limitEditor.addListener(SWT.KeyDown, postivIntTextListener);
263
		limitEditor.addModifyListener(new ModifyListener() {
264
			public void modifyText(ModifyEvent e) {
265
				setLimitValue(Integer.parseInt(limitEditor.getText().trim()));
266
			}
267
		});
268
		limitEditor.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
269
	}
270
271
	/**
272
	 * Create the controls to configure columns.
273
	 * 
274
	 * @param dialogArea
275
	 */
276
	void createColumnsArea(Composite dialogArea) {
277
		Group columnArea = new Group(dialogArea, SWT.NONE);
278
		columnArea.setLayout(new GridLayout(4, false));
279
		GridData gData = new GridData(GridData.FILL_BOTH
280
				| GridData.GRAB_HORIZONTAL | GridData.GRAB_VERTICAL);
281
		columnArea.setLayoutData(gData);
282
		columnArea.setText(MarkerMessages.MarkerPreferences_ColumnGroupTitle);
283
284
		createInvisibleTable(columnArea);
285
		createMoveButtons(columnArea);
286
		createVisibleTable(columnArea);
287
		createUpDownBtt(columnArea);
288
		createWidthArea(columnArea);
289
	}
290
291
	/**
292
	 * The Up and Down button to change column ordering.
293
	 * 
294
	 * @param parent
295
	 */
296
	void createUpDownBtt(Composite parent) {
297
		Composite composite = new Composite(parent, SWT.NONE);
298
		composite.setLayout(new GridLayout(1, true));
299
		composite.setLayoutData(new GridData(GridData.FILL_VERTICAL));
300
		upButton = new Button(composite, SWT.PUSH);
301
		upButton.setText(JFaceResources.getString("ConfigureColumnsDialog_up")); //$NON-NLS-1$
302
		upButton.addListener(SWT.Selection, new Listener() {
303
			public void handleEvent(Event event) {
304
				handleUpButton(event);
305
			}
306
		});
307
		upButton.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
308
		upButton.setEnabled(false);
309
310
		downButton = new Button(composite, SWT.PUSH);
311
		downButton.setText(JFaceResources
312
				.getString("ConfigureColumnsDialog_down")); //$NON-NLS-1$
313
		downButton.addListener(SWT.Selection, new Listener() {
314
			public void handleEvent(Event event) {
315
				handleDownButton(event);
316
			}
317
		});
318
		downButton.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
319
		downButton.setEnabled(false);
320
	}
321
322
	/**
323
	 * Create the controls responsible to display/edit column widths.
324
	 * 
325
	 * @param parent
326
	 */
327
	void createWidthArea(Composite parent) {
328
		Label widthLabel = new Label(parent, SWT.NONE);
329
		widthLabel.setText(JFaceResources
330
				.getString("ConfigureColumnsDialog_WidthOfSelectedColumn")); //$NON-NLS-1$
331
		GridData gridData = new GridData(GridData.FILL_HORIZONTAL
332
				| GridData.HORIZONTAL_ALIGN_END);
333
		gridData.horizontalSpan = 3;
334
		widthLabel.setLayoutData(gridData);
335
336
		widthText = new Text(parent, SWT.SINGLE | SWT.BORDER);
337
		widthText.setText(Integer.toString(0));
338
		gridData = new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING);
339
		gridData.widthHint = convertWidthInCharsToPixels(5);
340
		widthText.setLayoutData(gridData);
341
		widthText.addListener(SWT.FocusIn, postivIntTextListener);
342
		widthText.addListener(SWT.FocusOut, postivIntTextListener);
343
		widthText.addListener(SWT.KeyDown, postivIntTextListener);
344
		widthText.addModifyListener(new ModifyListener() {
345
			public void modifyText(ModifyEvent e) {
346
				if (widthText.isEnabled()) {
347
					Object data = ((IStructuredSelection) visibleViewer
348
							.getSelection()).getFirstElement();
349
					if (data != null) {
350
						IColumnUpdater updater = getColumnUpdater();
351
						updater.setColumnWidth(data,
352
								Integer.parseInt(widthText.getText().trim()));
353
					}
354
				}
355
			}
356
		});
357
		widthText.setEditable(false);
358
	}
359
360
	/**
361
	 * Adapter to {@link IStructuredContentProvider}
362
	 */
363
	abstract class ContentProviderAdapter implements IStructuredContentProvider {
364
365
		public void dispose() {
366
		}
367
368
		public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
369
		}
370
	}
371
372
	/**
373
	 * Creates the table that lists out visible columns in the viewer
374
	 * 
375
	 * @param parent
376
	 */
377
	void createVisibleTable(Composite parent) {
378
		final Table table = new Table(parent, SWT.BORDER | SWT.MULTI);
379
		GridData data = new GridData(SWT.FILL, SWT.FILL, true, true);
380
		data.widthHint = convertWidthInCharsToPixels(30);
381
		data.heightHint = table.getItemHeight() * 15;
382
		table.setLayoutData(data);
383
		table.setHeaderVisible(true);
384
385
		final TableColumn column = new TableColumn(table, SWT.NONE);
386
		column.setText(MarkerMessages.MarkerPreferences_VisibleColumnsTitle);
387
		Listener columnResize = new Listener() {
388
			public void handleEvent(Event event) {
389
				column.setWidth(table.getClientArea().width);
390
			}
391
		};
392
		table.addListener(SWT.Resize, columnResize);
393
394
		visibleViewer = new TableViewer(table);
395
		visibleViewer.setLabelProvider(doGetLabelProvider());
396
		visibleViewer.setContentProvider(new ContentProviderAdapter() {
397
			public Object[] getElements(Object inputElement) {
398
				return getVisible().toArray();
399
			}
400
		});
401
		visibleViewer
402
				.addSelectionChangedListener(new ISelectionChangedListener() {
403
					public void selectionChanged(SelectionChangedEvent event) {
404
						handleVisibleSelection(event.getSelection());
405
					}
406
				});
407
		table.addListener(SWT.MouseDoubleClick, new Listener() {
408
			public void handleEvent(Event event) {
409
				handleToNonVisibleButton(event);
410
			}
411
		});
412
		visibleViewer.setInput(this);
413
	}
414
415
	/**
416
	 * Creates the table that lists out non-visible columns in the viewer
417
	 * 
418
	 * @param parent
419
	 */
420
	void createInvisibleTable(Composite parent) {
421
		final Table table = new Table(parent, SWT.BORDER | SWT.MULTI);
422
		GridData data = new GridData(SWT.FILL, SWT.FILL, true, true);
423
		data.widthHint = convertWidthInCharsToPixels(30);
424
		data.heightHint = table.getItemHeight() * 15;
425
		table.setLayoutData(data);
426
		table.setHeaderVisible(true);
427
428
		final TableColumn column = new TableColumn(table, SWT.NONE);
429
		column.setText(MarkerMessages.MarkerPreferences_HiddenColumnsTitle);
430
		Listener columnResize = new Listener() {
431
			public void handleEvent(Event event) {
432
				column.setWidth(table.getClientArea().width);
433
			}
434
		};
435
		table.addListener(SWT.Resize, columnResize);
436
437
		nonVisibleViewer = new TableViewer(table);
438
		nonVisibleViewer.setLabelProvider(doGetLabelProvider());
439
		nonVisibleViewer.setContentProvider(new ContentProviderAdapter() {
440
			public Object[] getElements(Object inputElement) {
441
				return getNonVisible().toArray();
442
			}
443
		});
444
		nonVisibleViewer
445
				.addSelectionChangedListener(new ISelectionChangedListener() {
446
					public void selectionChanged(SelectionChangedEvent event) {
447
						handleNonVisibleSelection(event.getSelection());
448
					}
449
				});
450
		table.addListener(SWT.MouseDoubleClick, new Listener() {
451
			public void handleEvent(Event event) {
452
				handleToVisibleButton(event);
453
			}
454
		});
455
		nonVisibleViewer.setInput(this);
456
	}
457
458
	/**
459
	 * Creates buttons for moving columns from non-visible to visible and
460
	 * vice-versa
461
	 * 
462
	 * @param parent
463
	 */
464
	void createMoveButtons(Composite parent) {
465
		Composite bttArea = new Composite(parent, SWT.NONE);
466
		bttArea.setLayout(new GridLayout(1, true));
467
		bttArea.setLayoutData(new GridData(GridData.FILL_VERTICAL));
468
469
		toNonVisibleBtt = new Button(bttArea, SWT.PUSH);
470
		toNonVisibleBtt
471
				.setText(getDefaultOrientation() == SWT.RIGHT_TO_LEFT ? MarkerMessages.MarkerPreferences_MoveRight
472
						: MarkerMessages.MarkerPreferences_MoveLeft);
473
		toNonVisibleBtt.setLayoutData(new GridData());
474
475
		toNonVisibleBtt.addListener(SWT.Selection, new Listener() {
476
			public void handleEvent(Event event) {
477
				handleToNonVisibleButton(event);
478
			}
479
		});
480
		toNonVisibleBtt.setEnabled(false);
481
482
		toVisibleBtt = new Button(bttArea, SWT.PUSH);
483
		toVisibleBtt
484
				.setText(getDefaultOrientation() == SWT.RIGHT_TO_LEFT ? MarkerMessages.MarkerPreferences_MoveLeft
485
						: MarkerMessages.MarkerPreferences_MoveRight);
486
		toVisibleBtt.setLayoutData(new GridData());
487
		toVisibleBtt.addListener(SWT.Selection, new Listener() {
488
			public void handleEvent(Event event) {
489
				handleToVisibleButton(event);
490
			}
491
		});
492
		toVisibleBtt.setEnabled(false);
493
	}
494
495
	/**
496
	 * Display the error message and an appropriate icon.
497
	 * 
498
	 * @param state
499
	 */
500
	void setValid(boolean state, String errorMessage) {
501
		if (state) {
502
			messageLabel.setImage(JFaceResources
503
					.getImage(Dialog.DLG_IMG_MESSAGE_INFO));
504
			messageLabel
505
					.setText(MarkerMessages.MarkerPreferences_Zero_Or_Blank_Value_Indicates_No_Limit);
506
		} else {
507
			messageLabel.setImage(JFaceResources
508
					.getImage(Dialog.DLG_IMG_MESSAGE_ERROR));
509
			messageLabel.setText(errorMessage);
510
		}
511
	}
512
513
	/*
514
	 * (non-Javadoc)
515
	 * 
516
	 * @see org.eclipse.ui.preferences.ViewSettingsDialog#performDefaults()
517
	 */
518
	protected void performDefaults() {
519
		refreshViewers();
520
		super.performDefaults();
521
	}
522
523
	/**
524
	 * Handles a selection change in the viewer that lists out the non-visible
525
	 * columns
526
	 * 
527
	 * @param selection
528
	 */
529
	void handleNonVisibleSelection(ISelection selection) {
530
		Object[] nvKeys = ((IStructuredSelection) selection).toArray();
531
		toVisibleBtt.setEnabled(nvKeys.length > 0);
532
	}
533
534
	/**
535
	 * Handles a selection change in the viewer that lists out the visible
536
	 * columns. Takes care of various enablements.
537
	 * 
538
	 * @param selection
539
	 */
540
	void handleVisibleSelection(ISelection selection) {
541
		List selVCols = ((IStructuredSelection) selection).toList();
542
		List allVCols = getVisible();
543
		toNonVisibleBtt.setEnabled(selVCols.size() > 0
544
				&& allVCols.size() > selVCols.size());
545
546
		IColumnInfoProvider infoProvider = doGetColumnInfoProvider();
547
		boolean moveDown = !selVCols.isEmpty(), moveUp = !selVCols.isEmpty();
548
		Iterator iterator = selVCols.iterator();
549
		while (iterator.hasNext()) {
550
			Object columnObj = iterator.next();
551
			if (!infoProvider.isColumnMovable(columnObj)) {
552
				moveUp = false;
553
				moveDown = false;
554
				break;
555
			}
556
			int i = allVCols.indexOf(columnObj);
557
			if (i == 0) {
558
				moveUp = false;
559
				if (!moveDown) {
560
					break;
561
				}
562
			}
563
			if (i == (allVCols.size() - 1)) {
564
				moveDown = false;
565
				if (!moveUp) {
566
					break;
567
				}
568
			}
569
		}
570
		upButton.setEnabled(moveUp);
571
		downButton.setEnabled(moveDown);
572
573
		boolean edit = selVCols.size() == 1 ? infoProvider
574
				.isColumnResizable(selVCols.get(0)) : false;
575
		if (edit) {
576
			widthText.setText(Integer.toString(infoProvider
577
					.getColumnWidth(selVCols.get(0))));
578
		} else {
579
			widthText.setText(Integer.toString(0));
580
		}
581
		widthText.setEditable(edit);
582
583
	}
584
585
	/**
586
	 * Applies to visible columns, and handles the changes in the order of
587
	 * columns
588
	 * 
589
	 * @param e
590
	 *            event from the button click
591
	 */
592
	void handleDownButton(Event e) {
593
		IStructuredSelection selection = (IStructuredSelection) visibleViewer
594
				.getSelection();
595
		Object[] selVCols = selection.toArray();
596
		List allVCols = getVisible();
597
		IColumnUpdater updater = doGetColumnUpdater();
598
		for (int i = selVCols.length - 1; i >= 0; i--) {
599
			Object colObj = selVCols[i];
600
			int index = allVCols.indexOf(colObj);
601
			updater.setColumnIndex(colObj, index + 1);
602
			allVCols.remove(index);
603
			allVCols.add(index + 1, colObj);
604
		}
605
		visibleViewer.refresh();
606
		handleVisibleSelection(selection);
607
	}
608
609
	/**
610
	 * Applies to visible columns, and handles the changes in the order of
611
	 * columns
612
	 * 
613
	 * @param e
614
	 *            event from the button click
615
	 */
616
	void handleUpButton(Event e) {
617
		IStructuredSelection selection = (IStructuredSelection) visibleViewer
618
				.getSelection();
619
		Object[] selVCols = selection.toArray();
620
		List allVCols = getVisible();
621
		IColumnUpdater updater = doGetColumnUpdater();
622
		for (int i = 0; i < selVCols.length; i++) {
623
			Object colObj = selVCols[i];
624
			int index = allVCols.indexOf(colObj);
625
			updater.setColumnIndex(colObj, index - 1);
626
			allVCols.remove(index);
627
			allVCols.add(index - 1, colObj);
628
		}
629
		visibleViewer.refresh();
630
		handleVisibleSelection(selection);
631
	}
632
633
	/**
634
	 * Moves selected columns from non-visible to visible state
635
	 * 
636
	 * @param e
637
	 *            event from the button click
638
	 */
639
	void handleToVisibleButton(Event e) {
640
		IStructuredSelection selection = (IStructuredSelection) nonVisibleViewer
641
				.getSelection();
642
		List selVCols = selection.toList();
643
		List nonVisible = getNonVisible();
644
		nonVisible.removeAll(selVCols);
645
646
		List list = getVisible();
647
		list.addAll(selVCols);
648
649
		updateVisibility(selVCols, true);
650
		updateIndices(getVisible());
651
		updateIndices(getNonVisible());
652
653
		visibleViewer.refresh();
654
		visibleViewer.setSelection(selection);
655
		nonVisibleViewer.refresh();
656
		handleVisibleSelection(selection);
657
		handleNonVisibleSelection(nonVisibleViewer.getSelection());
658
	}
659
660
	/**
661
	 * Moves selected columns from visible to non-visible state
662
	 * 
663
	 * @param e
664
	 *            event from the button click
665
	 */
666
	protected void handleToNonVisibleButton(Event e) {
667
		IStructuredSelection selection = (IStructuredSelection) visibleViewer
668
				.getSelection();
669
		List selVCols = selection.toList();
670
		getVisible().removeAll(selVCols);
671
		getNonVisible().addAll(selVCols);
672
673
		updateVisibility(selVCols, false);
674
		updateIndices(getVisible());
675
		updateIndices(getNonVisible());
676
677
		nonVisibleViewer.refresh();
678
		nonVisibleViewer.setSelection(selection);
679
		visibleViewer.refresh();
680
		handleVisibleSelection(visibleViewer.getSelection());
681
		handleNonVisibleSelection(nonVisibleViewer.getSelection());
682
	}
683
684
	void updateIndices(List list) {
685
		ListIterator iterator = list.listIterator();
686
		IColumnUpdater updater = doGetColumnUpdater();
687
		while (iterator.hasNext()) {
688
			updater.setColumnIndex(iterator.next(), iterator.previousIndex());
689
		}
690
	}
691
692
	void updateVisibility(List list, boolean visibility) {
693
		IColumnUpdater updater = doGetColumnUpdater();
694
		Iterator iterator = list.iterator();
695
		while (iterator.hasNext()) {
696
			updater.setColumnVisible(iterator.next(), visibility);
697
		}
698
	}
699
700
	/**
701
	 * Updates the UI based on values of the variable
702
	 */
703
	void refreshViewers() {
704
		if (limitEditor != null) {
705
			limitEditor.setText(Integer.toString(getLimitValue()));
706
		}
707
		if (nonVisibleViewer != null) {
708
			nonVisibleViewer.refresh();
709
		}
710
		if (visibleViewer != null) {
711
			visibleViewer.refresh();
712
		}
713
	}
714
715
	/*
716
	 * (non-Javadoc)
717
	 * 
718
	 * @see org.eclipse.jface.dialogs.Dialog#isResizable()
719
	 */
720
	protected boolean isResizable() {
721
		return true;
722
	}
723
724
	/*
725
	 * (non-Javadoc)
726
	 * 
727
	 * @see org.eclipse.jface.dialogs.Dialog#okPressed()
728
	 */
729
	protected void okPressed() {
730
		super.okPressed();
731
	}
732
733
	/**
734
	 * @return Returns the limitValue.
735
	 */
736
	public int getLimitValue() {
737
		return limitValue;
738
	}
739
740
	/**
741
	 * @param limitValue
742
	 *            The limitValue to set.
743
	 */
744
	void setLimitValue(int limitValue) {
745
		this.limitValue = limitValue;
746
	}
747
748
	/**
749
	 * @return List of visible columns
750
	 */
751
	public List getVisible() {
752
		if (visible == null) {
753
			visible = new ArrayList();
754
		}
755
		return visible;
756
	}
757
758
	/**
759
	 * @return List of non-visible columns
760
	 */
761
	public List getNonVisible() {
762
		if (nonVisible == null) {
763
			nonVisible = new ArrayList();
764
		}
765
		return nonVisible;
766
	}
767
768
	/**
769
	 * @return Returns the error message to display for a wrong limit value.
770
	 */
771
	String errorMessage() {
772
		return JFaceResources.getString("IntegerFieldEditor.errorMessage"); //$NON-NLS-1$
773
	}
774
775
	/**
776
	 * An adapter class to {@link ITableLabelProvider}
777
	 * 
778
	 */
779
	class TableLabelProvider extends LabelProvider implements
780
			ITableLabelProvider {
781
		public Image getColumnImage(Object element, int columnIndex) {
782
			return null;
783
		}
784
785
		public String getColumnText(Object element, int columnIndex) {
786
			return getText(element);
787
		}
788
	}
789
790
	/**
791
	 * Internal helper to @see {@link ViewerColumnsDialog#getLabelProvider()}
792
	 */
793
	ITableLabelProvider doGetLabelProvider() {
794
		return getLabelProvider();
795
	}
796
797
	/**
798
	 * The tables-columns need to be displayed appropriately. The supplied
799
	 * column objects are adapted to text and image as dictacted by this
800
	 * {@link ITableLabelProvider}
801
	 */
802
	protected abstract ITableLabelProvider getLabelProvider();
803
804
	/**
805
	 * Internal helper to @see
806
	 * {@link ViewerColumnsDialog#getColumnInfoProvider()}
807
	 */
808
	IColumnInfoProvider doGetColumnInfoProvider() {
809
		return getColumnInfoProvider();
810
	}
811
812
	/**
813
	 * To configure the columns we need further information. The supplied column
814
	 * objects are adapted for its properties via {@link IColumnInfoProvider}
815
	 */
816
	protected abstract IColumnInfoProvider getColumnInfoProvider();
817
818
	/**
819
	 * Internal helper to @see {@link ViewerColumnsDialog#getColumnUpdater()}
820
	 */
821
	IColumnUpdater doGetColumnUpdater() {
822
		return getColumnUpdater();
823
	}
824
825
	/**
826
	 * To configure properties/order of the columns is achieved via
827
	 * {@link IColumnUpdater}
828
	 */
829
	protected abstract IColumnUpdater getColumnUpdater();
830
831
	/**
832
	 * Update various aspects of a columns from a viewer such
833
	 * {@link TableViewer}
834
	 */
835
	public interface IColumnInfoProvider {
836
837
		/**
838
		 * Get corresponding index for the column
839
		 * 
840
		 * @param columnObj
841
		 */
842
		public int getColumnIndex(Object columnObj);
843
844
		/**
845
		 * Get the width of the column
846
		 * 
847
		 * @param columnObj
848
		 */
849
		public int getColumnWidth(Object columnObj);
850
851
		/**
852
		 * Returns true if the column represented by parameters is showing in
853
		 * the viewer
854
		 * 
855
		 * @param columnObj
856
		 */
857
		public boolean isColumnVisible(Object columnObj);
858
859
		/**
860
		 * Returns true if the column represented by parameters is configured as
861
		 * movable
862
		 * 
863
		 * @param columnObj
864
		 */
865
		public boolean isColumnMovable(Object columnObj);
866
867
		/**
868
		 * Returns true if the column represented by parameters is configured as
869
		 * resizable
870
		 * 
871
		 * @param columnObj
872
		 */
873
		public boolean isColumnResizable(Object columnObj);
874
875
	}
876
877
	/**
878
	 * Update various aspects of a columns from a viewer such
879
	 * {@link TableViewer}
880
	 */
881
	public interface IColumnUpdater {
882
883
		/**
884
		 * Set the column represented by parameters as visible
885
		 * 
886
		 * @param columnObj
887
		 * @param visible
888
		 */
889
		public void setColumnVisible(Object columnObj, boolean visible);
890
891
		/**
892
		 * Dummy method - more a result of symmetry
893
		 * 
894
		 * @param columnObj
895
		 * @param movable
896
		 */
897
		public void setColumnMovable(Object columnObj, boolean movable);
898
899
		/**
900
		 * Call back to notify change in the index of the column represented by
901
		 * columnObj
902
		 * 
903
		 * @param columnObj
904
		 * @param index
905
		 */
906
		public void setColumnIndex(Object columnObj, int index);
907
908
		/**
909
		 * Dummy method - more a result of symmetry
910
		 * 
911
		 * @param columnObj
912
		 * @param resizable
913
		 */
914
		public void setColumnResizable(Object columnObj, boolean resizable);
915
916
		/**
917
		 * Call back to notify change in the width of the column represented by
918
		 * columnObj
919
		 * 
920
		 * @param columnObj
921
		 * @param newWidth
922
		 */
923
		public void setColumnWidth(Object columnObj, int newWidth);
924
925
	}
926
927
	////////////////////////////////////////////////////////////////////////////////////
928
	/**
929
	 * Ignore the class below as it is simply meant to test the above. I intend
930
	 * to retain this for a while.
931
	 */
932
	static class TestData {
933
934
		final Object key;
935
936
		final int keyIndex;
937
938
		int newIndex, width;
939
940
		boolean visibility, movable, resizable;
941
942
		TestData(Object key, int currIndex) {
943
			this.key = key;
944
			this.keyIndex = currIndex;
945
		}
946
947
		public int hashCode() {
948
			final int prime = 31;
949
			int result = 1;
950
			result = prime * result + ((key == null) ? 0 : key.hashCode());
951
			result = prime * result + keyIndex;
952
			return result;
953
		}
954
955
		public boolean equals(Object obj) {
956
			if (this == obj) {
957
				return true;
958
			}
959
			if (obj == null) {
960
				return false;
961
			}
962
			if (!(obj instanceof TestData)) {
963
				return false;
964
			}
965
			TestData other = (TestData) obj;
966
			if (key == null) {
967
				if (other.key != null) {
968
					return false;
969
				}
970
			} else if (!key.equals(other.key)) {
971
				return false;
972
			}
973
			if (keyIndex != other.keyIndex) {
974
				return false;
975
			}
976
			return true;
977
		}
978
979
		public String toString() {
980
			return key.toString();
981
		}
982
983
		private static ViewerColumnsDialog getColumnsDialog(Shell shell,
984
				final TestData[] colums) {
985
			ViewerColumnsDialog dialog = new ViewerColumnsDialog(shell) {
986
987
				protected IColumnInfoProvider getColumnInfoProvider() {
988
					return getInfoProvider(colums);
989
				}
990
991
				protected ITableLabelProvider getLabelProvider() {
992
					return new TableLabelProvider();
993
				}
994
995
				protected IColumnUpdater getColumnUpdater() {
996
					return getUpdater(colums);
997
				}
998
			};
999
			dialog.setColumnsObjs(colums);
1000
			return dialog;
1001
		}
1002
1003
		private static IColumnUpdater getUpdater(final TestData[] data) {
1004
			return new IColumnUpdater() {
1005
1006
				public void setColumnWidth(Object columnObj, int newWidth) {
1007
					((TestData) columnObj).width = newWidth;
1008
				}
1009
1010
				public void setColumnVisible(Object columnObj, boolean visible) {
1011
					((TestData) columnObj).visibility = visible;
1012
				}
1013
1014
				public void setColumnResizable(Object columnObj,
1015
						boolean resizable) {
1016
1017
				}
1018
1019
				public void setColumnMovable(Object columnObj, boolean movable) {
1020
					((TestData) columnObj).movable = movable;
1021
1022
				}
1023
1024
				public void setColumnIndex(Object columnObj, int index) {
1025
					((TestData) columnObj).newIndex = index;
1026
				}
1027
			};
1028
		}
1029
1030
		private static IColumnInfoProvider getInfoProvider(
1031
				final TestData[] colData) {
1032
			return new IColumnInfoProvider() {
1033
1034
				public boolean isColumnVisible(Object columnObj) {
1035
					return ((TestData) columnObj).visibility;
1036
				}
1037
1038
				public boolean isColumnResizable(Object columnObj) {
1039
					return ((TestData) columnObj).resizable;
1040
				}
1041
1042
				public boolean isColumnMovable(Object columnObj) {
1043
					return ((TestData) columnObj).movable;
1044
				}
1045
1046
				public int getColumnWidth(Object columnObj) {
1047
					return ((TestData) columnObj).width;
1048
				}
1049
1050
				public int getColumnIndex(Object columnObj) {
1051
					return ((TestData) columnObj).newIndex;
1052
				}
1053
			};
1054
		}
1055
1056
		private static TestData[] genData(int count) {
1057
			String[] cols = new String[count];
1058
			for (int i = 0; i < cols.length; i++) {
1059
				cols[i] = new String("Column-" + (i + 1)); //$NON-NLS-1$
1060
			}
1061
			Random random = new Random();
1062
1063
			boolean[] visibility = new boolean[cols.length];
1064
			Arrays.fill(visibility, true);
1065
			int ranInt = random.nextInt() % cols.length;
1066
			for (int i = 0; i < ranInt; i++) {
1067
				visibility[random.nextInt(ranInt)] = false;
1068
			}
1069
1070
			boolean[] resizable = new boolean[cols.length];
1071
			Arrays.fill(resizable, true);
1072
			ranInt = random.nextInt() % cols.length;
1073
			for (int i = 0; i < ranInt; i++) {
1074
				resizable[random.nextInt(ranInt)] = false;
1075
			}
1076
1077
			boolean[] movable = new boolean[cols.length];
1078
			Arrays.fill(movable, true);
1079
			ranInt = random.nextInt() % cols.length;
1080
			for (int i = 0; i < ranInt; i++) {
1081
				movable[random.nextInt(ranInt)] = false;
1082
			}
1083
1084
			int[] widths = new int[cols.length];
1085
			Arrays.fill(widths, 100);
1086
			return TestData.generateColumnsData(cols, visibility, resizable,
1087
					movable, widths);
1088
		}
1089
1090
		public static TestData[] generateColumnsData(Object[] keys,
1091
				boolean[] visibility, boolean[] resizable, boolean[] movable,
1092
				int[] widths) {
1093
			TestData[] colData = new TestData[keys.length];
1094
			int m = 0, n = 0;
1095
			for (int i = 0; i < colData.length; i++) {
1096
				TestData data = new TestData(keys[i], i);
1097
				data.visibility = visibility[i];
1098
				data.resizable = resizable[i];
1099
				data.movable = movable[i];
1100
				data.width = widths[i];
1101
				if (data.visibility) {
1102
					data.newIndex = m++;
1103
				} else {
1104
					data.newIndex = n++;
1105
				}
1106
				colData[i] = data;
1107
			}
1108
			return colData;
1109
		}
1110
1111
		/**
1112
		 * Demo
1113
		 * 
1114
		 * @param args
1115
		 */
1116
		public static void main(String[] args) {
1117
			Display display = new Display();
1118
			final Shell shell = new Shell(display);
1119
			shell.setLayout(new FillLayout());
1120
			ViewerColumnsDialog dialog = getColumnsDialog(shell, genData(100));
1121
			dialog.open();
1122
			shell.dispose();
1123
			while (!shell.isDisposed()) {
1124
				if (!display.readAndDispatch()) {
1125
					display.sleep();
1126
				}
1127
			}
1128
			display.dispose();
1129
1130
		}
1131
1132
	}
1133
1134
	////////////////////////////////////////////////////////////////////////////////////
1135
}
(-)src/org/eclipse/ui/views/markers/internal/MarkerMessages.java (+1 lines)
Lines 219-224 Link Here
219
	public static String MarkerPreferences_VisibleColumnsTitle;
219
	public static String MarkerPreferences_VisibleColumnsTitle;
220
	public static String MarkerPreferences_HiddenColumnsTitle;
220
	public static String MarkerPreferences_HiddenColumnsTitle;
221
	public static String MarkerPreferences_AtLeastOneVisibleColumn;
221
	public static String MarkerPreferences_AtLeastOneVisibleColumn;
222
	public static String MarkerPreferences_Zero_Or_Blank_Value_Indicates_No_Limit;
222
223
223
	public static String ProblemFilterDialog_System_Filters_Title;
224
	public static String ProblemFilterDialog_System_Filters_Title;
224
	public static String ProblemFilterDialog_All_Problems;
225
	public static String ProblemFilterDialog_All_Problems;
(-)src/org/eclipse/ui/views/markers/internal/messages.properties (+1 lines)
Lines 203-208 Link Here
203
MarkerPreferences_VisibleColumnsTitle = &Show
203
MarkerPreferences_VisibleColumnsTitle = &Show
204
MarkerPreferences_HiddenColumnsTitle = &Hide
204
MarkerPreferences_HiddenColumnsTitle = &Hide
205
MarkerPreferences_AtLeastOneVisibleColumn = There must be at least one visible column.
205
MarkerPreferences_AtLeastOneVisibleColumn = There must be at least one visible column.
206
MarkerPreferences_Zero_Or_Blank_Value_Indicates_No_Limit = Please enter a positive integer (a zero or blank can be used to disable the limit).
206
207
207
ProblemFilterDialog_System_Filters_Title = System filte&rs:
208
ProblemFilterDialog_System_Filters_Title = System filte&rs:
208
ProblemFilterDialog_All_Problems = Enabled for all problems
209
ProblemFilterDialog_All_Problems = Enabled for all problems

Return to bug 303001