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 <code>ElementTreeSelectionDialog</code>.
- * @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;
}
/**
- * 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 });
/**
* 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;
/**
* Adds a filter to the tree viewer.
- * @param filter a filter.
+ *
+ * @param filter
+ * a filter.
*/
public void addFilter(ViewerFilter filter) {
if (fFilters == null)
}
/**
- * 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;
/**
* Sets the tree input.
- * @param input the tree input.
+ *
+ * @param input
+ * the tree input.
*/
public void setInput(Object input) {
fInput = input;
/**
* 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;
/**
* 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) {
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) {