private void createOptionsSection()

in org.apache.ivyde.eclipse.resolvevisualizer/src/org/apache/ivyde/eclipse/resolvevisualizer/ResolveVisualizerForm.java [231:350]


    private void createOptionsSection(Composite parent) {
        Section controls = this.toolkit.createSection(parent, Section.TITLE_BAR | Section.EXPANDED);

        controls.setText("Options");
        Composite controlComposite = new Composite(controls, SWT.NONE) {
            public Point computeSize(int hint, int hint2, boolean changed) {
                return new Point(0, 0);
            }
        };
        this.toolkit.adapt(controlComposite);
        controlComposite.setLayout(new GridLayout());

        Section autoSelectOptions = this.toolkit.createSection(controlComposite, Section.EXPANDED);
        autoSelectOptions.setText("Auto Selection");
        autoSelectOptions.setLayout(new FillLayout());
        Composite autoSelectOptionsComposite = this.toolkit.createComposite(autoSelectOptions);
        autoSelectOptionsComposite.setLayout(new TableWrapLayout());

        showShortestRootPath = this.toolkit
                .createButton(autoSelectOptionsComposite, "Shortest path to root", SWT.RADIO);
        showShortestRootPath.setLayoutData(new TableWrapData(TableWrapData.FILL));
        showShortestRootPath.setSelection(true);
        showShortestRootPath.addSelectionListener(new SelectionAdapter() {
            public void widgetSelected(SelectionEvent e) {
                view.setAutoSelectDecorator(new ShortestRootPathAlgorithm());
            }
        });

        showAllRootPaths = this.toolkit.createButton(autoSelectOptionsComposite, "All paths to root", SWT.RADIO);
        showAllRootPaths.setLayoutData(new TableWrapData(TableWrapData.FILL));
        showAllRootPaths.addSelectionListener(new SelectionAdapter() {
            public void widgetSelected(SelectionEvent e) {
                view.setAutoSelectDecorator(new AllRootPathsAlgorithm());
            }
        });

        showAllCallers = this.toolkit.createButton(autoSelectOptionsComposite, "All callers", SWT.RADIO);
        showAllCallers.setLayoutData(new TableWrapData(TableWrapData.FILL));
        showAllCallers.addSelectionListener(new SelectionAdapter() {
            public void widgetSelected(SelectionEvent e) {
                view.setAutoSelectDecorator(new AllCallersAlgorithm());
            }
        });

        showAllDependencies = this.toolkit.createButton(autoSelectOptionsComposite, "All dependencies", SWT.RADIO);
        showAllDependencies.setLayoutData(new TableWrapData(TableWrapData.FILL));
        showAllDependencies.addSelectionListener(new SelectionAdapter() {
            public void widgetSelected(SelectionEvent e) {
                view.setAutoSelectDecorator(new AllDependencyAlgorithm());
            }
        });

        showSameModuleId = this.toolkit.createButton(autoSelectOptionsComposite, "Other revisions", SWT.RADIO);
        showSameModuleId.setLayoutData(new TableWrapData(TableWrapData.FILL));
        showSameModuleId.addSelectionListener(new SelectionAdapter() {
            public void widgetSelected(SelectionEvent e) {
                view.setAutoSelectDecorator(new SameModuleIdAlgorithm());
            }
        });

        autoSelectOptions.setClient(autoSelectOptionsComposite);

        Section filterOptions = this.toolkit.createSection(controlComposite, Section.EXPANDED);
        filterOptions.setText("Filter Options");
        filterOptions.setLayout(new FillLayout());
        Composite filterOptionsComposite = this.toolkit.createComposite(filterOptions);
        filterOptionsComposite.setLayout(new TableWrapLayout());

        evictionFilterEnablement = this.toolkit.createButton(filterOptionsComposite, "Hide evicted nodes", SWT.CHECK);
        evictionFilterEnablement.setLayoutData(new TableWrapData(TableWrapData.FILL));
        evictionFilterEnablement.setSelection(true);
        evictionFilter.setEnabled(true);
        evictionFilterEnablement.addSelectionListener(new SelectionAdapter() {
            public void widgetSelected(SelectionEvent e) {
                if (evictionFilterEnablement.getSelection()) {
                    evictionFilter.setEnabled(true);
                } else {
                    evictionFilter.setEnabled(false);
                }
                view.refresh();
            }
        });

        depthLimitFilterEnablement = this.toolkit.createButton(filterOptionsComposite, "Limit depth", SWT.CHECK);
        depthLimitFilterEnablement.setLayoutData(new TableWrapData(TableWrapData.FILL));
        depthLimitFilterEnablement.addSelectionListener(new SelectionAdapter() {
            public void widgetSelected(SelectionEvent e) {
                if (depthLimitFilterEnablement.getSelection()) {
                    depthFilter.setDepth(depthLimit.getSelection());
                    depthFilter.setEnabled(true);
                    view.refresh();
                    depthLimit.setEnabled(true);
                } else {
                    depthFilter.setEnabled(false);
                    view.refresh();
                    depthLimit.setEnabled(false);
                }
            }
        });

        depthLimit = new Spinner(filterOptionsComposite, 0);
        toolkit.adapt(depthLimit);
        depthLimit.setMinimum(1);
        depthLimit.setSelection(2);
        depthLimit.setIncrement(1);
        depthLimit.setSize(150, 40);
        depthLimit.setBackground(new Color(Display.getDefault(), 216, 228, 248));
        depthLimit.setEnabled(false);
        depthLimit.addModifyListener(new ModifyListener() {
            public void modifyText(ModifyEvent e) {
                depthFilter.setDepth(depthLimit.getSelection());
                depthFilter.setEnabled(true);
                view.refresh();
            }
        });

        filterOptions.setClient(filterOptionsComposite);

        controls.setClient(controlComposite);
    }