mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-29 20:05:35 +02:00
Made Source Folder Exclusion Patterns dialog resizable.
This commit is contained in:
parent
2f0264aa6b
commit
f210364ccd
2 changed files with 44 additions and 47 deletions
|
@ -154,6 +154,5 @@ public abstract class StatusDialog extends Dialog {
|
|||
if ((shell != null) && !shell.isDisposed())
|
||||
shell.setImage(fImage);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -29,6 +29,8 @@ import org.eclipse.jface.window.Window;
|
|||
import org.eclipse.osgi.util.NLS;
|
||||
import org.eclipse.swt.SWT;
|
||||
import org.eclipse.swt.graphics.Image;
|
||||
import org.eclipse.swt.layout.FillLayout;
|
||||
import org.eclipse.swt.layout.GridData;
|
||||
import org.eclipse.swt.layout.GridLayout;
|
||||
import org.eclipse.swt.widgets.Composite;
|
||||
import org.eclipse.swt.widgets.Control;
|
||||
|
@ -58,21 +60,6 @@ import org.eclipse.cdt.internal.ui.wizards.dialogfields.ListDialogField;
|
|||
*/
|
||||
public class ExPatternDialog extends StatusDialog {
|
||||
|
||||
private static class ExPatternLabelProvider extends LabelProvider {
|
||||
|
||||
@Override
|
||||
public Image getImage(Object element) {
|
||||
ImageDescriptorRegistry registry= CUIPlugin.getImageDescriptorRegistry();
|
||||
return registry.get(CPluginImages.DESC_OBJS_EXCLUSION_FILTER_ATTRIB);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getText(Object element) {
|
||||
return (String) element;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private ListDialogField<String> fExclusionPatternList;
|
||||
private IProject fCurrProject;
|
||||
private IPath[] pattern;
|
||||
|
@ -84,7 +71,6 @@ public class ExPatternDialog extends StatusDialog {
|
|||
private static final int IDX_EDIT= 2;
|
||||
private static final int IDX_REMOVE= 4;
|
||||
|
||||
|
||||
public ExPatternDialog(Shell parent, IPath[] _data, IPath _path, IProject proj) {
|
||||
super(parent);
|
||||
fCurrProject = proj;
|
||||
|
@ -92,7 +78,8 @@ public class ExPatternDialog extends StatusDialog {
|
|||
path = _path;
|
||||
setTitle(CPathEntryMessages.ExclusionPatternDialog_title);
|
||||
|
||||
String label= NLS.bind(CPathEntryMessages.ExclusionPatternDialog_pattern_label, path.makeRelative().toString());
|
||||
String label= NLS.bind(CPathEntryMessages.ExclusionPatternDialog_pattern_label,
|
||||
path.makeRelative().toString());
|
||||
|
||||
String[] buttonLabels= new String[] {
|
||||
CPathEntryMessages.ExclusionPatternDialog_pattern_add,
|
||||
|
@ -124,16 +111,15 @@ public class ExPatternDialog extends StatusDialog {
|
|||
fExclusionPatternList.enableButton(IDX_ADD_MULTIPLE, fCurrSourceFolder != null);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected Control createDialogArea(Composite parent) {
|
||||
Composite composite= (Composite)super.createDialogArea(parent);
|
||||
Composite composite= (Composite) super.createDialogArea(parent);
|
||||
|
||||
Composite inner= new Composite(composite, SWT.NONE);
|
||||
GridLayout layout= new GridLayout();
|
||||
inner.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
|
||||
GridLayout layout= new GridLayout(2, false);
|
||||
layout.marginHeight= 0;
|
||||
layout.marginWidth= 0;
|
||||
layout.numColumns= 2;
|
||||
inner.setLayout(layout);
|
||||
|
||||
fExclusionPatternList.doFillIntoGrid(inner, 3);
|
||||
|
@ -188,35 +174,12 @@ public class ExPatternDialog extends StatusDialog {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
// -------- ExclusionPatternAdapter --------
|
||||
|
||||
private class ExclusionPatternAdapter implements IListAdapter<String>, IDialogFieldListener {
|
||||
public void customButtonPressed(ListDialogField<String> field, int index) {
|
||||
doCustomButtonPressed(field, index);
|
||||
}
|
||||
|
||||
public void selectionChanged(ListDialogField<String> field) {
|
||||
doSelectionChanged(field);
|
||||
}
|
||||
|
||||
public void doubleClicked(ListDialogField<String> field) {
|
||||
doDoubleClicked(field);
|
||||
}
|
||||
|
||||
public void dialogFieldChanged(DialogField field) {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
protected void doStatusLineUpdate() {
|
||||
}
|
||||
|
||||
protected void checkIfPatternValid() {
|
||||
}
|
||||
|
||||
|
||||
public IPath[] getExclusionPattern() {
|
||||
IPath[] res= new IPath[fExclusionPatternList.getSize()];
|
||||
for (int i= 0; i < res.length; i++) {
|
||||
|
@ -235,6 +198,11 @@ public class ExPatternDialog extends StatusDialog {
|
|||
// WorkbenchHelp.setHelp(newShell, ICHelpContextIds.EXCLUSION_PATTERN_DIALOG);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean isResizable() {
|
||||
return true;
|
||||
}
|
||||
|
||||
private void addMultipleEntries() {
|
||||
Class<?>[] acceptedClasses= new Class<?>[] { IFolder.class, IFile.class };
|
||||
ISelectionStatusValidator validator= new TypedElementSelectionValidator(acceptedClasses, true);
|
||||
|
@ -272,4 +240,34 @@ public class ExPatternDialog extends StatusDialog {
|
|||
}
|
||||
}
|
||||
|
||||
private static class ExPatternLabelProvider extends LabelProvider {
|
||||
|
||||
@Override
|
||||
public Image getImage(Object element) {
|
||||
ImageDescriptorRegistry registry= CUIPlugin.getImageDescriptorRegistry();
|
||||
return registry.get(CPluginImages.DESC_OBJS_EXCLUSION_FILTER_ATTRIB);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getText(Object element) {
|
||||
return (String) element;
|
||||
}
|
||||
}
|
||||
|
||||
private class ExclusionPatternAdapter implements IListAdapter<String>, IDialogFieldListener {
|
||||
public void customButtonPressed(ListDialogField<String> field, int index) {
|
||||
doCustomButtonPressed(field, index);
|
||||
}
|
||||
|
||||
public void selectionChanged(ListDialogField<String> field) {
|
||||
doSelectionChanged(field);
|
||||
}
|
||||
|
||||
public void doubleClicked(ListDialogField<String> field) {
|
||||
doDoubleClicked(field);
|
||||
}
|
||||
|
||||
public void dialogFieldChanged(DialogField field) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue