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

Collapse All | Expand All

(-)src/org/eclipse/ui/internal/views/markers/ConfigurationEditDialog.java (+237 lines)
Added Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2011 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.Collection;
15
import java.util.Iterator;
16
17
import org.eclipse.jface.dialogs.IDialogConstants;
18
import org.eclipse.jface.dialogs.TitleAreaDialog;
19
import org.eclipse.osgi.util.NLS;
20
import org.eclipse.swt.SWT;
21
import org.eclipse.swt.events.DisposeEvent;
22
import org.eclipse.swt.events.DisposeListener;
23
import org.eclipse.swt.events.ModifyEvent;
24
import org.eclipse.swt.events.ModifyListener;
25
import org.eclipse.swt.layout.GridData;
26
import org.eclipse.swt.layout.GridLayout;
27
import org.eclipse.swt.widgets.Button;
28
import org.eclipse.swt.widgets.Composite;
29
import org.eclipse.swt.widgets.Control;
30
import org.eclipse.swt.widgets.Label;
31
import org.eclipse.swt.widgets.Shell;
32
import org.eclipse.swt.widgets.Text;
33
import org.eclipse.ui.forms.events.ExpansionEvent;
34
import org.eclipse.ui.forms.events.IExpansionListener;
35
import org.eclipse.ui.forms.widgets.ExpandableComposite;
36
import org.eclipse.ui.forms.widgets.FormToolkit;
37
import org.eclipse.ui.forms.widgets.ScrolledForm;
38
import org.eclipse.ui.views.markers.FilterConfigurationArea;
39
import org.eclipse.ui.views.markers.internal.MarkerMessages;
40
41
/**
42
 * @since 3.7
43
 *
44
 */
45
public class ConfigurationEditDialog extends TitleAreaDialog {
46
47
	private final MarkerContentGenerator generator;
48
	private ScrolledForm form;
49
	private Collection configAreas;
50
	private GroupFilterConfigurationArea scopeArea = new ScopeArea();
51
	private final MarkerFieldFilterGroup filterGroup;
52
	private Text nameText;
53
	private Collection currentConfigurationNames;
54
55
	/**
56
	 * @param parentShell
57
	 */
58
	protected ConfigurationEditDialog(Shell parentShell, MarkerContentGenerator generator, MarkerFieldFilterGroup markerFieldFilterGroup) {
59
		super(parentShell);
60
		this.generator = generator;
61
		this.filterGroup = markerFieldFilterGroup;
62
		setHelpAvailable(false);
63
	}
64
	
65
	protected int getShellStyle() {
66
		return super.getShellStyle() | SWT.RESIZE;
67
	}
68
69
	/* 
70
	 * (non-Javadoc)
71
	 * @see org.eclipse.jface.dialogs.Dialog#createDialogArea(org.eclipse.swt.widgets.Composite)
72
	 * 
73
	 */
74
	protected Control createDialogArea(Composite parent) {
75
		Composite container = (Composite) super.createDialogArea(parent);
76
		
77
		Composite composite = new Composite(container, SWT.NONE);
78
		composite.setLayout(new GridLayout());
79
		composite.setLayoutData(new GridData(GridData.FILL_BOTH));
80
		
81
		Composite nameComposite = new Composite(composite, SWT.NONE);
82
		nameComposite.setLayout(new GridLayout(2, false));
83
		nameComposite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
84
		
85
		Label label = new Label(nameComposite, SWT.NONE);
86
		label.setText(MarkerMessages.configEditDialog_name);
87
		nameText = new Text(nameComposite, SWT.BORDER);
88
		nameText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
89
		nameText.addModifyListener(new ModifyListener() {
90
			
91
			public void modifyText(ModifyEvent e) {
92
				validate();				
93
			}
94
		});
95
		
96
		final FormToolkit toolkit = new FormToolkit(composite.getDisplay());
97
		composite.addDisposeListener(new DisposeListener() {
98
			public void widgetDisposed(DisposeEvent e) {
99
				toolkit.dispose();
100
			}
101
		});
102
		form = toolkit.createScrolledForm(composite);
103
		form.setBackground(composite.getBackground());
104
105
		form.getBody().setLayout(new GridLayout());
106
107
		configAreas = generator.createFilterConfigurationFields();
108
109
		createFieldArea(toolkit, form, scopeArea, true);
110
		Iterator areas = configAreas.iterator();
111
		while (areas.hasNext()) {
112
			createFieldArea(toolkit, form,
113
					(FilterConfigurationArea) areas.next(), true);
114
		}
115
116
		initUI();
117
118
		return container;
119
	}
120
121
	private void initUI() {
122
123
		setTitle(MarkerMessages.ConfigurationEditDialog_title);
124
		setMessage(MarkerMessages.ConfigurationEditDialog_message);
125
126
		nameText.setText(filterGroup.getName());
127
		scopeArea.initializeFromGroup(filterGroup);
128
		Iterator areas = configAreas.iterator();
129
		while (areas.hasNext()) {
130
			FilterConfigurationArea area = (FilterConfigurationArea) areas
131
					.next();
132
			if (area instanceof GroupFilterConfigurationArea)
133
				((GroupFilterConfigurationArea) area)
134
						.initializeFromGroup(filterGroup);
135
			area.initialize(filterGroup.getFilter(area.getField()));
136
		}
137
	}
138
	
139
	/**
140
	 * Create a field area in the form for the FilterConfigurationArea
141
	 * 
142
	 * @param toolkit
143
	 * @param form
144
	 * @param area
145
	 * @param expand
146
	 *            <code>true</code> if the area should be expanded by default
147
	 */
148
	private void createFieldArea(final FormToolkit toolkit,
149
			final ScrolledForm form, final FilterConfigurationArea area,
150
			boolean expand) {
151
		final ExpandableComposite expandable = toolkit
152
				.createExpandableComposite(form.getBody(),
153
						ExpandableComposite.TWISTIE);
154
		expandable.setText(area.getTitle());
155
		expandable.setBackground(form.getBackground());
156
		expandable.setLayout(new GridLayout());
157
		expandable.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, area
158
				.grabExcessVerticalSpace()));
159
		expandable.addExpansionListener(new IExpansionListener() {
160
			/*
161
			 * (non-Javadoc)
162
			 * 
163
			 * @see
164
			 * org.eclipse.ui.forms.events.IExpansionListener#expansionStateChanged
165
			 * (org.eclipse.ui.forms.events.ExpansionEvent)
166
			 */
167
			public void expansionStateChanged(ExpansionEvent e) {
168
				expandable.getParent().layout(true);
169
170
			}
171
172
			/*
173
			 * (non-Javadoc)
174
			 * 
175
			 * @see
176
			 * org.eclipse.ui.forms.events.IExpansionListener#expansionStateChanging
177
			 * (org.eclipse.ui.forms.events.ExpansionEvent)
178
			 */
179
			public void expansionStateChanging(ExpansionEvent e) {
180
181
			}
182
		});
183
184
		Composite sectionClient = toolkit.createComposite(expandable);
185
		sectionClient.setLayout(new GridLayout());
186
		sectionClient.setLayoutData(new GridData(SWT.FILL, SWT.NONE, true,
187
				false));
188
		sectionClient.setBackground(form.getBackground());
189
		area.createContents(sectionClient);
190
		expandable.setClient(sectionClient);
191
		expandable.setExpanded(expand);
192
	}
193
	
194
	/* (non-Javadoc)
195
	 * @see org.eclipse.jface.dialogs.Dialog#okPressed()
196
	 */
197
	protected void okPressed() {
198
		applyValues();
199
		super.okPressed();
200
	}
201
202
	private void applyValues() {
203
		scopeArea.applyToGroup(filterGroup);
204
		Iterator areas = configAreas.iterator();
205
		while (areas.hasNext()) {
206
			FilterConfigurationArea area = (FilterConfigurationArea) areas
207
					.next();
208
209
			// Handle the internal special cases
210
			if (area instanceof GroupFilterConfigurationArea)
211
				((GroupFilterConfigurationArea) area)
212
						.applyToGroup(filterGroup);
213
			area.apply(filterGroup.getFilter(area.getField()));
214
		}
215
	}
216
	
217
	private void validate() {
218
		Button okButton = getButton(IDialogConstants.OK_ID);
219
		if(okButton == null)
220
			return;
221
		String name = nameText.getText();
222
		if(currentConfigurationNames.contains(name) && !filterGroup.getName().equals(name)) {
223
			String message = NLS.bind(MarkerMessages.filtersDialog_conflictingName, name);
224
			setErrorMessage(message);
225
			okButton.setEnabled(false);
226
		}else {
227
			setErrorMessage(null);
228
			okButton.setEnabled(true);
229
		}
230
	}
231
232
	public void setCurrentConfigurationNames(
233
			Collection currentConfigurationNames) {
234
		this.currentConfigurationNames = currentConfigurationNames;
235
	}
236
237
}
(-)src/org/eclipse/ui/internal/views/markers/ExtendedMarkersView.java (-3 / +3 lines)
Lines 352-362 Link Here
352
						.getConfigurationElement().getAttribute(
352
						.getConfigurationElement().getAttribute(
353
								MarkerSupportInternalUtilities.ATTRIBUTE_ID));
353
								MarkerSupportInternalUtilities.ATTRIBUTE_ID));
354
				// Make sure we get a useful value
354
				// Make sure we get a useful value
355
				if (value != null && value.intValue() > 0)
355
				if (value != null && value.intValue() >= 0)
356
					preferredWidth = value.intValue();
356
					preferredWidth = value.intValue();
357
			}
357
			}
358
		}
358
		}
359
		if (preferredWidth <= 0) {
359
		if (preferredWidth < 0) {
360
			// Compute and store a font metric
360
			// Compute and store a font metric
361
			GC gc = new GC(tree);
361
			GC gc = new GC(tree);
362
			gc.setFont(tree.getFont());
362
			gc.setFont(tree.getFont());
Lines 1245-1251 Link Here
1245
			fields[positions[i]] = (MarkerField) column.getData(MARKER_FIELD);
1245
			fields[positions[i]] = (MarkerField) column.getData(MARKER_FIELD);
1246
		}
1246
		}
1247
		if (generator != null) {
1247
		if (generator != null) {
1248
			generator.saveSate(memento, fields);
1248
			generator.saveState(memento, fields);
1249
		}
1249
		}
1250
		builder.saveState(memento);
1250
		builder.saveState(memento);
1251
	}
1251
	}
(-)src/org/eclipse/ui/internal/views/markers/FiltersConfigurationDialog.java (-687 / +234 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2007, 2009 IBM Corporation and others.
2
 * Copyright (c) 2007, 2011 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 17-43 Link Here
17
import java.util.Collection;
17
import java.util.Collection;
18
import java.util.Iterator;
18
import java.util.Iterator;
19
19
20
import org.eclipse.core.runtime.IStatus;
21
import org.eclipse.jface.dialogs.IDialogConstants;
20
import org.eclipse.jface.dialogs.IDialogConstants;
22
import org.eclipse.jface.dialogs.IDialogSettings;
21
import org.eclipse.jface.dialogs.IDialogSettings;
23
import org.eclipse.jface.dialogs.IInputValidator;
22
import org.eclipse.jface.viewers.ArrayContentProvider;
24
import org.eclipse.jface.dialogs.InputDialog;
25
import org.eclipse.jface.viewers.CheckStateChangedEvent;
23
import org.eclipse.jface.viewers.CheckStateChangedEvent;
26
import org.eclipse.jface.viewers.CheckboxTableViewer;
24
import org.eclipse.jface.viewers.CheckboxTableViewer;
25
import org.eclipse.jface.viewers.DoubleClickEvent;
27
import org.eclipse.jface.viewers.ICheckStateListener;
26
import org.eclipse.jface.viewers.ICheckStateListener;
27
import org.eclipse.jface.viewers.IDoubleClickListener;
28
import org.eclipse.jface.viewers.ISelection;
28
import org.eclipse.jface.viewers.ISelection;
29
import org.eclipse.jface.viewers.ISelectionChangedListener;
29
import org.eclipse.jface.viewers.ISelectionChangedListener;
30
import org.eclipse.jface.viewers.IStructuredContentProvider;
31
import org.eclipse.jface.viewers.IStructuredSelection;
30
import org.eclipse.jface.viewers.IStructuredSelection;
32
import org.eclipse.jface.viewers.LabelProvider;
31
import org.eclipse.jface.viewers.LabelProvider;
33
import org.eclipse.jface.viewers.SelectionChangedEvent;
32
import org.eclipse.jface.viewers.SelectionChangedEvent;
34
import org.eclipse.jface.viewers.StructuredSelection;
33
import org.eclipse.jface.viewers.StructuredSelection;
35
import org.eclipse.jface.viewers.Viewer;
36
import org.eclipse.jface.window.Window;
34
import org.eclipse.jface.window.Window;
37
import org.eclipse.osgi.util.NLS;
38
import org.eclipse.swt.SWT;
35
import org.eclipse.swt.SWT;
39
import org.eclipse.swt.events.DisposeEvent;
40
import org.eclipse.swt.events.DisposeListener;
41
import org.eclipse.swt.events.SelectionAdapter;
36
import org.eclipse.swt.events.SelectionAdapter;
42
import org.eclipse.swt.events.SelectionEvent;
37
import org.eclipse.swt.events.SelectionEvent;
43
import org.eclipse.swt.layout.GridData;
38
import org.eclipse.swt.layout.GridData;
Lines 45-64 Link Here
45
import org.eclipse.swt.widgets.Button;
40
import org.eclipse.swt.widgets.Button;
46
import org.eclipse.swt.widgets.Composite;
41
import org.eclipse.swt.widgets.Composite;
47
import org.eclipse.swt.widgets.Control;
42
import org.eclipse.swt.widgets.Control;
48
import org.eclipse.swt.widgets.Event;
49
import org.eclipse.swt.widgets.Group;
50
import org.eclipse.swt.widgets.Label;
43
import org.eclipse.swt.widgets.Label;
51
import org.eclipse.swt.widgets.Listener;
52
import org.eclipse.swt.widgets.Shell;
44
import org.eclipse.swt.widgets.Shell;
53
import org.eclipse.swt.widgets.Text;
45
import org.eclipse.swt.widgets.Spinner;
54
import org.eclipse.ui.forms.events.ExpansionEvent;
55
import org.eclipse.ui.forms.events.IExpansionListener;
56
import org.eclipse.ui.forms.widgets.ExpandableComposite;
57
import org.eclipse.ui.forms.widgets.FormToolkit;
58
import org.eclipse.ui.forms.widgets.ScrolledForm;
59
import org.eclipse.ui.internal.ide.IDEInternalPreferences;
46
import org.eclipse.ui.internal.ide.IDEInternalPreferences;
60
import org.eclipse.ui.internal.ide.IDEWorkbenchPlugin;
47
import org.eclipse.ui.internal.ide.IDEWorkbenchPlugin;
61
import org.eclipse.ui.views.markers.FilterConfigurationArea;
48
import org.eclipse.ui.preferences.ViewSettingsDialog;
62
import org.eclipse.ui.views.markers.internal.MarkerMessages;
49
import org.eclipse.ui.views.markers.internal.MarkerMessages;
63
50
64
/**
51
/**
Lines 67-103 Link Here
67
 * @since 3.3
54
 * @since 3.3
68
 * 
55
 * 
69
 */
56
 */
70
public class FiltersConfigurationDialog extends ViewerSettingsAndStatusDialog {
57
public class FiltersConfigurationDialog extends ViewSettingsDialog {
71
58
72
	private static final String SELECTED_FILTER_GROUP = "SELECTED_FILTER_GROUP"; //$NON-NLS-1$
59
	private static final String SELECTED_FILTER_GROUP = "SELECTED_FILTER_GROUP"; //$NON-NLS-1$
73
60
74
	private Collection filterGroups;
61
	private Collection filterGroups;
75
62
76
	private CheckboxTableViewer filtersList;
63
	private CheckboxTableViewer configsTable;
77
78
	private GroupFilterConfigurationArea scopeArea = new ScopeArea();
79
64
80
	private MarkerFieldFilterGroup selectedFilterGroup;
65
	private MarkerFieldFilterGroup selectedFilterGroup;
81
66
82
	private ScrolledForm form;
83
84
	private MarkerContentGenerator generator;
67
	private MarkerContentGenerator generator;
85
68
86
	private int limitValue = -1;
87
	private boolean limitEnabled = false;
88
	private boolean andFilters = false;
69
	private boolean andFilters = false;
89
70
90
	private Collection filterAreas;
91
92
	private Button removeButton;
71
	private Button removeButton;
93
	private Button renameButton;
72
	private Button editButton;
94
	private Button cloneButton;
73
	private Button allButton;
95
	private Button andButton;
74
	private Button andButton;
96
	private Button orButton;
75
	private Button orButton;
97
76
98
	private Label andOrLabel;
77
	private Button limitButton;
99
	private Text limitEditor;
78
	private Spinner limitSpinner;
100
	private Button limitBttn;
101
79
102
	/**
80
	/**
103
	 * Create a new instance of the receiver on builder.
81
	 * Create a new instance of the receiver on builder.
Lines 125-140 Link Here
125
	/*
103
	/*
126
	 * (non-Javadoc)
104
	 * (non-Javadoc)
127
	 * 
105
	 * 
128
	 * @see org.eclipse.jface.dialogs.Dialog#close()
129
	 */
130
	public boolean close() {
131
		saveDialogSettings();
132
		return super.close();
133
	}
134
135
	/*
136
	 * (non-Javadoc)
137
	 * 
138
	 * @see org.eclipse.ui.internal.views.markers.ViewerSettingsAndStatusDialog#
106
	 * @see org.eclipse.ui.internal.views.markers.ViewerSettingsAndStatusDialog#
139
	 * configureShell(org.eclipse.swt.widgets.Shell)
107
	 * configureShell(org.eclipse.swt.widgets.Shell)
140
	 */
108
	 */
Lines 156-368 Link Here
156
	 * (non-Javadoc)
124
	 * (non-Javadoc)
157
	 * 
125
	 * 
158
	 * @see org.eclipse.ui.internal.views.markers.ViewerSettingsAndStatusDialog#
126
	 * @see org.eclipse.ui.internal.views.markers.ViewerSettingsAndStatusDialog#
159
	 * initializeDialog()
160
	 */
161
	protected void initializeDialog() {
162
		super.initializeDialog();
163
		validateState();
164
	}
165
166
	/*
167
	 * (non-Javadoc)
168
	 * 
169
	 * @see org.eclipse.ui.internal.views.markers.ViewerSettingsAndStatusDialog#
170
	 * createDialogContentArea(org.eclipse.swt.widgets.Composite)
127
	 * createDialogContentArea(org.eclipse.swt.widgets.Composite)
171
	 */
128
	 */
172
	protected Control createDialogContentArea(Composite parent) {
129
	protected Control createDialogArea(Composite parent) {
173
130
174
		createViewCommonUI(parent).setLayoutData(
131
		Composite container = (Composite) super.createDialogArea(parent);
175
				new GridData(SWT.FILL, SWT.NONE, true, false));
132
		
133
		Composite composite = new Composite(container, SWT.NONE);
134
		composite.setLayout(new GridLayout());
135
		composite.setLayoutData(new GridData(GridData.FILL_BOTH));
136
137
		createAndOrButtons(composite);
138
		
139
		createFilters(composite);
140
		
141
		createMarkerLimits(composite);
142
		
143
		loadDialogSettings();
144
		applyDialogFont(container);
145
		
146
		initUI();
147
		
148
		return container;
149
	}
150
	
151
	private void initUI() {
152
		
153
		if (selectedFilterGroup != null) {
154
			configsTable.setSelection(new StructuredSelection(
155
					selectedFilterGroup));
156
		}
176
157
177
		Group top = new Group(parent, SWT.NONE);
158
		configsTable.setInput(filterGroups);
178
		top.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
159
		Iterator iterator = filterGroups.iterator();
179
		GridLayout layout = new GridLayout(3, false);
160
		while (iterator.hasNext()) {
180
		top.setLayout(layout);
161
			MarkerFieldFilterGroup group = (MarkerFieldFilterGroup) iterator
181
		top.setBackground(parent.getBackground());
162
					.next();
182
		initializeDialogUnits(top);
163
			boolean enabled = group.isEnabled();
183
164
			configsTable.setChecked(group, enabled);
184
		createFilterSelectionArea(top);
165
		}
185
		createVerticalSeperator(top).setLayoutData(
186
				new GridData(SWT.NONE, SWT.FILL, false, true));
187
		createFilterAreas(top).setLayoutData(
188
				new GridData(SWT.FILL, SWT.FILL, true, true));
189
166
190
		if (filterGroups.isEmpty())
167
		andButton.setSelection(andFilters);
191
			setFieldsEnabled(false);
168
		orButton.setSelection(!andFilters);
169
		updateRadioButtonsFromTable();
170
		int limits = generator.getMarkerLimits();
171
		boolean limitsEnabled = limits != -1;
172
		limitButton.setSelection(limitsEnabled);
173
		limitSpinner.setEnabled(limitsEnabled);
174
		if(limitsEnabled)
175
			limitSpinner.setSelection(limits);
192
		else
176
		else
193
			loadDialogSettings();
177
			limitSpinner.setSelection(1);
194
		applyDialogFont(top);
178
		updateButtonEnablement();
195
		return top;
179
		configsTable.getTable().setFocus();
180
		
181
	}
182
183
	private void updateRadioButtonsFromTable() {
184
		
185
		boolean showAll = isShowAll();
186
		allButton.setSelection(showAll);
187
		andButton.setEnabled(!showAll);
188
		orButton.setEnabled(!showAll);
189
	}
190
191
	private void updateShowAll(boolean showAll) {
192
		
193
		allButton.setSelection(showAll);
194
		andButton.setEnabled(!showAll);
195
		orButton.setEnabled(!showAll);
196
		if(showAll) {
197
			configsTable.setAllChecked(false);
198
		}else {
199
			// make the first entry checked
200
			if(filterGroups.size() > 0) {
201
				Object group = filterGroups.iterator().next();
202
				configsTable.setChecked(group, true);
203
			}
204
		}
196
	}
205
	}
197
206
207
	private boolean isShowAll() {
208
		return configsTable.getCheckedElements().length == 0;
209
	}
198
	/**
210
	/**
199
	 * @param parent
211
	 * @param parent
200
	 *            parent
201
	 * @return {@link Control}
202
	 */
212
	 */
203
	private Control createViewCommonUI(Composite parent) {
213
	private void createMarkerLimits(Composite parent) {
204
		Group group = new Group(parent, SWT.NONE);
214
		
205
		group.setLayout(new GridLayout(1, true));
215
		limitButton = new Button(parent, SWT.CHECK);
206
		createLimitArea(group);
216
		limitButton.setText(MarkerMessages.MarkerPreferences_MarkerLimits);
207
		return group;
217
		limitButton.addSelectionListener(new SelectionAdapter() {
218
			
219
			public void widgetSelected(SelectionEvent e) {
220
				limitSpinner.setEnabled(limitButton.getSelection());
221
			}
222
		});
223
224
		Composite composite = new Composite(parent, SWT.NONE);
225
		composite.setLayout(new GridLayout(2, false));
226
		GridData compositeData = new GridData(GridData.FILL_HORIZONTAL);
227
		compositeData.horizontalIndent = convertHorizontalDLUsToPixels(IDialogConstants.INDENT);
228
		composite.setLayoutData(compositeData);
229
		
230
		Label label = new Label(composite, SWT.NONE);
231
		label.setText(MarkerMessages.MarkerPreferences_VisibleItems);
232
		
233
		limitSpinner = new Spinner(composite, SWT.BORDER);
234
		limitSpinner.setMinimum(1);
235
		limitSpinner.setMaximum(Integer.MAX_VALUE);
236
		limitSpinner.setIncrement(1);
237
		limitSpinner.setPageIncrement(100);
238
		GridData spinnerData = new GridData();
239
		spinnerData.minimumWidth = convertWidthInCharsToPixels(6);
240
		limitSpinner.setLayoutData(spinnerData);
241
		
208
	}
242
	}
209
243
210
	/**
244
	/**
211
	 * Create element limit area.
212
	 * 
213
	 * @param parent
245
	 * @param parent
214
	 */
246
	 */
215
	private Control createLimitArea(Composite parent) {
247
	private void createFilters(Composite parent) {
248
		
216
		Composite composite = new Composite(parent, SWT.NONE);
249
		Composite composite = new Composite(parent, SWT.NONE);
217
		composite.setLayout(new GridLayout(2, false));
250
		composite.setLayout(new GridLayout(2, false));
218
		composite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
251
		composite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
219
		limitBttn = new Button(composite, SWT.CHECK);
252
		composite.setBackground(parent.getBackground());
220
		limitBttn.setText(MarkerMessages.MarkerPreferences_VisibleItems);
253
		
221
		limitBttn.setLayoutData(new GridData());
254
		configsTable = CheckboxTableViewer.newCheckList(composite, SWT.BORDER);
222
255
		GridData tableData = new GridData(SWT.FILL, SWT.FILL, true, true);
223
		limitEditor = new Text(composite, SWT.BORDER);
256
		tableData.widthHint = convertHorizontalDLUsToPixels(200);
224
		limitEditor.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
257
		configsTable.getControl().setLayoutData(tableData);
225
		Listener listener = new Listener() {
258
		
226
			public void handleEvent(Event event) {
259
		configsTable.setContentProvider(ArrayContentProvider.getInstance());
227
				switch (event.type) {
260
		configsTable.setLabelProvider(new LabelProvider() {
228
				case SWT.Selection:
229
					boolean limited = limitBttn.getSelection();
230
					setLimitEnabled(limited);
231
					limitEditor.setEditable(limited);
232
					limitEditor.setText(Integer.toString(getLimitValue()));
233
					break;
234
				case SWT.Modify:
235
					try {
236
						int limit = Integer.parseInt(limitEditor.getText());
237
						if (limit > 0) {
238
							setLimitValue(limit);
239
						} else {
240
							limitEditor.setFocus();
241
						}
242
					} catch (Exception e) {
243
						limitEditor.setFocus();
244
					}
245
					break;
246
				}
247
				validateState();
248
			}
249
		};
250
		limitEditor.addListener(SWT.Modify, listener);
251
		limitBttn.addListener(SWT.Selection, listener);
252
		setLimitEnabled(IDEWorkbenchPlugin.getDefault().getPreferenceStore()
253
				.getBoolean(IDEInternalPreferences.USE_MARKER_LIMITS));
254
		setLimitValue(IDEWorkbenchPlugin.getDefault().getPreferenceStore()
255
				.getInt(IDEInternalPreferences.MARKER_LIMITS_VALUE));
256
257
		limitBttn.setSelection(isLimitEnabled());
258
		limitEditor.setText(Integer.toString(getLimitValue()));
259
		limitEditor.setEditable(isLimitEnabled());
260
		return composite;
261
	}
262
263
	/**
264
	 * Create the area for selecting the filters and enabling/disabling them.
265
	 * 
266
	 * @param main
267
	 * @return {@link Control}
268
	 */
269
	private Control createFilterSelectionArea(Composite main) {
270
271
		Composite filtersComposite = new Composite(main, SWT.NONE);
272
		filtersComposite.setLayout(new GridLayout(2, false));
273
		filtersComposite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true,
274
				true));
275
276
		Label title = new Label(filtersComposite, SWT.NONE);
277
		title.setText(MarkerMessages.filtersDialog_entriesTitle);
278
		GridData titleData = new GridData();
279
		titleData.horizontalSpan = 2;
280
		title.setLayoutData(titleData);
281
282
		filtersList = CheckboxTableViewer.newCheckList(filtersComposite,
283
				SWT.BORDER);
284
285
		filtersList.setContentProvider(new IStructuredContentProvider() {
286
			/*
287
			 * (non-Javadoc)
288
			 * 
289
			 * @see org.eclipse.jface.viewers.IContentProvider#dispose()
290
			 */
291
			public void dispose() {
292
				// Do nothing
293
			}
294
295
			/*
296
			 * (non-Javadoc)
297
			 * 
298
			 * @see
299
			 * org.eclipse.jface.viewers.IStructuredContentProvider#getElements
300
			 * (java.lang.Object)
301
			 */
302
			public Object[] getElements(Object inputElement) {
303
				return filterGroups.toArray();
304
			}
305
306
			/*
307
			 * (non-Javadoc)
308
			 * 
309
			 * @see
310
			 * org.eclipse.jface.viewers.IContentProvider#inputChanged(org.eclipse
311
			 * .jface.viewers.Viewer, java.lang.Object, java.lang.Object)
312
			 */
313
			public void inputChanged(Viewer viewer, Object oldInput,
314
					Object newInput) {
315
				// Do nothing
316
			}
317
		});
318
319
		filtersList.setLabelProvider(new LabelProvider() {
320
			/*
321
			 * (non-Javadoc)
322
			 * 
323
			 * @see
324
			 * org.eclipse.jface.viewers.ILabelProvider#getText(java.lang.Object
325
			 * )
326
			 */
327
			public String getText(Object element) {
261
			public String getText(Object element) {
328
				return ((MarkerFieldFilterGroup) element).getName();
262
				return ((MarkerFieldFilterGroup) element).getName();
329
			}
263
			}
330
		});
264
		});
331
265
332
		if (selectedFilterGroup != null)
266
		configsTable.addCheckStateListener(new ICheckStateListener() {
333
			filtersList.setSelection(new StructuredSelection(
267
			public void checkStateChanged(CheckStateChangedEvent event) {
334
					selectedFilterGroup));
268
				updateRadioButtonsFromTable();
269
			}
270
		});
335
271
336
		filtersList
272
		configsTable
337
				.addSelectionChangedListener(new ISelectionChangedListener() {
273
				.addSelectionChangedListener(new ISelectionChangedListener() {
338
339
					/*
340
					 * (non-Javadoc)
341
					 * 
342
					 * @see org.eclipse.jface.viewers.ISelectionChangedListener#
343
					 * selectionChanged
344
					 * (org.eclipse.jface.viewers.SelectionChangedEvent)
345
					 */
346
					public void selectionChanged(SelectionChangedEvent event) {
274
					public void selectionChanged(SelectionChangedEvent event) {
347
						setSelectedFilter((MarkerFieldFilterGroup) ((IStructuredSelection) event
275
						updateButtonEnablement();
348
								.getSelection()).getFirstElement());
349
					}
276
					}
350
				});
277
				});
351
278
352
		filtersList.setInput(this);
279
		configsTable.addDoubleClickListener(new IDoubleClickListener() {
280
			
281
			public void doubleClick(DoubleClickEvent event) {
282
				IStructuredSelection selection = (IStructuredSelection) configsTable.getSelection();
283
				MarkerFieldFilterGroup configuration = (MarkerFieldFilterGroup) selection.getFirstElement();
284
				editConfiguration(configuration);
285
			}
286
		});
353
287
354
		Iterator filterIterator = filterGroups.iterator();
288
		createButtons(composite);
355
		while (filterIterator.hasNext()) {
356
			MarkerFieldFilterGroup group = (MarkerFieldFilterGroup) filterIterator
357
					.next();
358
			filtersList.setChecked(group, group.isEnabled());
359
		}
360
289
361
		GridData listData = new GridData(SWT.FILL, SWT.FILL, true, true);
290
	}
362
		listData.widthHint = convertHorizontalDLUsToPixels(100);
363
		filtersList.getControl().setLayoutData(listData);
364
291
365
		Composite buttons = new Composite(filtersComposite, SWT.NONE);
292
	/**
293
	 * @param composite
294
	 */
295
	private void createButtons(Composite composite) {
296
		Composite buttons = new Composite(composite, SWT.NONE);
366
		GridLayout buttonLayout = new GridLayout();
297
		GridLayout buttonLayout = new GridLayout();
367
		buttonLayout.marginWidth = 0;
298
		buttonLayout.marginWidth = 0;
368
		buttons.setLayout(buttonLayout);
299
		buttons.setLayout(buttonLayout);
Lines 374-561 Link Here
374
		addNew.setText(MarkerMessages.MarkerFilter_addFilterName);
305
		addNew.setText(MarkerMessages.MarkerFilter_addFilterName);
375
		addNew.addSelectionListener(new SelectionAdapter() {
306
		addNew.addSelectionListener(new SelectionAdapter() {
376
			public void widgetSelected(SelectionEvent e) {
307
			public void widgetSelected(SelectionEvent e) {
377
				addNewFilter(false);
308
				addConfiguration();
378
			}
309
			}
379
		});
310
		});
380
		setButtonLayoutData(addNew);
311
		setButtonLayoutData(addNew);
381
312
		
382
		cloneButton = new Button(buttons, SWT.PUSH);
313
		editButton = new Button(buttons, SWT.PUSH);
383
		cloneButton.setText(MarkerMessages.MarkerFilter_cloneFilterName);
314
		editButton.setText(MarkerMessages.MarkerFilter_editFilterName);
384
		cloneButton.addSelectionListener(new SelectionAdapter() {
315
		editButton.addSelectionListener(new SelectionAdapter() {
385
			public void widgetSelected(SelectionEvent e) {
316
			public void widgetSelected(SelectionEvent e) {
386
				addNewFilter(true);
317
				IStructuredSelection selection = (IStructuredSelection) configsTable.getSelection();
318
				MarkerFieldFilterGroup configuration = (MarkerFieldFilterGroup) selection.getFirstElement();
319
				editConfiguration(configuration);
387
			}
320
			}
388
		});
321
		});
389
		setButtonLayoutData(cloneButton);
322
		setButtonLayoutData(editButton);
390
323
391
		removeButton = new Button(buttons, SWT.PUSH);
324
		removeButton = new Button(buttons, SWT.PUSH);
392
		removeButton.setText(MarkerMessages.MarkerFilter_deleteSelectedName);
325
		removeButton.setText(MarkerMessages.MarkerFilter_deleteSelectedName);
393
		removeButton.addSelectionListener(new SelectionAdapter() {
326
		removeButton.addSelectionListener(new SelectionAdapter() {
394
			public void widgetSelected(SelectionEvent e) {
327
			public void widgetSelected(SelectionEvent e) {
395
				removeFilters(filtersList.getSelection());
328
				removeFilters(configsTable.getSelection());
396
			}
329
			}
397
		});
330
		});
398
		setButtonLayoutData(removeButton);
331
		setButtonLayoutData(removeButton);
332
	}
333
	
334
	private boolean editConfiguration(MarkerFieldFilterGroup configuration) {
335
		
336
		ConfigurationEditDialog dialog = new ConfigurationEditDialog(getShell(), generator, configuration);
337
		dialog.setCurrentConfigurationNames(getCurrentConfigurationNames());
338
		if(dialog.open() == Window.CANCEL)
339
			return false;
340
		return true;
341
342
	}
399
343
400
		renameButton = new Button(buttons, SWT.PUSH);
344
	private void createAndOrButtons(Composite parent) {
401
		renameButton.setText(MarkerMessages.MarkerFilter_renameName);
345
	
402
		renameButton.addSelectionListener(new SelectionAdapter() {
346
		allButton = new Button(parent, SWT.CHECK);
347
		allButton.setText(MarkerMessages.ALL_Title);
348
		allButton.addSelectionListener(new SelectionAdapter() {
403
			public void widgetSelected(SelectionEvent e) {
349
			public void widgetSelected(SelectionEvent e) {
404
				MarkerFieldFilterGroup filterGroup = (MarkerFieldFilterGroup) ((IStructuredSelection) filtersList
350
				updateShowAll(allButton.getSelection());
405
						.getSelection()).getFirstElement();
406
				renameFilter(filterGroup);
407
			}
351
			}
408
		});
352
		});
409
		setButtonLayoutData(renameButton);
410
353
411
		andOrLabel = new Label(filtersComposite, SWT.NONE);
354
		andButton = new Button(parent, SWT.RADIO);
412
		GridData labelData = new GridData();
413
		labelData.horizontalSpan = 2;
414
		andOrLabel.setLayoutData(labelData);
415
		andOrLabel.setText(MarkerMessages.AND_OR_Label);
416
417
		andButton = new Button(filtersComposite, SWT.RADIO);
418
		GridData data = new GridData(GridData.FILL_HORIZONTAL, SWT.NONE, true,
419
				false);
420
		data.horizontalSpan = 2;
421
		data.horizontalIndent = IDialogConstants.INDENT;
422
		andButton.setLayoutData(data);
423
		andButton.setText(MarkerMessages.AND_Title);
355
		andButton.setText(MarkerMessages.AND_Title);
424
		andButton.setSelection(andFilters);
425
		andButton.addSelectionListener(new SelectionAdapter() {
356
		andButton.addSelectionListener(new SelectionAdapter() {
426
427
			/*
428
			 * (non-Javadoc)
429
			 * 
430
			 * @see
431
			 * org.eclipse.swt.events.SelectionAdapter#widgetSelected(org.eclipse
432
			 * .swt.events.SelectionEvent)
433
			 */
434
			public void widgetSelected(SelectionEvent e) {
357
			public void widgetSelected(SelectionEvent e) {
435
				andFilters = true;
358
				andFilters = true;
436
			}
359
			}
437
		});
360
		});
361
		GridData andData = new GridData();
362
		andData.horizontalIndent = convertHorizontalDLUsToPixels(IDialogConstants.INDENT);
363
		andButton.setLayoutData(andData);
438
364
439
		orButton = new Button(filtersComposite, SWT.RADIO);
365
		orButton = new Button(parent, SWT.RADIO);
440
		data = new GridData(GridData.FILL_HORIZONTAL, SWT.NONE, true, false);
441
		data.horizontalSpan = 2;
442
		data.horizontalIndent = IDialogConstants.INDENT;
443
		orButton.setLayoutData(data);
444
		orButton.setText(MarkerMessages.OR_Title);
366
		orButton.setText(MarkerMessages.OR_Title);
445
		orButton.setSelection(!andFilters);
446
		orButton.addSelectionListener(new SelectionAdapter() {
367
		orButton.addSelectionListener(new SelectionAdapter() {
447
448
			/*
449
			 * (non-Javadoc)
450
			 * 
451
			 * @see
452
			 * org.eclipse.swt.events.SelectionAdapter#widgetSelected(org.eclipse
453
			 * .swt.events.SelectionEvent)
454
			 */
455
			public void widgetSelected(SelectionEvent e) {
368
			public void widgetSelected(SelectionEvent e) {
456
				andFilters = false;
369
				andFilters = false;
457
			}
370
			}
458
		});
371
		});
459
		filtersList.addCheckStateListener(new ICheckStateListener() {
372
		GridData orData = new GridData();
460
			public void checkStateChanged(CheckStateChangedEvent event) {
373
		orData.horizontalIndent = convertHorizontalDLUsToPixels(IDialogConstants.INDENT);
461
				updateAndOrEnblement();
374
		orButton.setLayoutData(orData);
462
				validateState();
375
		
463
			}
464
		});
465
		return filtersComposite;
466
	}
467
468
	/**
469
	 * 
470
	 * @param parent
471
	 * @return {@link Control}
472
	 */
473
	private Control createVerticalSeperator(Composite parent) {
474
		Label seprator = new Label(parent, SWT.SEPARATOR | SWT.VERTICAL);
475
		return seprator;
476
	}
477
478
	/**
479
	 * 
480
	 * @param parent
481
	 * @return {@link Control}
482
	 */
483
	private Control createFilterAreas(Composite parent) {
484
		final FormToolkit toolkit = new FormToolkit(parent.getDisplay());
485
		parent.addDisposeListener(new DisposeListener() {
486
			public void widgetDisposed(DisposeEvent e) {
487
				toolkit.dispose();
488
			}
489
		});
490
		form = toolkit.createScrolledForm(parent);
491
		form.setBackground(parent.getBackground());
492
493
		form.getBody().setLayout(new GridLayout());
494
495
		filterAreas = generator.createFilterConfigurationFields();
496
497
		createFieldArea(toolkit, form, scopeArea, true);
498
		Iterator areas = filterAreas.iterator();
499
		while (areas.hasNext()) {
500
			createFieldArea(toolkit, form,
501
					(FilterConfigurationArea) areas.next(), true);
502
		}
503
		return form;
504
	}
505
506
	/**
507
	 * Create a field area in the form for the FilterConfigurationArea
508
	 * 
509
	 * @param toolkit
510
	 * @param form
511
	 * @param area
512
	 * @param expand
513
	 *            <code>true</code> if the area should be expanded by default
514
	 */
515
	private void createFieldArea(final FormToolkit toolkit,
516
			final ScrolledForm form, final FilterConfigurationArea area,
517
			boolean expand) {
518
		final ExpandableComposite expandable = toolkit
519
				.createExpandableComposite(form.getBody(),
520
						ExpandableComposite.TWISTIE);
521
		expandable.setText(area.getTitle());
522
		expandable.setBackground(form.getBackground());
523
		expandable.setLayout(new GridLayout());
524
		expandable.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, area
525
				.grabExcessVerticalSpace()));
526
		expandable.addExpansionListener(new IExpansionListener() {
527
			/*
528
			 * (non-Javadoc)
529
			 * 
530
			 * @see
531
			 * org.eclipse.ui.forms.events.IExpansionListener#expansionStateChanged
532
			 * (org.eclipse.ui.forms.events.ExpansionEvent)
533
			 */
534
			public void expansionStateChanged(ExpansionEvent e) {
535
				expandable.getParent().layout(true);
536
537
			}
538
539
			/*
540
			 * (non-Javadoc)
541
			 * 
542
			 * @see
543
			 * org.eclipse.ui.forms.events.IExpansionListener#expansionStateChanging
544
			 * (org.eclipse.ui.forms.events.ExpansionEvent)
545
			 */
546
			public void expansionStateChanging(ExpansionEvent e) {
547
548
			}
549
		});
550
551
		Composite sectionClient = toolkit.createComposite(expandable);
552
		sectionClient.setLayout(new GridLayout());
553
		sectionClient.setLayoutData(new GridData(SWT.FILL, SWT.NONE, true,
554
				false));
555
		sectionClient.setBackground(form.getBackground());
556
		area.createContents(sectionClient);
557
		expandable.setClient(sectionClient);
558
		expandable.setExpanded(expand);
559
	}
376
	}
560
377
561
	/**
378
	/**
Lines 563-569 Link Here
563
	 * 
380
	 * 
564
	 * @return Collection
381
	 * @return Collection
565
	 */
382
	 */
566
	private Collection getCurrentFilterNames() {
383
	private Collection getCurrentConfigurationNames() {
567
		Collection names = new ArrayList();
384
		Collection names = new ArrayList();
568
		Iterator filterIterator = filterGroups.iterator();
385
		Iterator filterIterator = filterGroups.iterator();
569
		while (filterIterator.hasNext()) {
386
		while (filterIterator.hasNext()) {
Lines 573-692 Link Here
573
		return names;
390
		return names;
574
	}
391
	}
575
392
576
	/**
393
	private void addConfiguration() {
577
	 * Opens Input Dialog for name,creates a new filterGroup, and adds it to the
394
		String newName = getNewConfigurationName(getCurrentConfigurationNames(), MarkerMessages.MarkerFilter_newFilterName);
578
	 * filterGroups
395
		MarkerFieldFilterGroup configuration = createConfiguration(newName);
579
	 * 
396
		boolean cancelPressed = editConfiguration(configuration);
580
	 * @param cloneSelected
397
		if(cancelPressed) {
581
	 *            true clones the selected filterGroup
398
			filterGroups.add(configuration);
582
	 * 
399
			configsTable.refresh();
583
	 */
400
			configsTable.setSelection(new StructuredSelection(configuration));
584
	private void addNewFilter(boolean cloneSelected) {
401
			configsTable.setChecked(configuration, true);
585
		String newName = getNewFilterName(getCurrentFilterNames(), null);
402
			updateRadioButtonsFromTable();
586
		if (newName != null) {
587
			createNewFilter(newName, cloneSelected);
588
		}
403
		}
589
	}
404
	}
590
405
591
	/**
406
	private String getNewConfigurationName(final Collection avoidNames,
592
	 * Opens Input Dialog for a new filter name
593
	 * 
594
	 * @param avoidNames
595
	 *            filter names to avoid
596
	 * @param initialName
597
	 *            initial name of the filter
598
	 * @return new filter name or null if canceled
599
	 * 
600
	 */
601
	private String getNewFilterName(final Collection avoidNames,
602
			String initialName) {
407
			String initialName) {
603
		InputDialog newDialog = new InputDialog(getShell(),
408
		
604
				MarkerMessages.MarkerFilterDialog_title,
409
		String configName = initialName;
605
				MarkerMessages.MarkerFilterDialog_message,
410
		for (int i = 1; avoidNames.contains(configName); i++) {
606
				initialName != null ? initialName
411
			configName = initialName+ ' '+ i;
607
						: MarkerMessages.MarkerFilter_newFilterName,
608
				getNameValidator(avoidNames));
609
		if (Window.OK == newDialog.open()) {
610
			return newDialog.getValue();
611
		}
412
		}
612
		return null;
413
		return configName;
613
	}
414
	}
614
415
615
	/**
416
	private MarkerFieldFilterGroup createConfiguration(String newName) {
616
	 * Get IInputValidator for checking if the new name is valid
617
	 * 
618
	 * @param avoidNames
619
	 * @return IInputValidator
620
	 */
621
	private IInputValidator getNameValidator(final Collection avoidNames) {
622
		return new IInputValidator() {
623
			public String isValid(String value) {
624
				String newText = value.trim();
625
				if (newText.length() == 0)
626
					return MarkerMessages.MarkerFilterDialog_emptyMessage;
627
				if (avoidNames.contains(newText))
628
					return NLS.bind(
629
							MarkerMessages.filtersDialog_conflictingName,
630
							newText);
631
				return null;
632
			}
633
		};
634
	}
635
417
636
	/**
418
		MarkerFieldFilterGroup config = new MarkerFieldFilterGroup(null,
637
	 * Create a new filterGroup, and adds it to the filterGroups
638
	 * 
639
	 * @param cloneSelected
640
	 *            true clones the selected filterGroup
641
	 * @param newName
642
	 *            name of new filterGroup
643
	 */
644
	private void createNewFilter(String newName, boolean cloneSelected) {
645
		MarkerFieldFilterGroup group = new MarkerFieldFilterGroup(null,
646
				generator);
419
				generator);
647
		if (cloneSelected && selectedFilterGroup != null) {
420
		config.setName(newName);
648
			captureStateInto(group); // copy current values from UI
421
		return config;
649
		}
650
		group.setName(newName);
651
		filterGroups.add(group);
652
		filtersList.refresh();
653
		filtersList.setSelection(new StructuredSelection(group));
654
		filtersList.setChecked(group, true);
655
		updateAndOrEnblement();
656
	}
657
658
	/**
659
	 * Renames the supplied MarkerFieldFilterGroup
660
	 * 
661
	 * @param filterGroup
662
	 */
663
	private void renameFilter(MarkerFieldFilterGroup filterGroup) {
664
		if (filterGroup != null) {
665
			Collection names = getCurrentFilterNames();
666
			String initial = null;
667
			initial = filterGroup.getName();
668
			names.remove(initial);
669
			String newName = getNewFilterName(names, initial);
670
			if (newName != null) {
671
				filterGroup.setName(newName);
672
				filtersList.update(filterGroup, null);
673
			}
674
		}
675
	}
676
677
	/**
678
	 * Enable/disable 'and', 'or' buttons
679
	 */
680
	private void updateAndOrEnblement() {
681
		if (filtersList.getCheckedElements().length == 0) {
682
			andOrLabel.setEnabled(false);
683
			andButton.setEnabled(false);
684
			orButton.setEnabled(false);
685
		} else {
686
			andOrLabel.setEnabled(true);
687
			andButton.setEnabled(true);
688
			orButton.setEnabled(true);
689
		}
690
	}
422
	}
691
423
692
	/**
424
	/**
Lines 729-743 Link Here
729
				MarkerFieldFilterGroup group = (MarkerFieldFilterGroup) groups
461
				MarkerFieldFilterGroup group = (MarkerFieldFilterGroup) groups
730
						.next();
462
						.next();
731
				if (group.getName().equals(selection)) {
463
				if (group.getName().equals(selection)) {
732
					filtersList.setSelection(new StructuredSelection(group));
464
					configsTable.setSelection(new StructuredSelection(group));
733
					return;
465
					return;
734
				}
466
				}
735
			}
467
			}
736
		}
468
		}
737
469
738
		// If there is no initial selection make one
470
		// If there is no initial selection make one
739
		filtersList.setSelection(new StructuredSelection(filterGroups
471
		if(filterGroups.size() > 0) {
740
				.iterator().next()));
472
			configsTable.setSelection(new StructuredSelection(filterGroups
473
					.iterator().next()));
474
		}
741
	}
475
	}
742
476
743
	/**
477
	/**
Lines 759-825 Link Here
759
		return returnFilters;
493
		return returnFilters;
760
	}
494
	}
761
495
762
	private void validateState() {
763
		if (limitBttn == null || limitBttn.isDisposed()) {
764
			handleStatusUdpate(IStatus.INFO, null);
765
		} else {
766
			boolean limitLess = !limitBttn.getSelection();
767
			if (limitLess) {
768
				if (filtersList == null
769
						|| filtersList.getControl().isDisposed()) {
770
					handleStatusUdpate(IStatus.INFO, null);
771
				} else {
772
					boolean warnning = filtersList.getCheckedElements() == null
773
							|| filtersList.getCheckedElements().length == 0;
774
					if (warnning) {
775
						handleStatusUdpate(
776
								IStatus.WARNING,
777
								MarkerMessages.filtersDialogDeselectedFiltersMessage
778
										+ MarkerMessages.MarkerFilterDialog_YouHaveDisabledMarkerLimit);
779
780
					} else {
781
						handleStatusUdpate(
782
								IStatus.WARNING,
783
								MarkerMessages.MarkerFilterDialog_YouHaveDisabledMarkerLimit);
784
					}
785
				}
786
			} else {
787
				if (limitEditor == null || limitEditor.isDisposed()) {
788
					handleStatusUdpate(IStatus.INFO, null);
789
				} else {
790
					String value = limitEditor.getText().trim();
791
					boolean validLimit = value.length() != 0;
792
					if (validLimit) {
793
						try {
794
							int limit = Integer.parseInt(value);
795
							if (limit <= 0) {
796
								validLimit = false;
797
							}
798
						} catch (Exception e) {
799
							validLimit = false;
800
						}
801
					}
802
					if (filtersList == null
803
							|| filtersList.getControl().isDisposed()) {
804
						handleStatusUdpate(IStatus.INFO, null);
805
					} else {
806
						boolean warnning = filtersList.getCheckedElements().length == 0;
807
						if (validLimit) {
808
							if (warnning) {
809
								handleStatusUdpate(
810
										IStatus.WARNING,
811
										MarkerMessages.filtersDialogDeselectedFiltersMessage);
812
							} else {
813
								handleStatusUdpate(IStatus.INFO, null);
814
							}
815
						} else {
816
							handleStatusUdpate(IStatus.ERROR, null);
817
						}
818
					}
819
				}
820
			}
821
		}
822
	}
823
496
824
	/*
497
	/*
825
	 * (non-Javadoc)
498
	 * (non-Javadoc)
Lines 828-905 Link Here
828
	 */
501
	 */
829
	protected void okPressed() {
502
	protected void okPressed() {
830
503
831
		IDEWorkbenchPlugin
504
		int limits;
832
				.getDefault()
505
		
833
				.getPreferenceStore()
506
		if(limitButton.getSelection())
834
				.setValue(IDEInternalPreferences.MARKER_LIMITS_VALUE,
507
			limits = limitSpinner.getSelection();
835
						getLimitValue());
508
		else
836
		IDEWorkbenchPlugin
509
			limits = -1;
837
				.getDefault()
510
		
838
				.getPreferenceStore()
511
		generator.setMarkerLimits(limits);
839
				.setValue(IDEInternalPreferences.USE_MARKER_LIMITS,
512
		
840
						isLimitEnabled());
841
		IDEWorkbenchPlugin.getDefault().savePluginPreferences();
842
843
		Iterator filterGroupIterator = filterGroups.iterator();
513
		Iterator filterGroupIterator = filterGroups.iterator();
844
		while (filterGroupIterator.hasNext()) {
514
		while (filterGroupIterator.hasNext()) {
845
			MarkerFieldFilterGroup group = (MarkerFieldFilterGroup) filterGroupIterator
515
			MarkerFieldFilterGroup group = (MarkerFieldFilterGroup) filterGroupIterator
846
					.next();
516
					.next();
847
			group.setEnabled(filtersList.getChecked(group));
517
			group.setEnabled(configsTable.getChecked(group));
848
		}
518
		}
849
		captureStateInto(selectedFilterGroup);
519
		saveDialogSettings();
850
520
851
		super.okPressed();
521
		super.okPressed();
852
522
853
	}
523
	}
854
524
855
	/**
856
	 * 
857
	 * Updates the filterGroup with the values showing in the dialog's GUI.
858
	 * 
859
	 * @param filterGroup
860
	 * 
861
	 */
862
	private void captureStateInto(MarkerFieldFilterGroup filterGroup) {
863
		if (filterGroup != null) {
864
865
			scopeArea.applyToGroup(filterGroup);
866
			Iterator areas = filterAreas.iterator();
867
			while (areas.hasNext()) {
868
				FilterConfigurationArea area = (FilterConfigurationArea) areas
869
						.next();
870
871
				// Handle the internal special cases
872
				if (area instanceof GroupFilterConfigurationArea)
873
					((GroupFilterConfigurationArea) area)
874
							.applyToGroup(filterGroup);
875
				area.apply(filterGroup.getFilter(area.getField()));
876
			}
877
		}
878
	}
879
880
	/*
881
	 * (non-Javadoc)
882
	 * 
883
	 * @see org.eclipse.ui.preferences.ViewSettingsDialog#performDefaults()
884
	 */
885
	protected void performDefaults() {
525
	protected void performDefaults() {
886
		setLimitEnabled(IDEWorkbenchPlugin.getDefault().getPreferenceStore()
526
		
887
				.getDefaultBoolean(IDEInternalPreferences.USE_MARKER_LIMITS));
527
		limitButton.setSelection(true);
888
		limitBttn.setSelection(isLimitEnabled());
528
		limitSpinner.setSelection(IDEWorkbenchPlugin.getDefault().getPreferenceStore()
889
890
		setLimitValue(IDEWorkbenchPlugin.getDefault().getPreferenceStore()
891
				.getDefaultInt(IDEInternalPreferences.MARKER_LIMITS_VALUE));
529
				.getDefaultInt(IDEInternalPreferences.MARKER_LIMITS_VALUE));
892
		limitEditor.setText(Integer.toString(getLimitValue()));
893
530
894
		filterGroups.clear();
531
		filterGroups.clear();
895
		filterGroups.addAll(generator.getDeclaredFilters());
532
		filterGroups.addAll(generator.getDeclaredFilters());
896
		filtersList.refresh();
533
		configsTable.refresh();
897
		filtersList.setSelection(new StructuredSelection(
534
		configsTable.setSelection(new StructuredSelection(
898
				filterGroups.size() > 1 ? filterGroups.iterator().next()
535
				filterGroups.size() > 1 ? filterGroups.iterator().next()
899
						: new Object[0]));
536
						: new Object[0]));
900
		andFilters = false;
537
		andFilters = false;
901
		andButton.setSelection(andFilters);
538
		andButton.setSelection(andFilters);
902
		orButton.setSelection(!andFilters);
539
		orButton.setSelection(!andFilters);
540
		updateRadioButtonsFromTable();
903
	}
541
	}
904
542
905
	/**
543
	/**
Lines 910-917 Link Here
910
	private void removeFilters(ISelection selection) {
548
	private void removeFilters(ISelection selection) {
911
		filterGroups.remove(((IStructuredSelection) selection)
549
		filterGroups.remove(((IStructuredSelection) selection)
912
				.getFirstElement());
550
				.getFirstElement());
913
		filtersList.refresh();
551
		configsTable.refresh();
914
		updateAndOrEnblement();
552
		updateRadioButtonsFromTable();
915
	}
553
	}
916
554
917
	/**
555
	/**
Lines 925-1025 Link Here
925
563
926
	}
564
	}
927
565
928
	/**
566
	private void updateButtonEnablement() {
929
	 * @return Returns the limitValue.
567
		boolean empty = configsTable.getSelection().isEmpty();
930
	 */
568
		editButton.setEnabled(!empty);
931
	private int getLimitValue() {
569
		removeButton.setEnabled(!empty);
932
		return limitValue;
933
	}
934
935
	/**
936
	 * @param limitValue
937
	 *            The limitValue to set.
938
	 */
939
	private void setLimitValue(int limitValue) {
940
		this.limitValue = limitValue;
941
	}
942
943
	/**
944
	 * @return Returns true if limit is enabled.
945
	 */
946
	private boolean isLimitEnabled() {
947
		return limitEnabled;
948
	}
570
	}
949
571
950
	/**
951
	 * @param limitEnabled
952
	 *            The limitEnabled to set.
953
	 */
954
	private void setLimitEnabled(boolean limitEnabled) {
955
		this.limitEnabled = limitEnabled;
956
	}
957
958
	/**
959
	 * Set the control and all of it's visibility state to visible.
960
	 * 
961
	 * @param visible
962
	 * @param control
963
	 */
964
	private void setEnabled(boolean visible, Control control) {
965
		control.setEnabled(visible);
966
		if (control instanceof Composite) {
967
			Control[] children = ((Composite) control).getChildren();
968
			for (int i = 0; i < children.length; i++) {
969
				setEnabled(visible, children[i]);
970
			}
971
		}
972
	}
973
974
	/**
975
	 * Set the enablement state of the fields to enabled.
976
	 */
977
	private void setFieldsEnabled(boolean visible) {
978
		setEnabled(visible, form);
979
	}
980
981
	/**
982
	 * Set the filter that is being worked on.
983
	 * 
984
	 * @param markerFieldFilterGroup
985
	 */
986
	private void setSelectedFilter(MarkerFieldFilterGroup markerFieldFilterGroup) {
987
		if (selectedFilterGroup == markerFieldFilterGroup) {
988
			return;
989
		}
990
		removeButton
991
				.setEnabled(!(markerFieldFilterGroup == null || markerFieldFilterGroup
992
						.isSystem()));
993
		renameButton
994
				.setEnabled(!(markerFieldFilterGroup == null || markerFieldFilterGroup
995
						.isSystem()));
996
		cloneButton.setEnabled(markerFieldFilterGroup != null);
997
998
		MarkerFieldFilterGroup old = selectedFilterGroup;
999
		selectedFilterGroup = markerFieldFilterGroup;
1000
		if (old != null)
1001
			scopeArea.applyToGroup(old);
1002
1003
		if (selectedFilterGroup == null) {
1004
			setFieldsEnabled(false);
1005
			return;
1006
		}
1007
1008
		setFieldsEnabled(true);
1009
		scopeArea.initializeFromGroup(selectedFilterGroup);
1010
		Iterator areas = filterAreas.iterator();
1011
		while (areas.hasNext()) {
1012
			FilterConfigurationArea area = (FilterConfigurationArea) areas
1013
					.next();
1014
			if (old != null) {
1015
				if (area instanceof GroupFilterConfigurationArea)
1016
					((GroupFilterConfigurationArea) area).applyToGroup(old);
1017
				area.apply(old.getFilter(area.getField()));
1018
			}
1019
			if (area instanceof GroupFilterConfigurationArea)
1020
				((GroupFilterConfigurationArea) area)
1021
						.initializeFromGroup(selectedFilterGroup);
1022
			area.initialize(selectedFilterGroup.getFilter(area.getField()));
1023
		}
1024
	}
1025
}
572
}
(-)src/org/eclipse/ui/internal/views/markers/MarkerContentGenerator.java (-37 / +59 lines)
Lines 67-72 Link Here
67
	private static final String TAG_GROUP_ENTRY = "filterGroup"; //$NON-NLS-1$
67
	private static final String TAG_GROUP_ENTRY = "filterGroup"; //$NON-NLS-1$
68
	private static final String TAG_AND = "andFilters"; //$NON-NLS-1$
68
	private static final String TAG_AND = "andFilters"; //$NON-NLS-1$
69
	private static final String TAG_LEGACY_FILTER_ENTRY = "filter"; //$NON-NLS-1$
69
	private static final String TAG_LEGACY_FILTER_ENTRY = "filter"; //$NON-NLS-1$
70
	private static final String TAG_MARKER_LIMIT = "markerLimit"; //$NON-NLS-1$
70
	
71
	
71
	/*Use this to indicate filter change rather than a null*/
72
	/*Use this to indicate filter change rather than a null*/
72
	private final Collection FILTERS_CHANGED = Collections.EMPTY_SET;
73
	private final Collection FILTERS_CHANGED = Collections.EMPTY_SET;
Lines 81-86 Link Here
81
	private Collection enabledFilters;
82
	private Collection enabledFilters;
82
	private Collection filters;
83
	private Collection filters;
83
	private boolean andFilters = false;
84
	private boolean andFilters = false;
85
	private int markerLimits = 100;
84
86
85
	/**
87
	/**
86
	 * focusResources
88
	 * focusResources
Lines 199-209 Link Here
199
		return hidden.toArray();
201
		return hidden.toArray();
200
	}
202
	}
201
203
202
	void initialise(IMemento memento) {
204
	void saveState(IMemento memento, MarkerField[] displayedFields) {
203
		initialiseVisibleFields(memento);
205
204
	}
206
		memento.putInteger(TAG_MARKER_LIMIT, markerLimits);
205
207
206
	void saveSate(IMemento memento, MarkerField[] displayedFields) {
207
		for (int i = 0; i < displayedFields.length; i++) {
208
		for (int i = 0; i < displayedFields.length; i++) {
208
			memento.createChild(TAG_COLUMN_VISIBILITY, displayedFields[i]
209
			memento.createChild(TAG_COLUMN_VISIBILITY, displayedFields[i]
209
					.getConfigurationElement().getAttribute(
210
					.getConfigurationElement().getAttribute(
Lines 212-259 Link Here
212
	}
213
	}
213
214
214
	void restoreState(IMemento memento) {
215
	void restoreState(IMemento memento) {
215
		initialiseVisibleFields(memento);
216
	}
217
218
	/**
219
	 * Initialize the visible fields based on the initial settings or the
220
	 * contents of the {@link IMemento}
221
	 * 
222
	 * @param memento
223
	 *            IMemento
224
	 */
225
	private void initialiseVisibleFields(IMemento memento) {
226
216
227
		if (memento == null
217
		initDefaults();
228
				|| memento.getChildren(TAG_COLUMN_VISIBILITY).length == 0) {
229
			MarkerField[] initialFields = getInitialVisible();
230
218
231
			visibleFields = new MarkerField[initialFields.length];
219
		if (memento == null) {
232
			System.arraycopy(initialFields, 0, visibleFields, 0,
233
					initialFields.length);
234
			return;
220
			return;
235
		}
221
		}
236
222
		
237
		IMemento[] visible = memento.getChildren(TAG_COLUMN_VISIBILITY);
223
		Integer limits = memento.getInteger(TAG_MARKER_LIMIT);
238
		Collection newVisible = new ArrayList();
224
		if(limits != null) {
239
225
			markerLimits = limits.intValue();
240
		MarkerField[] all = getAllFields();
241
		Hashtable allTable = new Hashtable();
242
243
		for (int i = 0; i < all.length; i++) {
244
			allTable.put(all[i].getConfigurationElement().getAttribute(
245
					MarkerSupportInternalUtilities.ATTRIBUTE_ID), all[i]);
246
		}
226
		}
227
		
228
		if (memento.getChildren(TAG_COLUMN_VISIBILITY).length != 0) {
247
229
248
		for (int i = 0; i < visible.length; i++) {
230
			IMemento[] visible = memento.getChildren(TAG_COLUMN_VISIBILITY);
249
			String key = visible[i].getID();
231
			Collection newVisible = new ArrayList();
250
			if (allTable.containsKey(key)) {
232
	
251
				newVisible.add(allTable.get(key));
233
			MarkerField[] all = getAllFields();
234
			Hashtable allTable = new Hashtable();
235
	
236
			for (int i = 0; i < all.length; i++) {
237
				allTable.put(all[i].getConfigurationElement().getAttribute(
238
						MarkerSupportInternalUtilities.ATTRIBUTE_ID), all[i]);
252
			}
239
			}
240
	
241
			for (int i = 0; i < visible.length; i++) {
242
				String key = visible[i].getID();
243
				if (allTable.containsKey(key)) {
244
					newVisible.add(allTable.get(key));
245
				}
246
			}
247
	
248
			visibleFields = new MarkerField[newVisible.size()];
249
			newVisible.toArray(visibleFields);
253
		}
250
		}
251
	}
252
253
	private void initDefaults() {
254
		
255
		IPreferenceStore preferenceStore = IDEWorkbenchPlugin.getDefault().getPreferenceStore();
256
		if(preferenceStore.getBoolean(IDEInternalPreferences.USE_MARKER_LIMITS))
257
			markerLimits = preferenceStore.getInt(IDEInternalPreferences.MARKER_LIMITS_VALUE);
258
259
		MarkerField[] initialFields = getInitialVisible();
260
261
		visibleFields = new MarkerField[initialFields.length];
262
		System.arraycopy(initialFields, 0, visibleFields, 0,
263
				initialFields.length);
254
264
255
		visibleFields = new MarkerField[newVisible.size()];
256
		newVisible.toArray(visibleFields);
257
	}
265
	}
258
266
259
	/**
267
	/**
Lines 390-395 Link Here
390
	boolean andFilters() {
398
	boolean andFilters() {
391
		return andFilters;
399
		return andFilters;
392
	}
400
	}
401
	
402
	/**
403
	 * @return Returns the markerLimits.
404
	 */
405
	public int getMarkerLimits() {
406
		return markerLimits;
407
	}
408
	
409
	/**
410
	 * @param markerLimits The markerLimits to set.
411
	 */
412
	public void setMarkerLimits(int markerLimits) {
413
		this.markerLimits = markerLimits;
414
	}
393
415
394
	/**
416
	/**
395
	 * @return Collection of declared MarkerFieldFilterGroup(s)
417
	 * @return Collection of declared MarkerFieldFilterGroup(s)
(-)src/org/eclipse/ui/internal/views/markers/ViewerColumnsDialog.java (-161 / +81 lines)
Lines 20-35 Link Here
20
20
21
import org.eclipse.core.runtime.IStatus;
21
import org.eclipse.core.runtime.IStatus;
22
import org.eclipse.jface.resource.JFaceResources;
22
import org.eclipse.jface.resource.JFaceResources;
23
import org.eclipse.jface.viewers.ArrayContentProvider;
23
import org.eclipse.jface.viewers.ISelection;
24
import org.eclipse.jface.viewers.ISelection;
24
import org.eclipse.jface.viewers.ISelectionChangedListener;
25
import org.eclipse.jface.viewers.ISelectionChangedListener;
25
import org.eclipse.jface.viewers.IStructuredContentProvider;
26
import org.eclipse.jface.viewers.IStructuredSelection;
26
import org.eclipse.jface.viewers.IStructuredSelection;
27
import org.eclipse.jface.viewers.ITableLabelProvider;
27
import org.eclipse.jface.viewers.ITableLabelProvider;
28
import org.eclipse.jface.viewers.LabelProvider;
28
import org.eclipse.jface.viewers.LabelProvider;
29
import org.eclipse.jface.viewers.SelectionChangedEvent;
29
import org.eclipse.jface.viewers.SelectionChangedEvent;
30
import org.eclipse.jface.viewers.TableViewer;
30
import org.eclipse.jface.viewers.TableViewer;
31
import org.eclipse.jface.viewers.Viewer;
32
import org.eclipse.swt.SWT;
31
import org.eclipse.swt.SWT;
32
import org.eclipse.swt.events.FocusAdapter;
33
import org.eclipse.swt.events.FocusEvent;
33
import org.eclipse.swt.graphics.Image;
34
import org.eclipse.swt.graphics.Image;
34
import org.eclipse.swt.layout.FillLayout;
35
import org.eclipse.swt.layout.FillLayout;
35
import org.eclipse.swt.layout.GridData;
36
import org.eclipse.swt.layout.GridData;
Lines 39-51 Link Here
39
import org.eclipse.swt.widgets.Control;
40
import org.eclipse.swt.widgets.Control;
40
import org.eclipse.swt.widgets.Display;
41
import org.eclipse.swt.widgets.Display;
41
import org.eclipse.swt.widgets.Event;
42
import org.eclipse.swt.widgets.Event;
42
import org.eclipse.swt.widgets.Group;
43
import org.eclipse.swt.widgets.Label;
43
import org.eclipse.swt.widgets.Label;
44
import org.eclipse.swt.widgets.Listener;
44
import org.eclipse.swt.widgets.Listener;
45
import org.eclipse.swt.widgets.Shell;
45
import org.eclipse.swt.widgets.Shell;
46
import org.eclipse.swt.widgets.Spinner;
46
import org.eclipse.swt.widgets.Table;
47
import org.eclipse.swt.widgets.Table;
47
import org.eclipse.swt.widgets.TableColumn;
48
import org.eclipse.swt.widgets.TableColumn;
48
import org.eclipse.swt.widgets.Text;
49
import org.eclipse.ui.views.markers.internal.MarkerMessages;
49
import org.eclipse.ui.views.markers.internal.MarkerMessages;
50
50
51
/**
51
/**
Lines 75-94 Link Here
75
75
76
	private Button toVisibleBtt, toNonVisibleBtt;
76
	private Button toVisibleBtt, toNonVisibleBtt;
77
77
78
	private Text widthText;
78
	private Spinner widthSpinner;
79
80
	/**
81
	 * A listener to validate positive integer numbers only
82
	 */
83
	Listener postiveIntTextListener = new Listener() {
84
		private String intialValue;
85
86
		public void handleEvent(Event event) {
87
			intialValue = intialValue != null ? intialValue : Integer
88
					.toString(0);
89
			intialValue = handleIntegerFieldChange(event, intialValue);
90
		}
91
	};
92
79
93
	/**
80
	/**
94
	 * Create a new instance of the receiver.
81
	 * Create a new instance of the receiver.
Lines 130-159 Link Here
130
	 * @see org.eclipse.ui.internal.views.markers.ViewerSettingsAndStatusDialog#createDialogContentArea(org.eclipse.swt.widgets.Composite)
117
	 * @see org.eclipse.ui.internal.views.markers.ViewerSettingsAndStatusDialog#createDialogContentArea(org.eclipse.swt.widgets.Composite)
131
	 */
118
	 */
132
	protected Control createDialogContentArea(Composite dialogArea) {
119
	protected Control createDialogContentArea(Composite dialogArea) {
133
		return createColumnsArea(dialogArea);
120
		Composite composite = new Composite(dialogArea, SWT.NONE);
121
		composite.setLayout(new GridLayout(4, false));
122
		composite.setLayoutData(new GridData(GridData.FILL_BOTH));
123
		
124
		createInvisibleTable(composite);
125
		createMoveButtons(composite);
126
		createVisibleTable(composite);
127
		createUpDownBtt(composite);
128
		createWidthArea(composite);
129
		return composite;
134
	}
130
	}
135
	
131
	
136
	/**
137
	 * Create the controls to configure columns.
138
	 * 
139
	 * @param dialogArea
140
	 * @return {@link Control}
141
	 */
142
	Control createColumnsArea(Composite dialogArea) {
143
		Group columnArea = new Group(dialogArea, SWT.NONE);
144
		columnArea.setLayout(new GridLayout(4, false));
145
		GridData gData = new GridData(GridData.FILL_BOTH
146
				| GridData.GRAB_HORIZONTAL | GridData.GRAB_VERTICAL);
147
		columnArea.setLayoutData(gData);
148
		columnArea.setText(MarkerMessages.MarkerPreferences_ColumnGroupTitle);
149
150
		createInvisibleTable(columnArea);
151
		createMoveButtons(columnArea);
152
		createVisibleTable(columnArea);
153
		createUpDownBtt(columnArea);
154
		createWidthArea(columnArea);
155
		return columnArea;
156
	}
157
132
158
	/**
133
	/**
159
	 * The Up and Down button to change column ordering.
134
	 * The Up and Down button to change column ordering.
Lines 163-175 Link Here
163
	Control createUpDownBtt(Composite parent) {
138
	Control createUpDownBtt(Composite parent) {
164
		Composite composite = new Composite(parent, SWT.NONE);
139
		Composite composite = new Composite(parent, SWT.NONE);
165
		GridLayout layout = new GridLayout(1, true);
140
		GridLayout layout = new GridLayout(1, true);
166
		layout.horizontalSpacing = 0;
167
		layout.marginRight = -1;
168
		layout.marginLeft = -1;
169
		layout.marginWidth = 0;
170
		composite.setLayout(layout);
141
		composite.setLayout(layout);
171
		composite.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL
142
		GridData gridData = new GridData(GridData.FILL_VERTICAL);
172
				| GridData.VERTICAL_ALIGN_END));
143
		gridData.verticalIndent = convertHeightInCharsToPixels(1);
144
		composite.setLayoutData(gridData);
173
		upButton = new Button(composite, SWT.PUSH);
145
		upButton = new Button(composite, SWT.PUSH);
174
		upButton.setText(JFaceResources.getString("ConfigureColumnsDialog_up")); //$NON-NLS-1$
146
		upButton.setText(JFaceResources.getString("ConfigureColumnsDialog_up")); //$NON-NLS-1$
175
		upButton.addListener(SWT.Selection, new Listener() {
147
		upButton.addListener(SWT.Selection, new Listener() {
Lines 177-183 Link Here
177
				handleUpButton(event);
149
				handleUpButton(event);
178
			}
150
			}
179
		});
151
		});
180
		upButton.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
152
		setButtonLayoutData(upButton);
181
		upButton.setEnabled(false);
153
		upButton.setEnabled(false);
182
154
183
		downButton = new Button(composite, SWT.PUSH);
155
		downButton = new Button(composite, SWT.PUSH);
Lines 188-194 Link Here
188
				handleDownButton(event);
160
				handleDownButton(event);
189
			}
161
			}
190
		});
162
		});
191
		downButton.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
163
		setButtonLayoutData(downButton);
192
		downButton.setEnabled(false);
164
		downButton.setEnabled(false);
193
		return composite;
165
		return composite;
194
	}
166
	}
Lines 208-253 Link Here
208
		gridData.horizontalSpan = 3;
180
		gridData.horizontalSpan = 3;
209
		widthLabel.setLayoutData(gridData);
181
		widthLabel.setLayoutData(gridData);
210
182
211
		widthText = new Text(parent, SWT.SINGLE | SWT.BORDER);
183
		widthSpinner = new Spinner(parent, SWT.BORDER);
212
		widthText.setText(Integer.toString(0));
184
		widthSpinner.setMinimum(1);
213
		gridData = new GridData(GridData.FILL_HORIZONTAL
185
		widthSpinner.setSelection(1);
214
				| GridData.HORIZONTAL_ALIGN_CENTER);
186
		widthSpinner.setMaximum(10000);
215
		gridData.widthHint = convertWidthInCharsToPixels(5);
187
		gridData = new GridData();
216
		widthText.setLayoutData(gridData);
188
		gridData.minimumWidth = convertWidthInCharsToPixels(5);
217
		widthText.addListener(SWT.Modify, postiveIntTextListener);
189
		widthSpinner.setLayoutData(gridData);
218
		widthText.addListener(SWT.Modify, new Listener() {
190
		widthSpinner.addFocusListener(new FocusAdapter() {
219
			public void handleEvent(Event event) {
191
			public void focusLost(FocusEvent e) {
220
				if (widthText.isEnabled()) {
192
				Object data = ((IStructuredSelection) visibleViewer
221
					try {
193
						.getSelection()).getFirstElement();
222
						int width = Integer
194
				if (data != null) {
223
								.parseInt(widthText.getText().trim());
195
					IColumnUpdater updater = getColumnUpdater();
224
						Object data = ((IStructuredSelection) visibleViewer
196
					updater.setColumnWidth(data, widthSpinner.getSelection());
225
								.getSelection()).getFirstElement();
226
						if (data != null) {
227
							IColumnUpdater updater = getColumnUpdater();
228
							updater.setColumnWidth(data, width);
229
						}
230
					} catch (Exception e) {
231
						return;// ignore
232
					}
233
				}
197
				}
234
			}
198
			}
235
		});
199
		});
236
		widthText.setText(MarkerSupportInternalUtilities.EMPTY_STRING);
200
		widthSpinner.setEnabled(false);
237
		widthText.setEditable(false);
201
		return widthSpinner;
238
		return widthText;
239
	}
240
241
	/**
242
	 * Adapter to {@link IStructuredContentProvider}
243
	 */
244
	abstract class ContentProviderAdapter implements IStructuredContentProvider {
245
246
		public void dispose() {
247
		}
248
249
		public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
250
		}
251
	}
202
	}
252
203
253
	/**
204
	/**
Lines 257-268 Link Here
257
	 * @return {@link Control}
208
	 * @return {@link Control}
258
	 */
209
	 */
259
	Control createVisibleTable(Composite parent) {
210
	Control createVisibleTable(Composite parent) {
260
		final Table table = new Table(parent, SWT.BORDER | SWT.MULTI);
211
212
		Composite composite = new Composite(parent, SWT.NONE);
213
		composite.setLayout(new GridLayout(1, false));
214
		composite.setLayoutData(new GridData(GridData.FILL_BOTH));
215
		
216
		Label label = new Label(composite, SWT.NONE);
217
		label.setText(MarkerMessages.MarkerPreferences_VisibleColumnsTitle);
218
219
		final Table table = new Table(composite, SWT.BORDER | SWT.MULTI);
261
		GridData data = new GridData(SWT.FILL, SWT.FILL, true, true);
220
		GridData data = new GridData(SWT.FILL, SWT.FILL, true, true);
262
		data.widthHint = convertWidthInCharsToPixels(30);
221
		data.widthHint = convertWidthInCharsToPixels(20);
263
		data.heightHint = table.getItemHeight() * 15;
222
		data.heightHint = table.getItemHeight() * 15;
264
		table.setLayoutData(data);
223
		table.setLayoutData(data);
265
		table.setHeaderVisible(true);
266
224
267
		final TableColumn column = new TableColumn(table, SWT.NONE);
225
		final TableColumn column = new TableColumn(table, SWT.NONE);
268
		column.setText(MarkerMessages.MarkerPreferences_VisibleColumnsTitle);
226
		column.setText(MarkerMessages.MarkerPreferences_VisibleColumnsTitle);
Lines 275-285 Link Here
275
233
276
		visibleViewer = new TableViewer(table);
234
		visibleViewer = new TableViewer(table);
277
		visibleViewer.setLabelProvider(doGetLabelProvider());
235
		visibleViewer.setLabelProvider(doGetLabelProvider());
278
		visibleViewer.setContentProvider(new ContentProviderAdapter() {
236
		visibleViewer.setContentProvider(ArrayContentProvider.getInstance());
279
			public Object[] getElements(Object inputElement) {
280
				return getVisible().toArray();
281
			}
282
		});
283
		visibleViewer
237
		visibleViewer
284
				.addSelectionChangedListener(new ISelectionChangedListener() {
238
				.addSelectionChangedListener(new ISelectionChangedListener() {
285
					public void selectionChanged(SelectionChangedEvent event) {
239
					public void selectionChanged(SelectionChangedEvent event) {
Lines 291-297 Link Here
291
				handleToNonVisibleButton(event);
245
				handleToNonVisibleButton(event);
292
			}
246
			}
293
		});
247
		});
294
		visibleViewer.setInput(this);
248
		visibleViewer.setInput(getVisible());
295
		return table;
249
		return table;
296
	}
250
	}
297
251
Lines 302-313 Link Here
302
	 * @return {@link Control}
256
	 * @return {@link Control}
303
	 */
257
	 */
304
	Control createInvisibleTable(Composite parent) {
258
	Control createInvisibleTable(Composite parent) {
305
		final Table table = new Table(parent, SWT.BORDER | SWT.MULTI);
259
		
260
		Composite composite = new Composite(parent, SWT.NONE);
261
		composite.setLayout(new GridLayout(1, false));
262
		composite.setLayoutData(new GridData(GridData.FILL_BOTH));
263
264
		Label label = new Label(composite, SWT.NONE);
265
		label.setText(MarkerMessages.MarkerPreferences_HiddenColumnsTitle);
266
		
267
		final Table table = new Table(composite, SWT.BORDER | SWT.MULTI);
306
		GridData data = new GridData(SWT.FILL, SWT.FILL, true, true);
268
		GridData data = new GridData(SWT.FILL, SWT.FILL, true, true);
307
		data.widthHint = convertWidthInCharsToPixels(30);
269
		data.widthHint = convertWidthInCharsToPixels(20);
308
		data.heightHint = table.getItemHeight() * 15;
270
		data.heightHint = table.getItemHeight() * 15;
309
		table.setLayoutData(data);
271
		table.setLayoutData(data);
310
		table.setHeaderVisible(true);
311
272
312
		final TableColumn column = new TableColumn(table, SWT.NONE);
273
		final TableColumn column = new TableColumn(table, SWT.NONE);
313
		column.setText(MarkerMessages.MarkerPreferences_HiddenColumnsTitle);
274
		column.setText(MarkerMessages.MarkerPreferences_HiddenColumnsTitle);
Lines 320-330 Link Here
320
281
321
		nonVisibleViewer = new TableViewer(table);
282
		nonVisibleViewer = new TableViewer(table);
322
		nonVisibleViewer.setLabelProvider(doGetLabelProvider());
283
		nonVisibleViewer.setLabelProvider(doGetLabelProvider());
323
		nonVisibleViewer.setContentProvider(new ContentProviderAdapter() {
284
		nonVisibleViewer.setContentProvider(ArrayContentProvider.getInstance());
324
			public Object[] getElements(Object inputElement) {
325
				return getNonVisible().toArray();
326
			}
327
		});
328
		nonVisibleViewer
285
		nonVisibleViewer
329
				.addSelectionChangedListener(new ISelectionChangedListener() {
286
				.addSelectionChangedListener(new ISelectionChangedListener() {
330
					public void selectionChanged(SelectionChangedEvent event) {
287
					public void selectionChanged(SelectionChangedEvent event) {
Lines 336-342 Link Here
336
				handleToVisibleButton(event);
293
				handleToVisibleButton(event);
337
			}
294
			}
338
		});
295
		});
339
		nonVisibleViewer.setInput(this);
296
		nonVisibleViewer.setInput(getNonVisible());
340
		return table;
297
		return table;
341
	}
298
	}
342
299
Lines 350-362 Link Here
350
	Control createMoveButtons(Composite parent) {
307
	Control createMoveButtons(Composite parent) {
351
		Composite bttArea = new Composite(parent, SWT.NONE);
308
		Composite bttArea = new Composite(parent, SWT.NONE);
352
		bttArea.setLayout(new GridLayout(1, true));
309
		bttArea.setLayout(new GridLayout(1, true));
353
		bttArea.setLayoutData(new GridData(GridData.FILL_VERTICAL));
310
		GridData gridData = new GridData(GridData.FILL_VERTICAL);
311
		gridData.verticalIndent = convertHeightInCharsToPixels(1);
312
		bttArea.setLayoutData(gridData);
313
314
		toVisibleBtt = new Button(bttArea, SWT.PUSH);
315
		toVisibleBtt
316
				.setText(getDefaultOrientation() == SWT.RIGHT_TO_LEFT ? MarkerMessages.MarkerPreferences_MoveLeft
317
						: MarkerMessages.MarkerPreferences_MoveRight);
318
		setButtonLayoutData(toVisibleBtt);
319
		toVisibleBtt.addListener(SWT.Selection, new Listener() {
320
			public void handleEvent(Event event) {
321
				handleToVisibleButton(event);
322
			}
323
		});
324
		toVisibleBtt.setEnabled(false);
354
325
355
		toNonVisibleBtt = new Button(bttArea, SWT.PUSH);
326
		toNonVisibleBtt = new Button(bttArea, SWT.PUSH);
356
		toNonVisibleBtt
327
		toNonVisibleBtt
357
				.setText(getDefaultOrientation() == SWT.RIGHT_TO_LEFT ? MarkerMessages.MarkerPreferences_MoveRight
328
				.setText(getDefaultOrientation() == SWT.RIGHT_TO_LEFT ? MarkerMessages.MarkerPreferences_MoveRight
358
						: MarkerMessages.MarkerPreferences_MoveLeft);
329
						: MarkerMessages.MarkerPreferences_MoveLeft);
359
		toNonVisibleBtt.setLayoutData(new GridData());
330
		setButtonLayoutData(toNonVisibleBtt);
360
331
361
		toNonVisibleBtt.addListener(SWT.Selection, new Listener() {
332
		toNonVisibleBtt.addListener(SWT.Selection, new Listener() {
362
			public void handleEvent(Event event) {
333
			public void handleEvent(Event event) {
Lines 365-424 Link Here
365
		});
336
		});
366
		toNonVisibleBtt.setEnabled(false);
337
		toNonVisibleBtt.setEnabled(false);
367
338
368
		toVisibleBtt = new Button(bttArea, SWT.PUSH);
369
		toVisibleBtt
370
				.setText(getDefaultOrientation() == SWT.RIGHT_TO_LEFT ? MarkerMessages.MarkerPreferences_MoveLeft
371
						: MarkerMessages.MarkerPreferences_MoveRight);
372
		toVisibleBtt.setLayoutData(new GridData());
373
		toVisibleBtt.addListener(SWT.Selection, new Listener() {
374
			public void handleEvent(Event event) {
375
				handleToVisibleButton(event);
376
			}
377
		});
378
		toVisibleBtt.setEnabled(false);
379
		return bttArea;
339
		return bttArea;
380
	}
340
	}
381
341
382
	/**
342
	/**
383
	 * 
384
	 * @param event
385
	 * @param intialvalue
386
	 * @return new value in String
387
	 */
388
	String handleIntegerFieldChange(Event event, String intialvalue) {
389
		String value = ((Text) event.widget).getText().trim();
390
		boolean editable = ((Text) event.widget).getEditable();
391
		switch (event.type) {
392
		case SWT.KeyDown:
393
		case SWT.Modify:
394
		case SWT.FocusOut:
395
			if (!editable) {
396
				handleStatusUdpate(IStatus.INFO, null);
397
				break;
398
			}
399
			if (value.length() == 0) {
400
				handleStatusUdpate(IStatus.ERROR, null);
401
			} else {
402
				try {
403
					int number = Integer.parseInt(value);
404
					if (number > 0) {
405
						handleStatusUdpate(IStatus.INFO, null);
406
					} else {
407
						value = intialvalue;
408
						((Text) event.widget).selectAll();
409
						handleStatusUdpate(IStatus.ERROR, getErrorMessage());
410
					}
411
				} catch (Exception e) {
412
					value = intialvalue;
413
					((Text) event.widget).selectAll();
414
					handleStatusUdpate(IStatus.ERROR, getErrorMessage());
415
				}
416
			}
417
		}
418
		return value;
419
	}
420
421
	/**
422
	 * Handles a selection change in the viewer that lists out the non-visible
343
	 * Handles a selection change in the viewer that lists out the non-visible
423
	 * columns
344
	 * columns
424
	 * 
345
	 * 
Lines 427-433 Link Here
427
	void handleNonVisibleSelection(ISelection selection) {
348
	void handleNonVisibleSelection(ISelection selection) {
428
		Object[] nvKeys = ((IStructuredSelection) selection).toArray();
349
		Object[] nvKeys = ((IStructuredSelection) selection).toArray();
429
		toVisibleBtt.setEnabled(nvKeys.length > 0);
350
		toVisibleBtt.setEnabled(nvKeys.length > 0);
430
351
		widthSpinner.setEnabled(false);
431
		if (visibleViewer.getControl().isFocusControl()
352
		if (visibleViewer.getControl().isFocusControl()
432
				&& getVisible().size() <= 1) {
353
				&& getVisible().size() <= 1) {
433
			handleStatusUdpate(IStatus.INFO,
354
			handleStatusUdpate(IStatus.INFO,
Lines 478-489 Link Here
478
399
479
		boolean edit = selVCols.size() == 1 ? infoProvider
400
		boolean edit = selVCols.size() == 1 ? infoProvider
480
				.isColumnResizable(selVCols.get(0)) : false;
401
				.isColumnResizable(selVCols.get(0)) : false;
481
		widthText.setEditable(edit);
402
		widthSpinner.setEnabled(edit);
482
		if (edit) {
403
		if (edit) {
483
			widthText.setText(Integer.toString(infoProvider
404
			widthSpinner.setSelection(infoProvider
484
					.getColumnWidth(selVCols.get(0))));
405
					.getColumnWidth(selVCols.get(0)));
485
		} else {
406
		} else {
486
			widthText.setText(MarkerSupportInternalUtilities.EMPTY_STRING);
407
			widthSpinner.setSelection(0);
487
		}
408
		}
488
	}
409
	}
489
410
Lines 1005-1009 Link Here
1005
926
1006
	}
927
	}
1007
928
1008
	// //////////////////////////////////////////////////////////////////////////////////
1009
}
929
}
(-)src/org/eclipse/ui/views/markers/internal/MarkerMessages.java (-3 / +7 lines)
Lines 76-81 Link Here
76
	public static String filtersDialog_title;
76
	public static String filtersDialog_title;
77
	public static String configureFiltersCommand_title;
77
	public static String configureFiltersCommand_title;
78
	public static String configureFiltersDialog_title;
78
	public static String configureFiltersDialog_title;
79
	
80
	public static String configEditDialog_name;
79
81
80
	public static String filtersDialog_showItemsOfType;
82
	public static String filtersDialog_showItemsOfType;
81
	public static String filtersDialog_anyResource;
83
	public static String filtersDialog_anyResource;
Lines 209-219 Link Here
209
	public static String MarkerFilter_filtersTitle;
211
	public static String MarkerFilter_filtersTitle;
210
	public static String MarkerFilter_addFilterName;
212
	public static String MarkerFilter_addFilterName;
211
	public static String MarkerFilter_cloneFilterName;
213
	public static String MarkerFilter_cloneFilterName;
214
	public static String MarkerFilter_editFilterName;
212
	public static String MarkerFilter_deleteSelectedName;
215
	public static String MarkerFilter_deleteSelectedName;
213
	public static String MarkerFilter_renameName;
214
	public static String MarkerFilter_showAllCommand_title;
216
	public static String MarkerFilter_showAllCommand_title;
215
	public static String MarkerFilter_ConfigureContentsCommand_title;
217
	public static String MarkerFilter_ConfigureContentsCommand_title;
216
218
	
217
	public static String MarkerFilterDialog_title;
219
	public static String MarkerFilterDialog_title;
218
	public static String MarkerFilterDialog_message;
220
	public static String MarkerFilterDialog_message;
219
	public static String MarkerFilterDialog_emptyMessage;
221
	public static String MarkerFilterDialog_emptyMessage;
Lines 250-255 Link Here
250
	public static String FieldMessage_NullMessage;
252
	public static String FieldMessage_NullMessage;
251
	public static String FieldCategory_Uncategorized;
253
	public static String FieldCategory_Uncategorized;
252
	public static String FieldMessage_WrongType;
254
	public static String FieldMessage_WrongType;
255
	public static String ConfigurationEditDialog_title;
256
	public static String ConfigurationEditDialog_message;
253
	public static String Category_Label;
257
	public static String Category_Label;
254
	public static String Category_Limit_Label;
258
	public static String Category_Limit_Label;
255
	public static String Category_One_Item_Label;
259
	public static String Category_One_Item_Label;
Lines 297-303 Link Here
297
301
298
	public static String PasteHandler_title;
302
	public static String PasteHandler_title;
299
303
300
	public static String AND_OR_Label;
304
	public static String ALL_Title;
301
	public static String AND_Title;
305
	public static String AND_Title;
302
	public static String OR_Title;
306
	public static String OR_Title;
303
307
(-)src/org/eclipse/ui/views/markers/internal/messages.properties (-11 / +15 lines)
Lines 60-65 Link Here
60
deleteActionConfirmTitle = Delete Selected Entries
60
deleteActionConfirmTitle = Delete Selected Entries
61
deleteActionConfirmMessage = Do you want to delete the selected entries? Deleted markers may be recreated by a build or may not be recoverable.
61
deleteActionConfirmMessage = Do you want to delete the selected entries? Deleted markers may be recreated by a build or may not be recoverable.
62
62
63
configEditDialog_name = &Name:
64
63
filtersDialog_title = Filters
65
filtersDialog_title = Filters
64
filtersDialog_entriesTitle = &Configurations:
66
filtersDialog_entriesTitle = &Configurations:
65
filtersDialog_showItemsOfType = Show items of &type:
67
filtersDialog_showItemsOfType = Show items of &type:
Lines 185-218 Link Here
185
RemoveMarker_errorTitle=Error
187
RemoveMarker_errorTitle=Error
186
188
187
MarkerFilter_defaultFilterName=Default
189
MarkerFilter_defaultFilterName=Default
188
MarkerFilter_newFilterName=New Filter
190
MarkerFilter_newFilterName=New Configuration
189
MarkerFilter_filtersTitle=User f&ilters:
191
MarkerFilter_filtersTitle=User f&ilters:
190
MarkerFilter_addFilterName=&New...
192
MarkerFilter_addFilterName=&New...
191
MarkerFilter_cloneFilterName=D&uplicate...
193
MarkerFilter_cloneFilterName=D&uplicate...
194
MarkerFilter_editFilterName=&Edit...
192
MarkerFilter_deleteSelectedName = Remo&ve
195
MarkerFilter_deleteSelectedName = Remo&ve
193
MarkerFilter_renameName = &Rename
194
MarkerFilter_showAllCommand_title = &Show All
196
MarkerFilter_showAllCommand_title = &Show All
195
MarkerFilter_ConfigureContentsCommand_title = &Configure Contents...
197
MarkerFilter_ConfigureContentsCommand_title = &Configure Contents...
196
198
197
MarkerFilterDialog_title=Filter Name
199
MarkerFilterDialog_title=Filter Name
198
MarkerFilterDialog_message=Select a filter name
200
MarkerFilterDialog_message=Select a filter name
199
MarkerFilterDialog_emptyMessage=Name must not be empty
201
MarkerFilterDialog_emptyMessage=Name must not be empty
200
AND_OR_Label=Show results matching: 
202
ALL_Title = &Show all items
201
AND_Title = A&ll enabled filters
203
AND_Title = Show items that match a&ll the configurations checked below
202
OR_Title = &Any enabled filter
204
OR_Title = Show items that match a&ny configuration checked below
203
205
204
MarkerFilterDialog_errorTitle = An error has occurred
206
MarkerFilterDialog_errorTitle = An error has occurred
205
MarkerFilterDialog_failedFilterMessage = Could not create filter {0}. 
207
MarkerFilterDialog_failedFilterMessage = Could not create filter {0}. 
206
208
207
MarkerPreferences_DialogTitle = Preferences
209
MarkerPreferences_DialogTitle = Preferences
208
MarkerPreferences_MarkerLimits = Use marker &limits
210
MarkerPreferences_MarkerLimits = Use item &limits
209
MarkerPreferences_VisibleItems = Limit visible &items per group to:
211
MarkerPreferences_MoveLeft = &Hide <
210
MarkerPreferences_MoveLeft = &<<
212
MarkerPreferences_MoveRight = &Show >
211
MarkerPreferences_MoveRight = &>>
212
MarkerPreferences_ColumnGroupTitle = Hide/Show Columns
213
MarkerPreferences_ColumnGroupTitle = Hide/Show Columns
213
MarkerPreferences_VisibleColumnsTitle = &Show
214
MarkerPreferences_VisibleColumnsTitle = &Shown:
214
MarkerPreferences_HiddenColumnsTitle = &Hide
215
MarkerPreferences_HiddenColumnsTitle = &Hidden:
215
MarkerPreferences_AtLeastOneVisibleColumn = There must be at least one visible column.
216
MarkerPreferences_AtLeastOneVisibleColumn = There must be at least one visible column.
217
MarkerPreferences_VisibleItems = &Number of items visible per group:
216
MarkerFilterDialog_YouHaveDisabledMarkerLimit= You have selected to disable limiting items per group.
218
MarkerFilterDialog_YouHaveDisabledMarkerLimit= You have selected to disable limiting items per group.
217
219
218
ProblemFilterDialog_System_Filters_Title = System filte&rs:
220
ProblemFilterDialog_System_Filters_Title = System filte&rs:
Lines 235-240 Link Here
235
FieldMessage_WrongType = {0} is not of a displayable type
237
FieldMessage_WrongType = {0} is not of a displayable type
236
238
237
FieldCategory_Uncategorized = Other
239
FieldCategory_Uncategorized = Other
240
ConfigurationEditDialog_title=Edit Configuration
241
ConfigurationEditDialog_message=Enter the details of the configuration
238
Category_Label = {0} ({1} items)
242
Category_Label = {0} ({1} items)
239
Category_One_Item_Label = {0} (1 item)
243
Category_One_Item_Label = {0} (1 item)
240
Category_Limit_Label = {0} ({1} of {2} items)
244
Category_Limit_Label = {0} ({1} of {2} items)

Return to bug 231081