Example usage for org.eclipse.jface.viewers TableViewer TableViewer

List of usage examples for org.eclipse.jface.viewers TableViewer TableViewer

Introduction

In this page you can find the example usage for org.eclipse.jface.viewers TableViewer TableViewer.

Prototype

public TableViewer(Table table) 

Source Link

Document

Creates a table viewer on the given table control.

Usage

From source file:aspectminingtool.views.FlowGraph.ViewPartFlowGraph.java

License:Open Source License

public void createTab4() {

    {//from w ww  .  j  av a  2s . c  o  m
        sashForm4 = new SashForm(cTabFolderFlowGraph, SWT.NONE);
        cTabItemInsideLastExecution.setControl(sashForm4);
        sashForm4.setSize(60, 30);
        {

            composite7 = new Composite(sashForm4, SWT.NULL);
            GridLayout composite7Layout = new GridLayout();
            composite7Layout.makeColumnsEqualWidth = true;
            composite7Layout.marginHeight = 0;
            composite7Layout.marginWidth = 0;
            composite7Layout.verticalSpacing = 0;
            composite7.setLayout(composite7Layout);
            composite7.setBounds(-483, -25, 461, 81);

            tableLeftTab4 = new Table(composite7, SWT.BORDER | SWT.MULTI);
            tablesVLeft[3] = new TableViewer(tableLeftTab4);

            filterUmbral4 = new FilterFanInUmbral(new Integer(1));
            tablesVLeft[3].addFilter(filterUmbral4);
            filterGetSetter4 = new FilterGettterSetter(true);
            tablesVLeft[3].addFilter(filterGetSetter4);

            // Set the sorter
            ViewerSorter sorter = new SorterFlowGraphTab4Left();
            tablesVLeft[3].setSorter(sorter);

            // Set the content and label providers ACA tienen que ir tus contentsProviders!
            tablesVLeft[3].setContentProvider(new FlowGraphContentProviderIL());
            tablesVLeft[3].setLabelProvider(new FlowGraphLabelProviderIL());

            // Set up the table, each column has a listener for the click
            // that calls
            // the sorter and refreshes the tree.
            // Column 1
            final TableColumn tc31 = new TableColumn(tableLeftTab4, SWT.LEFT);
            tc31.setText("Method");
            tc31.setWidth(398);
            tc31.addSelectionListener(new org.eclipse.swt.events.SelectionAdapter() {
                public void widgetSelected(SelectionEvent event) {
                    ((SorterFlowGraphTab4Left) tablesVLeft[3].getSorter()).doSort(0);
                    tablesVLeft[3].refresh();
                }
            });

            // Column 2
            TableColumn tc32 = new TableColumn(tableLeftTab4, SWT.LEFT);
            tc32.setText("Value");
            tc32.setWidth(50);
            tc32.addSelectionListener(new org.eclipse.swt.events.SelectionAdapter() {
                public void widgetSelected(SelectionEvent event) {
                    ((SorterFlowGraphTab4Left) tablesVLeft[3].getSorter()).doSort(1);
                    tablesVLeft[3].refresh();
                }
            });

            tableLeftTab4.setHeaderVisible(true);
            GridData tableLeftTab4LData = new GridData();
            tableLeftTab4LData.verticalAlignment = GridData.FILL;
            tableLeftTab4LData.grabExcessVerticalSpace = true;
            tableLeftTab4LData.horizontalAlignment = GridData.FILL;
            tableLeftTab4LData.grabExcessHorizontalSpace = true;
            tableLeftTab4.setLayoutData(tableLeftTab4LData);
            tableLeftTab4.setLinesVisible(true);

            tablesVLeft[3].addSelectionChangedListener(new ISelectionChangedListener() {
                public void selectionChanged(SelectionChangedEvent event) {
                    selectionItemTab4(event);

                }

            });

            tablesVLeft[3].addDoubleClickListener(new OpenClassListener(this));

            {
                GridData composite12LData = new GridData();
                composite12LData.verticalAlignment = GridData.FILL;
                composite12LData.horizontalAlignment = GridData.FILL;
                composite12 = new Composite(composite7, SWT.NONE);
                GridLayout composite12Layout = new GridLayout();
                composite12Layout.numColumns = 3;
                composite12.setLayout(composite12Layout);
                composite12.setLayoutData(composite12LData);

                {
                    labelSearch4 = new CLabel(composite12, SWT.NONE);
                    GridData labelSearch4Data = new GridData();
                    labelSearch4Data.horizontalIndent = -5;
                    labelSearch4Data.widthHint = 47;
                    labelSearch4Data.heightHint = 21;
                    labelSearch4.setLayoutData(labelSearch4Data);
                    labelSearch4.setText("Search:");

                }
                {
                    textSearch4 = new Text(composite12, SWT.BORDER);
                    GridData textSearch4Data = new GridData();
                    textSearch4Data.widthHint = 179;
                    textSearch4Data.heightHint = 15;
                    textSearch4.setLayoutData(textSearch4Data);
                    textSearch4.setText("");
                }
                {
                    buttonSearch4 = new Button(composite12, SWT.PUSH | SWT.CENTER);
                    GridData buttonSearch3LData = new GridData();
                    buttonSearch4.setLayoutData(buttonSearch3LData);
                    buttonSearch4.setText("Search");

                    buttonSearch4.addListener(SWT.Selection, new Listener() {
                        public void handleEvent(Event event) {
                            searchInTableLeftTab3.locateItemInTable(textSearch4.getText().toLowerCase(),
                                    tableLeftTab4);

                        }
                    });

                }
            }

        }
        {
            composite8 = new Composite(sashForm4, SWT.NONE);
            FillLayout composite8Layout = new FillLayout(org.eclipse.swt.SWT.HORIZONTAL);
            composite8.setLayout(composite8Layout);
            composite8.setBounds(0, 0, 77, 81);
            {
                tableRightTab4 = new Table(composite8, SWT.LEFT | SWT.MULTI);
                tablesVRight[3] = new TableViewer(tableRightTab4);

                // Set the sorter
                ViewerSorter sorterCalls = new SorterFlowGraphTableRight();
                tablesVRight[3].setSorter(sorterCalls);

                // Set the content and label providers ACA tienen que ir tus contentsProviders DE LA SEGUNDA TABLA!
                tablesVRight[3].setContentProvider(new FlowGraphContentProviderOBCalls());
                tablesVRight[3].setLabelProvider(new FlowGraphLabelProviderOBCalls());

                {
                    TableColumn tableRightColumn1 = new TableColumn(tableRightTab4, SWT.NONE);
                    tableRightColumn1.setText("Calls");
                    tableRightColumn1.setWidth(300);
                    tableRightColumn1.addSelectionListener(new org.eclipse.swt.events.SelectionAdapter() {
                        public void widgetSelected(SelectionEvent event) {
                            ((SorterFlowGraphTableRight) tablesVRight[3].getSorter()).doSort(0);
                            tablesVRight[3].refresh();
                        }
                    });
                }

                tableRightTab4.setHeaderVisible(true);

            }
        }
    }
}

From source file:aspectminingtool.views.RedirectorFinder.ViewPartRedirectorFinder.java

License:Open Source License

private void createLeftTableViewer() {
    tableViewerLeft = new TableViewer(tableLeft);

    // Set the sorter
    ViewerSorter sorterCalls = new SorterRedFinderClasses();
    tableViewerLeft.setSorter(sorterCalls);

    // Set the content and label providers
    tableViewerLeft.setContentProvider(new RedirectorFinderContentProvider());
    tableViewerLeft.setLabelProvider(new RedirectorFinderLabelProvider());

    tableViewerLeft.addSelectionChangedListener(new ISelectionChangedListener() {

        @Override// w  w w.j av a 2  s .c om
        public void selectionChanged(SelectionChangedEvent event) {
            selectionItem(event);

        }

    });

    tableViewerLeft.addDoubleClickListener(new OpenClassListener(this));

    filterUmbral1 = new FilterRedirQuantity(new Integer(1));
    tableViewerLeft.addFilter(filterUmbral1);

    filterUmbral2 = new FilterRedirPercent(new Double(40));
    tableViewerLeft.addFilter(filterUmbral2);

}

From source file:aspectminingtool.views.RedirectorFinder.ViewPartRedirectorFinder.java

License:Open Source License

private void createTableViewerRight() {

    tableViewerRight = new TableViewer(tableRight);

    // Set the content and label providers
    tableViewerRight.setContentProvider(new CallsContentProviderFanIn());
    tableViewerRight.setLabelProvider(new CallsLabelProviderRedirMethod());

    tableViewerRight.addDoubleClickListener(new OpenClassListener(this));

    tableViewerRight.setSorter(new SorterRedirecFinderCalls());

}

From source file:aspectminingtool.views.RedirectorFinderSeeds.ViewPartClassesSeeds.java

License:Open Source License

/**
 * Create the Methods TableViewer/*  ww  w .j  av a 2  s .  c o  m*/
 */
private void createTableViewerLeft() {

    tableViewerLeft = new TableViewer(tableLeft);
    tableViewerLeft.setUseHashlookup(true);

    tableViewerLeft.setColumnProperties(columnNamesMethodsTable);

    // Set the sorter
    ViewerSorter sorter = new SorterClassSeedsDescriptionView();
    tableViewerLeft.setSorter(sorter);

    // Create the cell editors
    CellEditor[] editors = new CellEditor[columnNamesMethodsTable.length];
    // Column 1 : nombre del mtodo
    editors[0] = null;
    //Column 2: Algoritmo
    editors[1] = null;
    // Column 3 : Description
    TextCellEditor textEditor = new TextCellEditor(tableLeft);
    editors[2] = textEditor;

    // Assign the cell editors to the viewer
    tableViewerLeft.setCellEditors(editors);
    // Set the cell modifier for the viewer
    tableViewerLeft.setCellModifier(new CellModifierSeedClassDescription(this));

    tableViewerLeft.addSelectionChangedListener(new ISelectionChangedListener() {
        public void selectionChanged(SelectionChangedEvent event) {
            selectionItem(event);

        }

    });

    tableViewerLeft.addDoubleClickListener(new OpenClassListener(this));

    tableViewerLeft.setContentProvider(new ContentProviderSeedsDescription());
    tableViewerLeft.setLabelProvider(new LabelProviderSeedsClassDescription());

    // The input for the table viewer is the instance of ExampleTaskList
    model = new SeedsClassGeneralModel();
    tableViewerLeft.setInput(model);
}

From source file:aspectminingtool.views.RedirectorFinderSeeds.ViewPartClassesSeeds.java

License:Open Source License

private void createCallsTableViewerRight() {

    tableViewerRight = new TableViewer(tableRight);
    tableViewerRight.setUseHashlookup(true);

    tableViewerRight.setColumnProperties(columnNamesCallsTable);

    // Set the sorter
    ViewerSorter sorter = new SorterRelatedCallCountedDescription();
    tableViewerRight.setSorter(sorter);/*from   w w  w. ja  va  2s.  c  o  m*/

    // Create the cell editors
    CellEditor[] editors = new CellEditor[columnNamesCallsTable.length];
    // Column 0 : Imagen
    String[] s = new String[2];
    s[0] = "yes";
    s[1] = "no";
    editors[0] = new ComboBoxCellEditor(tableRight, s, SWT.READ_ONLY);
    // Column 1 : Call
    editors[1] = null;
    // Column 2 : Description (Free text)
    TextCellEditor textEditor = new TextCellEditor(tableRight);
    editors[2] = textEditor;

    // Assign the cell editors to the viewer
    tableViewerRight.setCellEditors(editors);
    // Set the cell modifier for the viewer
    tableViewerRight.setCellModifier(new CellModifierRelatedCallCounted(this));

    tableViewerRight.setContentProvider(new ContentProviderRelatedMethodsSeeds());
    tableViewerRight.setLabelProvider(new LabelProviderRelatedCallCounted());

    tableViewerRight.addDoubleClickListener(new OpenClassListener(this));

}

From source file:aspectminingtool.views.SeedsGeneral.ViewPartSeeds.java

License:Open Source License

/**
 * Create the Methods TableViewer/* w  w w . j a  v  a 2 s .  c o  m*/
 */
private void createTableViewerLeft() {

    tableViewerLeft = new TableViewer(tableLeft);
    tableViewerLeft.setUseHashlookup(true);

    tableViewerLeft.setColumnProperties(columnNamesMethodsTable);

    // Set the sorter
    ViewerSorter sorter = new SorterSeedsDescriptionView();
    tableViewerLeft.setSorter(sorter);

    // Create the cell editors
    CellEditor[] editors = new CellEditor[columnNamesMethodsTable.length];
    // Column 1 : nombre del mtodo
    editors[0] = null;
    //Column 2: Algoritmo
    editors[1] = null;
    // Column 3 : Description
    TextCellEditor textEditor = new TextCellEditor(tableLeft);
    editors[2] = textEditor;

    // Assign the cell editors to the viewer
    tableViewerLeft.setCellEditors(editors);
    // Set the cell modifier for the viewer
    tableViewerLeft.setCellModifier(new CellModifierSeedDescription(this));

    tableViewerLeft.addSelectionChangedListener(new ISelectionChangedListener() {
        public void selectionChanged(SelectionChangedEvent event) {
            selectionItem(event);

        }

    });

    tableViewerLeft.addDoubleClickListener(new OpenClassListener(this));

    tableViewerLeft.setContentProvider(new ContentProviderSeedsDescription());
    tableViewerLeft.setLabelProvider(new LabelProviderSeedsDescription());

    // The input for the table viewer is the instance of ExampleTaskList
    model = new SeedsGeneralModel();
    tableViewerLeft.setInput(model);
}

From source file:aspectminingtool.views.SeedsGeneral.ViewPartSeeds.java

License:Open Source License

private void createCallsTableViewerRight() {

    tableViewerRight = new TableViewer(tableRight);
    tableViewerRight.setUseHashlookup(true);

    tableViewerRight.setColumnProperties(columnNamesCallsTable);

    // Set the sorter
    ViewerSorter sorter = new SorterRelatedMethodsDescription();
    tableViewerRight.setSorter(sorter);/*w  ww. j ava2s .  c  o  m*/

    // Create the cell editors
    CellEditor[] editors = new CellEditor[columnNamesCallsTable.length];
    // Column 0 : Imagen
    String[] s = new String[2];
    s[0] = "yes";
    s[1] = "no";
    editors[0] = new ComboBoxCellEditor(tableRight, s, SWT.READ_ONLY);
    // Column 1 : Call
    editors[1] = null;
    // Column 2 : Description (Free text)
    TextCellEditor textEditor = new TextCellEditor(tableRight);
    editors[2] = textEditor;

    // Assign the cell editors to the viewer
    tableViewerRight.setCellEditors(editors);
    // Set the cell modifier for the viewer
    tableViewerRight.setCellModifier(new CellModifierRelatedMethods(this));

    tableViewerRight.setContentProvider(new ContentProviderRelatedMethodsSeeds());
    tableViewerRight.setLabelProvider(new LabelProviderRelatedMethodsSeeds());

    tableViewerRight.addDoubleClickListener(new OpenClassListener(this));

}

From source file:aspectminingtool.views.Sinergia.Seeds.ViewPartSinergiaSeedsDesc.java

License:Open Source License

private void createLeftTableViewer() {

    tableViewerLeft = new TableViewer(tableLeft);
    tableViewerLeft.setUseHashlookup(true);
    tableViewerLeft.setColumnProperties(columnNamesMethodsTable);

    // Set the sorter
    ViewerSorter sorterCalls = new SorterSinergiaSeedsDescription();
    tableViewerLeft.setSorter(sorterCalls);

    // Create the cell editors
    CellEditor[] editors = new CellEditor[columnNamesMethodsTable.length];
    // Column 1 : nombre del mtodo
    editors[0] = null;/*from ww w .j  a  v a 2s .  com*/
    //Column 2: Algoritmo
    editors[1] = null;
    // Column 3 : Description
    TextCellEditor textEditor = new TextCellEditor(tableLeft);
    editors[2] = textEditor;

    // Assign the cell editors to the viewer
    tableViewerLeft.setCellEditors(editors);
    // Set the cell modifier for the viewer
    tableViewerLeft.setCellModifier(new CellModifierSinergiaSeedDesc(this));

    tableViewerLeft.addSelectionChangedListener(new ISelectionChangedListener() {

        @Override
        public void selectionChanged(SelectionChangedEvent event) {
            selectionItem(event);

        }

    });

    tableViewerLeft.addDoubleClickListener(new OpenClassListener(this));

    // Set the content and label providers
    tableViewerLeft.setContentProvider(new SinergiaSeedsDescContentProvider());
    tableViewerLeft.setLabelProvider(new SinergiaSeedsDescLabelProvider());

    model = new SinergiaDescriptionResultsModel();
    tableViewerLeft.setInput(model);

}

From source file:aspectminingtool.views.Sinergia.Seeds.ViewPartSinergiaSeedsDesc.java

License:Open Source License

private void createTableViewerRight() {

    tableViewerRight = new TableViewer(tableRight);

    // Set the content and label providers
    tableViewerRight.setLabelProvider(new SinergiaAlgorithmSeedsDescLabelProvider());
    tableViewerRight.setContentProvider(new SinergiaAlgorithmsSeedsDescContentProvider());

    tableViewerRight.setSorter(new SorterSinergiaAlgorithmsDescSeeds());

}

From source file:aspectminingtool.views.Sinergia.ViewPartSinergia.java

License:Open Source License

private void createLeftTableViewer() {
    tableViewerLeft = new TableViewer(tableLeft);

    // Set the sorter
    ViewerSorter sorterCalls = new SorterSinergiaSeeds();
    tableViewerLeft.setSorter(sorterCalls);

    // Set the content and label providers
    tableViewerLeft.setContentProvider(new SinergiaSeedsContentProvider());
    tableViewerLeft.setLabelProvider(new SinergiaSeedsLabelProvider());

    tableViewerLeft.addSelectionChangedListener(new ISelectionChangedListener() {

        @Override// w  ww.j av  a  2 s.  c  o  m
        public void selectionChanged(SelectionChangedEvent event) {
            selectionItem(event);

        }

    });

    tableViewerLeft.addDoubleClickListener(new OpenClassListener(this));
}