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 310511 | Differences between
and this patch

Collapse All | Expand All

(-)ui/org/eclipse/debug/internal/ui/SWTFactory.java (-5 / +5 lines)
Lines 41-47 Link Here
41
	 * Returns a width hint for a button control.
41
	 * Returns a width hint for a button control.
42
	 */
42
	 */
43
	public static int getButtonWidthHint(Button button) {
43
	public static int getButtonWidthHint(Button button) {
44
		button.setFont(JFaceResources.getDialogFont());
44
		/*button.setFont(JFaceResources.getDialogFont());*/
45
		PixelConverter converter= new PixelConverter(button);
45
		PixelConverter converter= new PixelConverter(button);
46
		int widthHint= converter.convertHorizontalDLUsToPixels(IDialogConstants.BUTTON_WIDTH);
46
		int widthHint= converter.convertHorizontalDLUsToPixels(IDialogConstants.BUTTON_WIDTH);
47
		return Math.max(widthHint, button.computeSize(SWT.DEFAULT, SWT.DEFAULT, true).x);
47
		return Math.max(widthHint, button.computeSize(SWT.DEFAULT, SWT.DEFAULT, true).x);
Lines 111-117 Link Here
111
		}
111
		}
112
		GridData gd = new GridData();
112
		GridData gd = new GridData();
113
		button.setLayoutData(gd);	
113
		button.setLayoutData(gd);	
114
		SWTFactory.setButtonDimensionHint(button);
114
		setButtonDimensionHint(button);
115
		return button;	
115
		return button;	
116
	}	
116
	}	
117
117
Lines 138-144 Link Here
138
		}
138
		}
139
		GridData gd = new GridData(fill);
139
		GridData gd = new GridData(fill);
140
		button.setLayoutData(gd);	
140
		button.setLayoutData(gd);	
141
		SWTFactory.setButtonDimensionHint(button);
141
		setButtonDimensionHint(button);
142
		return button;	
142
		return button;	
143
	}	
143
	}	
144
	
144
	
Lines 177-183 Link Here
177
		}
177
		}
178
		GridData gd = new GridData();
178
		GridData gd = new GridData();
179
		button.setLayoutData(gd);	
179
		button.setLayoutData(gd);	
180
		SWTFactory.setButtonDimensionHint(button);
180
		setButtonDimensionHint(button);
181
		return button;	
181
		return button;	
182
	}	
182
	}	
183
	
183
	
Lines 201-207 Link Here
201
		GridData gd = new GridData(GridData.BEGINNING);
201
		GridData gd = new GridData(GridData.BEGINNING);
202
		gd.horizontalSpan = hspan;
202
		gd.horizontalSpan = hspan;
203
		button.setLayoutData(gd);	
203
		button.setLayoutData(gd);	
204
		SWTFactory.setButtonDimensionHint(button);
204
		setButtonDimensionHint(button);
205
		return button;	
205
		return button;	
206
	}
206
	}
207
	
207
	
(-)ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationTabGroupViewer.java (-2 lines)
Lines 293-299 Link Here
293
		
293
		
294
		Composite buttonComp = SWTFactory.createComposite(blComp, 2, 1, GridData.HORIZONTAL_ALIGN_END);
294
		Composite buttonComp = SWTFactory.createComposite(blComp, 2, 1, GridData.HORIZONTAL_ALIGN_END);
295
		fApplyButton = SWTFactory.createPushButton(buttonComp, LaunchConfigurationsMessages.LaunchConfigurationDialog__Apply_17, null,GridData.HORIZONTAL_ALIGN_END);
295
		fApplyButton = SWTFactory.createPushButton(buttonComp, LaunchConfigurationsMessages.LaunchConfigurationDialog__Apply_17, null,GridData.HORIZONTAL_ALIGN_END);
296
		SWTFactory.setButtonDimensionHint(fApplyButton);
297
		fApplyButton.addSelectionListener(new SelectionAdapter() {
296
		fApplyButton.addSelectionListener(new SelectionAdapter() {
298
			public void widgetSelected(SelectionEvent evt) {
297
			public void widgetSelected(SelectionEvent evt) {
299
				handleApplyPressed();
298
				handleApplyPressed();
Lines 301-307 Link Here
301
		});
300
		});
302
301
303
		fRevertButton = SWTFactory.createPushButton(buttonComp, LaunchConfigurationsMessages.LaunchConfigurationDialog_Revert_2, null, GridData.HORIZONTAL_ALIGN_END);
302
		fRevertButton = SWTFactory.createPushButton(buttonComp, LaunchConfigurationsMessages.LaunchConfigurationDialog_Revert_2, null, GridData.HORIZONTAL_ALIGN_END);
304
		SWTFactory.setButtonDimensionHint(fRevertButton);
305
		fRevertButton.addSelectionListener(new SelectionAdapter() {
303
		fRevertButton.addSelectionListener(new SelectionAdapter() {
306
			public void widgetSelected(SelectionEvent evt) {
304
			public void widgetSelected(SelectionEvent evt) {
307
				handleRevertPressed();
305
				handleRevertPressed();
(-)ui/org/eclipse/jdt/internal/debug/ui/snippeteditor/SelectImportsDialog.java (-26 / +12 lines)
Lines 139-145 Link Here
139
	
139
	
140
	private void createImportButtons(Composite container) {
140
	private void createImportButtons(Composite container) {
141
		PlatformUI.getWorkbench().getHelpSystem().setHelp(container, IJavaDebugHelpContextIds.SNIPPET_IMPORTS_DIALOG);
141
		PlatformUI.getWorkbench().getHelpSystem().setHelp(container, IJavaDebugHelpContextIds.SNIPPET_IMPORTS_DIALOG);
142
		Font font = container.getFont();
143
		
142
		
144
		// button container
143
		// button container
145
		Composite buttonContainer = new Composite(container, SWT.NONE);
144
		Composite buttonContainer = new Composite(container, SWT.NONE);
Lines 152-163 Link Here
152
		buttonContainer.setLayout(buttonLayout);
151
		buttonContainer.setLayout(buttonLayout);
153
		
152
		
154
		// Add type button
153
		// Add type button
155
		fAddTypeButton = new Button(buttonContainer, SWT.PUSH);
154
		fAddTypeButton = SWTFactory.createPushButton(buttonContainer, 
156
		fAddTypeButton.setText(SnippetMessages.getString("SelectImportsDialog.Add_&Type_1")); //$NON-NLS-1$
155
				SnippetMessages.getString("SelectImportsDialog.Add_&Type_1"),  //$NON-NLS-1$
157
		fAddTypeButton.setToolTipText(SnippetMessages.getString("SelectImportsDialog.Choose_a_Type_to_Add_as_an_Import_2")); //$NON-NLS-1$
156
				SnippetMessages.getString("SelectImportsDialog.Choose_a_Type_to_Add_as_an_Import_2"),  //$NON-NLS-1$
158
		gd = getButtonGridData(fAddTypeButton);
157
				null);
159
		fAddTypeButton.setLayoutData(gd);
160
		fAddTypeButton.setFont(font);
161
		fAddTypeButton.addSelectionListener(new SelectionListener() {
158
		fAddTypeButton.addSelectionListener(new SelectionListener() {
162
			public void widgetSelected(SelectionEvent se) {
159
			public void widgetSelected(SelectionEvent se) {
163
				addType();
160
				addType();
Lines 167-178 Link Here
167
		});
164
		});
168
		
165
		
169
		// Add package button
166
		// Add package button
170
		fAddPackageButton = new Button(buttonContainer, SWT.PUSH);
167
		fAddPackageButton = SWTFactory.createPushButton(buttonContainer, 
171
		fAddPackageButton.setText(SnippetMessages.getString("SelectImportsDialog.Add_&Package_3")); //$NON-NLS-1$
168
				SnippetMessages.getString("SelectImportsDialog.Add_&Package_3"),  //$NON-NLS-1$
172
		fAddPackageButton.setToolTipText(SnippetMessages.getString("SelectImportsDialog.Choose_a_Package_to_Add_as_an_Import_4")); //$NON-NLS-1$
169
				SnippetMessages.getString("SelectImportsDialog.Choose_a_Package_to_Add_as_an_Import_4"),  //$NON-NLS-1$
173
		gd = getButtonGridData(fAddPackageButton);
170
				null);
174
		fAddPackageButton.setLayoutData(gd);
175
		fAddPackageButton.setFont(font);
176
		fAddPackageButton.addSelectionListener(new SelectionListener() {
171
		fAddPackageButton.addSelectionListener(new SelectionListener() {
177
			public void widgetSelected(SelectionEvent se) {
172
			public void widgetSelected(SelectionEvent se) {
178
				addPackage();
173
				addPackage();
Lines 182-193 Link Here
182
		});
177
		});
183
		
178
		
184
		// Remove button
179
		// Remove button
185
		fRemoveImportsButton = new Button(buttonContainer, SWT.PUSH);
180
		fRemoveImportsButton = SWTFactory.createPushButton(buttonContainer, 
186
		fRemoveImportsButton.setText(SnippetMessages.getString("SelectImportsDialog.&Remove_5")); //$NON-NLS-1$
181
				SnippetMessages.getString("SelectImportsDialog.&Remove_5"),  //$NON-NLS-1$
187
		fRemoveImportsButton.setToolTipText(SnippetMessages.getString("SelectImportsDialog.Remove_All_Selected_Imports_6")); //$NON-NLS-1$
182
				SnippetMessages.getString("SelectImportsDialog.Remove_All_Selected_Imports_6"),  //$NON-NLS-1$
188
		gd = getButtonGridData(fRemoveImportsButton);
183
				null);
189
		fRemoveImportsButton.setLayoutData(gd);
190
		fRemoveImportsButton.setFont(font);
191
		fRemoveImportsButton.addSelectionListener(new SelectionListener() {
184
		fRemoveImportsButton.addSelectionListener(new SelectionListener() {
192
			public void widgetSelected(SelectionEvent se) {
185
			public void widgetSelected(SelectionEvent se) {
193
				removeImports();
186
				removeImports();
Lines 199-211 Link Here
199
		
192
		
200
	}
193
	}
201
	
194
	
202
	private GridData getButtonGridData(Button button) {
203
		GridData gd= new GridData(GridData.FILL_HORIZONTAL | GridData.VERTICAL_ALIGN_BEGINNING);
204
		button.setLayoutData(gd);
205
		SWTFactory.setButtonDimensionHint(button);
206
		return gd;
207
	}
208
		
209
	private void removeImports() {
195
	private void removeImports() {
210
		IStructuredSelection selection = (IStructuredSelection)fImportsViewer.getSelection();		
196
		IStructuredSelection selection = (IStructuredSelection)fImportsViewer.getSelection();		
211
		fImportContentProvider.removeImports(selection.toArray());
197
		fImportContentProvider.removeImports(selection.toArray());

Return to bug 310511