View | Details | Raw Unified | Return to bug 264356
Collapse All | Expand All

(-)ui refactoring/org/eclipse/jdt/internal/ui/refactoring/reorg/ReorgQueries.java (-3 / +3 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2000, 2008 IBM Corporation and others.
2
 * Copyright (c) 2000, 2009 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 21-33 Link Here
21
import org.eclipse.jface.viewers.ArrayContentProvider;
21
import org.eclipse.jface.viewers.ArrayContentProvider;
22
import org.eclipse.jface.wizard.Wizard;
22
import org.eclipse.jface.wizard.Wizard;
23
23
24
import org.eclipse.ui.dialogs.ListDialog;
25
24
import org.eclipse.jdt.internal.corext.refactoring.reorg.IConfirmQuery;
26
import org.eclipse.jdt.internal.corext.refactoring.reorg.IConfirmQuery;
25
import org.eclipse.jdt.internal.corext.refactoring.reorg.IReorgQueries;
27
import org.eclipse.jdt.internal.corext.refactoring.reorg.IReorgQueries;
26
28
27
import org.eclipse.jdt.ui.JavaElementLabelProvider;
29
import org.eclipse.jdt.ui.JavaElementLabelProvider;
28
30
29
import org.eclipse.jdt.internal.ui.dialogs.ListDialog;
30
31
public class ReorgQueries implements IReorgQueries {
31
public class ReorgQueries implements IReorgQueries {
32
32
33
	private final Wizard fWizard;
33
	private final Wizard fWizard;
(-)ui/org/eclipse/jdt/internal/ui/dialogs/ListDialog.java (-102 lines)
Removed Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2000, 2008 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 *
8
 * Contributors:
9
 *     IBM Corporation - initial API and implementation
10
 *******************************************************************************/
11
package org.eclipse.jdt.internal.ui.dialogs;
12
13
import org.eclipse.swt.SWT;
14
import org.eclipse.swt.layout.GridData;
15
import org.eclipse.swt.widgets.Composite;
16
import org.eclipse.swt.widgets.Control;
17
import org.eclipse.swt.widgets.Label;
18
import org.eclipse.swt.widgets.Shell;
19
import org.eclipse.swt.widgets.Table;
20
21
import org.eclipse.jface.dialogs.IDialogConstants;
22
import org.eclipse.jface.viewers.ILabelProvider;
23
import org.eclipse.jface.viewers.IStructuredContentProvider;
24
import org.eclipse.jface.viewers.TableViewer;
25
26
import org.eclipse.ui.dialogs.SelectionDialog;
27
28
public class ListDialog extends SelectionDialog {
29
30
	private IStructuredContentProvider fContentProvider;
31
	private ILabelProvider fLabelProvider;
32
	private Object fInput;
33
	private TableViewer fTableViewer;
34
	private boolean fAddCancelButton;
35
36
	public ListDialog(Shell parent) {
37
		super(parent);
38
		fAddCancelButton= false;
39
	}
40
41
	public void setInput(Object input) {
42
		fInput= input;
43
	}
44
45
	public void setContentProvider(IStructuredContentProvider sp){
46
		fContentProvider= sp;
47
	}
48
49
	public void setLabelProvider(ILabelProvider lp){
50
		fLabelProvider= lp;
51
	}
52
53
	public void setAddCancelButton(boolean addCancelButton) {
54
		fAddCancelButton= addCancelButton;
55
	}
56
57
	public TableViewer getTableViewer(){
58
		return fTableViewer;
59
	}
60
61
	public boolean hasFilters(){
62
		return fTableViewer.getFilters() != null && fTableViewer.getFilters().length != 0;
63
	}
64
65
	protected Label createMessageArea(Composite composite) {
66
		Label label = new Label(composite,SWT.WRAP);
67
		label.setText(getMessage());
68
		GridData gd= new GridData(GridData.FILL_BOTH);
69
		gd.widthHint= convertWidthInCharsToPixels(55);
70
		label.setLayoutData(gd);
71
		applyDialogFont(label);
72
		return label;
73
	}
74
75
	protected Control createDialogArea(Composite container) {
76
		Composite parent= (Composite) super.createDialogArea(container);
77
		createMessageArea(parent);
78
		fTableViewer= new TableViewer(parent, getTableStyle());
79
		fTableViewer.setContentProvider(fContentProvider);
80
		Table table= fTableViewer.getTable();
81
		fTableViewer.setLabelProvider(fLabelProvider);
82
		fTableViewer.setInput(fInput);
83
		GridData gd= new GridData(GridData.FILL_BOTH);
84
		gd.widthHint= convertWidthInCharsToPixels(55);
85
		gd.heightHint= convertHeightInCharsToPixels(15);
86
		table.setLayoutData(gd);
87
		applyDialogFont(parent);
88
		return parent;
89
	}
90
91
	protected void createButtonsForButtonBar(Composite parent) {
92
		if (! fAddCancelButton)
93
			createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true);
94
		else
95
			super.createButtonsForButtonBar(parent);
96
	}
97
98
	protected int getTableStyle() {
99
		return SWT.SINGLE | SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER;
100
	}
101
}
102
(-)ui/org/eclipse/jdt/ui/actions/ExternalizeStringsAction.java (-2 / +2 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2000, 2008 IBM Corporation and others.
2
 * Copyright (c) 2000, 2009 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 52-57 Link Here
52
import org.eclipse.ui.IWorkbenchSite;
52
import org.eclipse.ui.IWorkbenchSite;
53
import org.eclipse.ui.IWorkingSet;
53
import org.eclipse.ui.IWorkingSet;
54
import org.eclipse.ui.PlatformUI;
54
import org.eclipse.ui.PlatformUI;
55
import org.eclipse.ui.dialogs.ListDialog;
55
56
56
import org.eclipse.jdt.core.ICompilationUnit;
57
import org.eclipse.jdt.core.ICompilationUnit;
57
import org.eclipse.jdt.core.IJavaElement;
58
import org.eclipse.jdt.core.IJavaElement;
Lines 79-85 Link Here
79
import org.eclipse.jdt.internal.ui.actions.ActionUtil;
80
import org.eclipse.jdt.internal.ui.actions.ActionUtil;
80
import org.eclipse.jdt.internal.ui.actions.SelectionConverter;
81
import org.eclipse.jdt.internal.ui.actions.SelectionConverter;
81
import org.eclipse.jdt.internal.ui.javaeditor.CompilationUnitEditor;
82
import org.eclipse.jdt.internal.ui.javaeditor.CompilationUnitEditor;
82
import org.eclipse.jdt.internal.ui.refactoring.actions.ListDialog;
83
import org.eclipse.jdt.internal.ui.refactoring.nls.ExternalizeWizard;
83
import org.eclipse.jdt.internal.ui.refactoring.nls.ExternalizeWizard;
84
import org.eclipse.jdt.internal.ui.util.ExceptionHandler;
84
import org.eclipse.jdt.internal.ui.util.ExceptionHandler;
85
import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels;
85
import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels;
(-)ui/org/eclipse/jdt/ui/actions/FindStringsToExternalizeAction.java (-2 / +2 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2000, 2008 IBM Corporation and others.
2
 * Copyright (c) 2000, 2009 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 47-52 Link Here
47
47
48
import org.eclipse.ui.IWorkbenchSite;
48
import org.eclipse.ui.IWorkbenchSite;
49
import org.eclipse.ui.PlatformUI;
49
import org.eclipse.ui.PlatformUI;
50
import org.eclipse.ui.dialogs.ListDialog;
50
51
51
import org.eclipse.jdt.core.ICompilationUnit;
52
import org.eclipse.jdt.core.ICompilationUnit;
52
import org.eclipse.jdt.core.IJavaElement;
53
import org.eclipse.jdt.core.IJavaElement;
Lines 69-75 Link Here
69
import org.eclipse.jdt.internal.ui.IJavaHelpContextIds;
70
import org.eclipse.jdt.internal.ui.IJavaHelpContextIds;
70
import org.eclipse.jdt.internal.ui.JavaPlugin;
71
import org.eclipse.jdt.internal.ui.JavaPlugin;
71
import org.eclipse.jdt.internal.ui.actions.ActionMessages;
72
import org.eclipse.jdt.internal.ui.actions.ActionMessages;
72
import org.eclipse.jdt.internal.ui.refactoring.actions.ListDialog;
73
import org.eclipse.jdt.internal.ui.refactoring.nls.ExternalizeWizard;
73
import org.eclipse.jdt.internal.ui.refactoring.nls.ExternalizeWizard;
74
import org.eclipse.jdt.internal.ui.util.ExceptionHandler;
74
import org.eclipse.jdt.internal.ui.util.ExceptionHandler;
75
import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels;
75
import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels;
(-)ui refactoring/org/eclipse/jdt/internal/ui/refactoring/actions/ListDialog.java (-90 lines)
Removed Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2000, 2008 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 *
8
 * Contributors:
9
 *     IBM Corporation - initial API and implementation
10
 *******************************************************************************/
11
package org.eclipse.jdt.internal.ui.refactoring.actions;
12
13
import org.eclipse.swt.SWT;
14
import org.eclipse.swt.layout.GridData;
15
import org.eclipse.swt.widgets.Composite;
16
import org.eclipse.swt.widgets.Control;
17
import org.eclipse.swt.widgets.Shell;
18
import org.eclipse.swt.widgets.Table;
19
20
import org.eclipse.jface.dialogs.IDialogConstants;
21
import org.eclipse.jface.viewers.ILabelProvider;
22
import org.eclipse.jface.viewers.IStructuredContentProvider;
23
import org.eclipse.jface.viewers.TableViewer;
24
25
import org.eclipse.ui.dialogs.SelectionDialog;
26
27
public class ListDialog extends SelectionDialog {
28
29
	private IStructuredContentProvider fContentProvider;
30
	private ILabelProvider fLabelProvider;
31
	private Object fInput;
32
	private TableViewer fTableViewer;
33
	private boolean fAddCancelButton;
34
35
	public ListDialog(Shell parent) {
36
		super(parent);
37
		fAddCancelButton= false;
38
	}
39
40
	public void setInput(Object input) {
41
		fInput= input;
42
	}
43
44
	public void setContentProvider(IStructuredContentProvider sp){
45
		fContentProvider= sp;
46
	}
47
48
	public void setLabelProvider(ILabelProvider lp){
49
		fLabelProvider= lp;
50
	}
51
52
	public void setAddCancelButton(boolean addCancelButton) {
53
		fAddCancelButton= addCancelButton;
54
	}
55
56
	public TableViewer getTableViewer(){
57
		return fTableViewer;
58
	}
59
60
	public boolean hasFilters(){
61
		return fTableViewer.getFilters() != null && fTableViewer.getFilters().length != 0;
62
	}
63
64
	protected void createButtonsForButtonBar(Composite parent) {
65
		if (! fAddCancelButton)
66
			createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true);
67
		else
68
			super.createButtonsForButtonBar(parent);
69
	}
70
71
	protected Control createDialogArea(Composite container) {
72
		Composite parent= (Composite) super.createDialogArea(container);
73
		createMessageArea(parent);
74
		fTableViewer= new TableViewer(parent, getTableStyle());
75
		fTableViewer.setContentProvider(fContentProvider);
76
		Table table= fTableViewer.getTable();
77
		fTableViewer.setLabelProvider(fLabelProvider);
78
		fTableViewer.setInput(fInput);
79
		GridData gd= new GridData(GridData.FILL_BOTH);
80
		gd.heightHint= convertHeightInCharsToPixels(15);
81
		gd.widthHint= convertWidthInCharsToPixels(55);
82
		table.setLayoutData(gd);
83
		applyDialogFont(parent);
84
		return parent;
85
	}
86
87
	protected int getTableStyle() {
88
		return SWT.SINGLE | SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER;
89
	}
90
}
(-)ui refactoring/org/eclipse/jdt/internal/ui/refactoring/RefactoringSaveHelper.java (-2 / +2 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2000, 2008 IBM Corporation and others.
2
 * Copyright (c) 2000, 2009 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 41-50 Link Here
41
import org.eclipse.ui.IEditorPart;
41
import org.eclipse.ui.IEditorPart;
42
import org.eclipse.ui.PlatformUI;
42
import org.eclipse.ui.PlatformUI;
43
import org.eclipse.ui.actions.GlobalBuildAction;
43
import org.eclipse.ui.actions.GlobalBuildAction;
44
import org.eclipse.ui.dialogs.ListDialog;
44
45
45
import org.eclipse.jdt.internal.ui.JavaPlugin;
46
import org.eclipse.jdt.internal.ui.JavaPlugin;
46
import org.eclipse.jdt.internal.ui.javaeditor.EditorUtility;
47
import org.eclipse.jdt.internal.ui.javaeditor.EditorUtility;
47
import org.eclipse.jdt.internal.ui.refactoring.actions.ListDialog;
48
import org.eclipse.jdt.internal.ui.util.ExceptionHandler;
48
import org.eclipse.jdt.internal.ui.util.ExceptionHandler;
49
49
50
public class RefactoringSaveHelper {
50
public class RefactoringSaveHelper {

Return to bug 264356