X-Git-Url: http://git.phpeclipse.com diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/ui/dialogs/CheckedTreeSelectionDialog.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/ui/dialogs/CheckedTreeSelectionDialog.java index 08dc378..deb47fc 100644 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/ui/dialogs/CheckedTreeSelectionDialog.java +++ b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/ui/dialogs/CheckedTreeSelectionDialog.java @@ -37,29 +37,41 @@ public class CheckedTreeSelectionDialog extends SelectionStatusDialog { private CheckboxTreeViewer fViewer; private ILabelProvider fLabelProvider; + private ITreeContentProvider fContentProvider; private ISelectionValidator fValidator = null; + private ViewerSorter fSorter; + private String fEmptyListMessage = "No entries available"; private IStatus fCurrStatus = new StatusInfo(); + private List fFilters; + private Object fInput; + private boolean fIsEmpty; private int fWidth = 60; + private int fHeight = 18; private boolean fContainerMode; + private Object[] fExpandedElements; /** * Constructs an instance of ElementTreeSelectionDialog. - * @param labelProvider the label provider to render the entries - * @param contentProvider the content provider to evaluate the tree structure + * + * @param labelProvider + * the label provider to render the entries + * @param contentProvider + * the content provider to evaluate the tree structure */ - public CheckedTreeSelectionDialog(Shell parent, ILabelProvider labelProvider, ITreeContentProvider contentProvider) { + public CheckedTreeSelectionDialog(Shell parent, + ILabelProvider labelProvider, ITreeContentProvider contentProvider) { super(parent); fLabelProvider = labelProvider; @@ -76,18 +88,21 @@ public class CheckedTreeSelectionDialog extends SelectionStatusDialog { } /** - * If set, the checked /gray state of containers (inner nodes) is derived from the checked state of its - * leaf nodes. - * @param containerMode The containerMode to set + * If set, the checked /gray state of containers (inner nodes) is derived + * from the checked state of its leaf nodes. + * + * @param containerMode + * The containerMode to set */ public void setContainerMode(boolean containerMode) { fContainerMode = containerMode; } /** - * Sets the initial selection. - * Convenience method. - * @param selection the initial selection. + * Sets the initial selection. Convenience method. + * + * @param selection + * the initial selection. */ public void setInitialSelection(Object selection) { setInitialSelections(new Object[] { selection }); @@ -95,7 +110,9 @@ public class CheckedTreeSelectionDialog extends SelectionStatusDialog { /** * Sets the message to be displayed if the list is empty. - * @param message the message to be displayed. + * + * @param message + * the message to be displayed. */ public void setEmptyListMessage(String message) { fEmptyListMessage = message; @@ -110,7 +127,9 @@ public class CheckedTreeSelectionDialog extends SelectionStatusDialog { /** * Adds a filter to the tree viewer. - * @param filter a filter. + * + * @param filter + * a filter. */ public void addFilter(ViewerFilter filter) { if (fFilters == null) @@ -120,9 +139,11 @@ public class CheckedTreeSelectionDialog extends SelectionStatusDialog { } /** - * Sets an optional validator to check if the selection is valid. - * The validator is invoked whenever the selection changes. - * @param validator the validator to validate the selection. + * Sets an optional validator to check if the selection is valid. The + * validator is invoked whenever the selection changes. + * + * @param validator + * the validator to validate the selection. */ public void setValidator(ISelectionValidator validator) { fValidator = validator; @@ -130,7 +151,9 @@ public class CheckedTreeSelectionDialog extends SelectionStatusDialog { /** * Sets the tree input. - * @param input the tree input. + * + * @param input + * the tree input. */ public void setInput(Object input) { fInput = input; @@ -145,8 +168,11 @@ public class CheckedTreeSelectionDialog extends SelectionStatusDialog { /** * Sets the size of the tree in unit of characters. - * @param width the width of the tree. - * @param height the height of the tree. + * + * @param width + * the width of the tree. + * @param height + * the height of the tree. */ public void setSize(int width, int height) { fWidth = width; @@ -270,7 +296,9 @@ public class CheckedTreeSelectionDialog extends SelectionStatusDialog { /** * Add the selection and deselection buttons to the dialog. - * @param composite org.eclipse.swt.widgets.Composite + * + * @param composite + * org.eclipse.swt.widgets.Composite */ private Composite createSelectionButtons(Composite composite) { @@ -278,21 +306,26 @@ public class CheckedTreeSelectionDialog extends SelectionStatusDialog { GridLayout layout = new GridLayout(); layout.numColumns = 2; buttonComposite.setLayout(layout); - GridData data = new GridData(GridData.HORIZONTAL_ALIGN_END | GridData.GRAB_HORIZONTAL); + GridData data = new GridData(GridData.HORIZONTAL_ALIGN_END + | GridData.GRAB_HORIZONTAL); data.grabExcessHorizontalSpace = true; composite.setData(data); - Button selectButton = createButton(buttonComposite, IDialogConstants.SELECT_ALL_ID, "Select &All", false); + Button selectButton = createButton(buttonComposite, + IDialogConstants.SELECT_ALL_ID, "Select &All", false); SelectionListener listener = new SelectionAdapter() { public void widgetSelected(SelectionEvent e) { - fViewer.setCheckedElements(fContentProvider.getElements(fInput)); + fViewer + .setCheckedElements(fContentProvider + .getElements(fInput)); updateOKStatus(); } }; selectButton.addSelectionListener(listener); - Button deselectButton = createButton(buttonComposite, IDialogConstants.DESELECT_ALL_ID, "&Deselect All", false); + Button deselectButton = createButton(buttonComposite, + IDialogConstants.DESELECT_ALL_ID, "&Deselect All", false); listener = new SelectionAdapter() { public void widgetSelected(SelectionEvent e) {