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

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

Introduction

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

Prototype

ITableLabelProvider

Source Link

Usage

From source file:org.eclipse.emf.eef.eefnr.parts.forms.TableCompositionEditorSamplePropertiesEditionPartForm.java

License:Open Source License

/**
 * @param container/*w  w w.j  a  v a2  s .  c om*/
 * 
 */
protected Composite createTablecompositionRequiredPropertyTableComposition(FormToolkit widgetFactory,
        Composite container) {
    Composite tableContainer = widgetFactory.createComposite(container, SWT.NONE);
    GridLayout tableContainerLayout = new GridLayout();
    GridData tableContainerData = new GridData(GridData.FILL_BOTH);
    tableContainerData.horizontalSpan = 3;
    tableContainer.setLayoutData(tableContainerData);
    tableContainerLayout.numColumns = 2;
    tableContainer.setLayout(tableContainerLayout);
    org.eclipse.swt.widgets.Table tableTablecompositionRequiredProperty = widgetFactory
            .createTable(tableContainer, SWT.FULL_SELECTION | SWT.BORDER);
    tableTablecompositionRequiredProperty.setHeaderVisible(true);
    GridData gdTablecompositionRequiredProperty = new GridData();
    gdTablecompositionRequiredProperty.grabExcessHorizontalSpace = true;
    gdTablecompositionRequiredProperty.horizontalAlignment = GridData.FILL;
    gdTablecompositionRequiredProperty.grabExcessVerticalSpace = true;
    gdTablecompositionRequiredProperty.verticalAlignment = GridData.FILL;
    tableTablecompositionRequiredProperty.setLayoutData(gdTablecompositionRequiredProperty);
    tableTablecompositionRequiredProperty.setLinesVisible(true);

    // Start of user code for columns definition for TablecompositionRequiredProperty
    TableColumn name = new TableColumn(tableTablecompositionRequiredProperty, SWT.NONE);
    name.setWidth(80);
    name.setText("Label"); //$NON-NLS-1$

    // End of user code

    tablecompositionRequiredProperty = new TableViewer(tableTablecompositionRequiredProperty);
    tablecompositionRequiredProperty.setContentProvider(new ArrayContentProvider());
    tablecompositionRequiredProperty.setLabelProvider(new ITableLabelProvider() {
        //Start of user code for label provider definition for TablecompositionRequiredProperty
        public String getColumnText(Object object, int columnIndex) {
            AdapterFactoryLabelProvider labelProvider = new AdapterFactoryLabelProvider(adapterFactory);
            if (object instanceof EObject) {
                switch (columnIndex) {
                case 0:
                    return labelProvider.getText(object);
                }
            }
            return ""; //$NON-NLS-1$
        }

        public Image getColumnImage(Object element, int columnIndex) {
            return null;
        }

        //End of user code

        public void addListener(ILabelProviderListener listener) {
        }

        public void dispose() {
        }

        public boolean isLabelProperty(Object element, String property) {
            return false;
        }

        public void removeListener(ILabelProviderListener listener) {
        }

    });
    tablecompositionRequiredProperty.getTable().addListener(SWT.MouseDoubleClick, new Listener() {

        public void handleEvent(Event event) {
            if (tablecompositionRequiredProperty.getSelection() instanceof IStructuredSelection) {
                IStructuredSelection selection = (IStructuredSelection) tablecompositionRequiredProperty
                        .getSelection();
                if (selection.getFirstElement() instanceof EObject) {
                    propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(
                            TableCompositionEditorSamplePropertiesEditionPartForm.this,
                            EefnrViewsRepository.TableCompositionEditorSample.Properties.tablecompositionRequiredProperty,
                            PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.EDIT, null,
                            selection.getFirstElement()));
                    tablecompositionRequiredProperty.refresh();
                }
            }
        }

    });
    GridData tablecompositionRequiredPropertyData = new GridData(GridData.FILL_HORIZONTAL);
    tablecompositionRequiredPropertyData.minimumHeight = 120;
    tablecompositionRequiredPropertyData.heightHint = 120;
    tablecompositionRequiredProperty.getTable().setLayoutData(tablecompositionRequiredPropertyData);
    for (ViewerFilter filter : this.tablecompositionRequiredPropertyFilters) {
        tablecompositionRequiredProperty.addFilter(filter);
    }
    EditingUtils.setID(tablecompositionRequiredProperty.getTable(),
            EefnrViewsRepository.TableCompositionEditorSample.Properties.tablecompositionRequiredProperty);
    EditingUtils.setEEFtype(tablecompositionRequiredProperty.getTable(), "eef::TableComposition::field"); //$NON-NLS-1$
    createTablecompositionRequiredPropertyPanel(widgetFactory, tableContainer);
    return container;
}

From source file:org.eclipse.emf.eef.eefnr.parts.forms.TableCompositionEditorSamplePropertiesEditionPartForm.java

License:Open Source License

/**
 * @param container//from ww  w. j  a  v  a  2s .co m
 * 
 */
protected Composite createTablecompositionOptionalPropertyTableComposition(FormToolkit widgetFactory,
        Composite container) {
    Composite tableContainer = widgetFactory.createComposite(container, SWT.NONE);
    GridLayout tableContainerLayout = new GridLayout();
    GridData tableContainerData = new GridData(GridData.FILL_BOTH);
    tableContainerData.horizontalSpan = 3;
    tableContainer.setLayoutData(tableContainerData);
    tableContainerLayout.numColumns = 2;
    tableContainer.setLayout(tableContainerLayout);
    org.eclipse.swt.widgets.Table tableTablecompositionOptionalProperty = widgetFactory
            .createTable(tableContainer, SWT.FULL_SELECTION | SWT.BORDER);
    tableTablecompositionOptionalProperty.setHeaderVisible(true);
    GridData gdTablecompositionOptionalProperty = new GridData();
    gdTablecompositionOptionalProperty.grabExcessHorizontalSpace = true;
    gdTablecompositionOptionalProperty.horizontalAlignment = GridData.FILL;
    gdTablecompositionOptionalProperty.grabExcessVerticalSpace = true;
    gdTablecompositionOptionalProperty.verticalAlignment = GridData.FILL;
    tableTablecompositionOptionalProperty.setLayoutData(gdTablecompositionOptionalProperty);
    tableTablecompositionOptionalProperty.setLinesVisible(true);

    // Start of user code for columns definition for TablecompositionOptionalProperty
    TableColumn name = new TableColumn(tableTablecompositionOptionalProperty, SWT.NONE);
    name.setWidth(80);
    name.setText("Label"); //$NON-NLS-1$

    // End of user code

    tablecompositionOptionalProperty = new TableViewer(tableTablecompositionOptionalProperty);
    tablecompositionOptionalProperty.setContentProvider(new ArrayContentProvider());
    tablecompositionOptionalProperty.setLabelProvider(new ITableLabelProvider() {
        //Start of user code for label provider definition for TablecompositionOptionalProperty
        public String getColumnText(Object object, int columnIndex) {
            AdapterFactoryLabelProvider labelProvider = new AdapterFactoryLabelProvider(adapterFactory);
            if (object instanceof EObject) {
                switch (columnIndex) {
                case 0:
                    return labelProvider.getText(object);
                }
            }
            return ""; //$NON-NLS-1$
        }

        public Image getColumnImage(Object element, int columnIndex) {
            return null;
        }

        //End of user code

        public void addListener(ILabelProviderListener listener) {
        }

        public void dispose() {
        }

        public boolean isLabelProperty(Object element, String property) {
            return false;
        }

        public void removeListener(ILabelProviderListener listener) {
        }

    });
    tablecompositionOptionalProperty.getTable().addListener(SWT.MouseDoubleClick, new Listener() {

        public void handleEvent(Event event) {
            if (tablecompositionOptionalProperty.getSelection() instanceof IStructuredSelection) {
                IStructuredSelection selection = (IStructuredSelection) tablecompositionOptionalProperty
                        .getSelection();
                if (selection.getFirstElement() instanceof EObject) {
                    propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(
                            TableCompositionEditorSamplePropertiesEditionPartForm.this,
                            EefnrViewsRepository.TableCompositionEditorSample.Properties.tablecompositionOptionalProperty,
                            PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.EDIT, null,
                            selection.getFirstElement()));
                    tablecompositionOptionalProperty.refresh();
                }
            }
        }

    });
    GridData tablecompositionOptionalPropertyData = new GridData(GridData.FILL_HORIZONTAL);
    tablecompositionOptionalPropertyData.minimumHeight = 120;
    tablecompositionOptionalPropertyData.heightHint = 120;
    tablecompositionOptionalProperty.getTable().setLayoutData(tablecompositionOptionalPropertyData);
    for (ViewerFilter filter : this.tablecompositionOptionalPropertyFilters) {
        tablecompositionOptionalProperty.addFilter(filter);
    }
    EditingUtils.setID(tablecompositionOptionalProperty.getTable(),
            EefnrViewsRepository.TableCompositionEditorSample.Properties.tablecompositionOptionalProperty);
    EditingUtils.setEEFtype(tablecompositionOptionalProperty.getTable(), "eef::TableComposition::field"); //$NON-NLS-1$
    createTablecompositionOptionalPropertyPanel(widgetFactory, tableContainer);
    return container;
}

From source file:org.eclipse.emf.eef.eefnr.parts.forms.TotalSamplePropertiesEditionPartForm.java

License:Open Source License

/**
 * @param container/*from w w w. j a va  2 s  . c o m*/
 * 
 */
protected Composite createTablecompositionRequiredPropertyTableComposition(FormToolkit widgetFactory,
        Composite container) {
    Composite tableContainer = widgetFactory.createComposite(container, SWT.NONE);
    GridLayout tableContainerLayout = new GridLayout();
    GridData tableContainerData = new GridData(GridData.FILL_BOTH);
    tableContainerData.horizontalSpan = 3;
    tableContainer.setLayoutData(tableContainerData);
    tableContainerLayout.numColumns = 2;
    tableContainer.setLayout(tableContainerLayout);
    org.eclipse.swt.widgets.Table tableTablecompositionRequiredProperty = widgetFactory
            .createTable(tableContainer, SWT.FULL_SELECTION | SWT.BORDER);
    tableTablecompositionRequiredProperty.setHeaderVisible(true);
    GridData gdTablecompositionRequiredProperty = new GridData();
    gdTablecompositionRequiredProperty.grabExcessHorizontalSpace = true;
    gdTablecompositionRequiredProperty.horizontalAlignment = GridData.FILL;
    gdTablecompositionRequiredProperty.grabExcessVerticalSpace = true;
    gdTablecompositionRequiredProperty.verticalAlignment = GridData.FILL;
    tableTablecompositionRequiredProperty.setLayoutData(gdTablecompositionRequiredProperty);
    tableTablecompositionRequiredProperty.setLinesVisible(true);

    // Start of user code for columns definition for TablecompositionRequiredProperty
    TableColumn name = new TableColumn(tableTablecompositionRequiredProperty, SWT.NONE);
    name.setWidth(80);
    name.setText("Label"); //$NON-NLS-1$

    // End of user code

    tablecompositionRequiredProperty = new TableViewer(tableTablecompositionRequiredProperty);
    tablecompositionRequiredProperty.setContentProvider(new ArrayContentProvider());
    tablecompositionRequiredProperty.setLabelProvider(new ITableLabelProvider() {
        //Start of user code for label provider definition for TablecompositionRequiredProperty
        public String getColumnText(Object object, int columnIndex) {
            AdapterFactoryLabelProvider labelProvider = new AdapterFactoryLabelProvider(adapterFactory);
            if (object instanceof EObject) {
                switch (columnIndex) {
                case 0:
                    return labelProvider.getText(object);
                }
            }
            return ""; //$NON-NLS-1$
        }

        public Image getColumnImage(Object element, int columnIndex) {
            return null;
        }

        //End of user code

        public void addListener(ILabelProviderListener listener) {
        }

        public void dispose() {
        }

        public boolean isLabelProperty(Object element, String property) {
            return false;
        }

        public void removeListener(ILabelProviderListener listener) {
        }

    });
    tablecompositionRequiredProperty.getTable().addListener(SWT.MouseDoubleClick, new Listener() {

        public void handleEvent(Event event) {
            if (tablecompositionRequiredProperty.getSelection() instanceof IStructuredSelection) {
                IStructuredSelection selection = (IStructuredSelection) tablecompositionRequiredProperty
                        .getSelection();
                if (selection.getFirstElement() instanceof EObject) {
                    propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(
                            TotalSamplePropertiesEditionPartForm.this,
                            EefnrViewsRepository.TotalSample.Properties.tablecompositionRequiredProperty,
                            PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.EDIT, null,
                            selection.getFirstElement()));
                    tablecompositionRequiredProperty.refresh();
                }
            }
        }

    });
    GridData tablecompositionRequiredPropertyData = new GridData(GridData.FILL_HORIZONTAL);
    tablecompositionRequiredPropertyData.minimumHeight = 120;
    tablecompositionRequiredPropertyData.heightHint = 120;
    tablecompositionRequiredProperty.getTable().setLayoutData(tablecompositionRequiredPropertyData);
    for (ViewerFilter filter : this.tablecompositionRequiredPropertyFilters) {
        tablecompositionRequiredProperty.addFilter(filter);
    }
    EditingUtils.setID(tablecompositionRequiredProperty.getTable(),
            EefnrViewsRepository.TotalSample.Properties.tablecompositionRequiredProperty);
    EditingUtils.setEEFtype(tablecompositionRequiredProperty.getTable(), "eef::TableComposition::field"); //$NON-NLS-1$
    createTablecompositionRequiredPropertyPanel(widgetFactory, tableContainer);
    return container;
}

From source file:org.eclipse.emf.eef.eefnr.parts.forms.TotalSamplePropertiesEditionPartForm.java

License:Open Source License

/**
 * @param container//from  ww w. j  av  a 2 s. c  o  m
 * 
 */
protected Composite createTablecompositionOptionalPropertyTableComposition(FormToolkit widgetFactory,
        Composite container) {
    Composite tableContainer = widgetFactory.createComposite(container, SWT.NONE);
    GridLayout tableContainerLayout = new GridLayout();
    GridData tableContainerData = new GridData(GridData.FILL_BOTH);
    tableContainerData.horizontalSpan = 3;
    tableContainer.setLayoutData(tableContainerData);
    tableContainerLayout.numColumns = 2;
    tableContainer.setLayout(tableContainerLayout);
    org.eclipse.swt.widgets.Table tableTablecompositionOptionalProperty = widgetFactory
            .createTable(tableContainer, SWT.FULL_SELECTION | SWT.BORDER);
    tableTablecompositionOptionalProperty.setHeaderVisible(true);
    GridData gdTablecompositionOptionalProperty = new GridData();
    gdTablecompositionOptionalProperty.grabExcessHorizontalSpace = true;
    gdTablecompositionOptionalProperty.horizontalAlignment = GridData.FILL;
    gdTablecompositionOptionalProperty.grabExcessVerticalSpace = true;
    gdTablecompositionOptionalProperty.verticalAlignment = GridData.FILL;
    tableTablecompositionOptionalProperty.setLayoutData(gdTablecompositionOptionalProperty);
    tableTablecompositionOptionalProperty.setLinesVisible(true);

    // Start of user code for columns definition for TablecompositionOptionalProperty
    TableColumn name = new TableColumn(tableTablecompositionOptionalProperty, SWT.NONE);
    name.setWidth(80);
    name.setText("Label"); //$NON-NLS-1$

    // End of user code

    tablecompositionOptionalProperty = new TableViewer(tableTablecompositionOptionalProperty);
    tablecompositionOptionalProperty.setContentProvider(new ArrayContentProvider());
    tablecompositionOptionalProperty.setLabelProvider(new ITableLabelProvider() {
        //Start of user code for label provider definition for TablecompositionOptionalProperty
        public String getColumnText(Object object, int columnIndex) {
            AdapterFactoryLabelProvider labelProvider = new AdapterFactoryLabelProvider(adapterFactory);
            if (object instanceof EObject) {
                switch (columnIndex) {
                case 0:
                    return labelProvider.getText(object);
                }
            }
            return ""; //$NON-NLS-1$
        }

        public Image getColumnImage(Object element, int columnIndex) {
            return null;
        }

        //End of user code

        public void addListener(ILabelProviderListener listener) {
        }

        public void dispose() {
        }

        public boolean isLabelProperty(Object element, String property) {
            return false;
        }

        public void removeListener(ILabelProviderListener listener) {
        }

    });
    tablecompositionOptionalProperty.getTable().addListener(SWT.MouseDoubleClick, new Listener() {

        public void handleEvent(Event event) {
            if (tablecompositionOptionalProperty.getSelection() instanceof IStructuredSelection) {
                IStructuredSelection selection = (IStructuredSelection) tablecompositionOptionalProperty
                        .getSelection();
                if (selection.getFirstElement() instanceof EObject) {
                    propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(
                            TotalSamplePropertiesEditionPartForm.this,
                            EefnrViewsRepository.TotalSample.Properties.tablecompositionOptionalProperty,
                            PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.EDIT, null,
                            selection.getFirstElement()));
                    tablecompositionOptionalProperty.refresh();
                }
            }
        }

    });
    GridData tablecompositionOptionalPropertyData = new GridData(GridData.FILL_HORIZONTAL);
    tablecompositionOptionalPropertyData.minimumHeight = 120;
    tablecompositionOptionalPropertyData.heightHint = 120;
    tablecompositionOptionalProperty.getTable().setLayoutData(tablecompositionOptionalPropertyData);
    for (ViewerFilter filter : this.tablecompositionOptionalPropertyFilters) {
        tablecompositionOptionalProperty.addFilter(filter);
    }
    EditingUtils.setID(tablecompositionOptionalProperty.getTable(),
            EefnrViewsRepository.TotalSample.Properties.tablecompositionOptionalProperty);
    EditingUtils.setEEFtype(tablecompositionOptionalProperty.getTable(), "eef::TableComposition::field"); //$NON-NLS-1$
    createTablecompositionOptionalPropertyPanel(widgetFactory, tableContainer);
    return container;
}

From source file:org.eclipse.emf.eef.eefnr.parts.impl.ReferencesTableSamplePropertiesEditionPartImpl.java

License:Open Source License

/**
 * //from ww  w .  j a v  a2s.c o m
 */
protected TableViewer createReferencestableRequiredPropertyViewer(Composite container, AdapterFactory adapter) {
    org.eclipse.swt.widgets.Table table = new org.eclipse.swt.widgets.Table(container, SWT.FULL_SELECTION);
    table.setHeaderVisible(true);
    GridData gd = new GridData();
    gd.grabExcessHorizontalSpace = true;
    gd.horizontalAlignment = GridData.FILL;
    gd.grabExcessVerticalSpace = true;
    gd.verticalAlignment = GridData.FILL;
    table.setLayoutData(gd);
    table.setLinesVisible(true);
    // Start of user code for table referencestableRequiredProperty s columns definition
    TableColumn name = new TableColumn(table, SWT.NONE);
    name.setWidth(80);
    name.setText("Label"); //$NON-NLS-1$

    // End of user code

    TableViewer result = new TableViewer(table);
    result.setLabelProvider(new ITableLabelProvider() {

        // Start of user code for table referencestableRequiredProperty label provider
        public String getColumnText(Object object, int columnIndex) {
            AdapterFactoryLabelProvider labelProvider = new AdapterFactoryLabelProvider(adapterFactory);
            if (object instanceof EObject) {
                switch (columnIndex) {
                case 0:
                    return labelProvider.getText(object);
                }
            }
            return ""; //$NON-NLS-1$
        }

        public Image getColumnImage(Object element, int columnIndex) {
            return null;
        }

        // End of user code

        public void addListener(ILabelProviderListener listener) {
        }

        public void dispose() {
        }

        public boolean isLabelProperty(Object element, String property) {
            return false;
        }

        public void removeListener(ILabelProviderListener listener) {
        }

    });
    return result;
}

From source file:org.eclipse.emf.eef.eefnr.parts.impl.ReferencesTableSamplePropertiesEditionPartImpl.java

License:Open Source License

/**
 * /*from ww w .  ja  v a  2  s . c  o  m*/
 */
protected TableViewer createReferencestableOptionalPropertyViewer(Composite container, AdapterFactory adapter) {
    org.eclipse.swt.widgets.Table table = new org.eclipse.swt.widgets.Table(container, SWT.FULL_SELECTION);
    table.setHeaderVisible(true);
    GridData gd = new GridData();
    gd.grabExcessHorizontalSpace = true;
    gd.horizontalAlignment = GridData.FILL;
    gd.grabExcessVerticalSpace = true;
    gd.verticalAlignment = GridData.FILL;
    table.setLayoutData(gd);
    table.setLinesVisible(true);
    // Start of user code for table referencestableOptionalProperty s columns definition
    TableColumn name = new TableColumn(table, SWT.NONE);
    name.setWidth(80);
    name.setText("Label"); //$NON-NLS-1$

    // End of user code

    TableViewer result = new TableViewer(table);
    result.setLabelProvider(new ITableLabelProvider() {

        // Start of user code for table referencestableOptionalProperty label provider
        public String getColumnText(Object object, int columnIndex) {
            AdapterFactoryLabelProvider labelProvider = new AdapterFactoryLabelProvider(adapterFactory);
            if (object instanceof EObject) {
                switch (columnIndex) {
                case 0:
                    return labelProvider.getText(object);
                }
            }
            return ""; //$NON-NLS-1$
        }

        public Image getColumnImage(Object element, int columnIndex) {
            return null;
        }

        // End of user code

        public void addListener(ILabelProviderListener listener) {
        }

        public void dispose() {
        }

        public boolean isLabelProperty(Object element, String property) {
            return false;
        }

        public void removeListener(ILabelProviderListener listener) {
        }

    });
    return result;
}

From source file:org.eclipse.emf.eef.eefnr.parts.impl.TableCompositionEditorSamplePropertiesEditionPartImpl.java

License:Open Source License

/**
 * @param container/*from  w w w.  j  a  v  a  2s  . c  o m*/
 * 
 */
protected Composite createTablecompositionRequiredPropertyTableComposition(Composite container) {
    Composite tableContainer = new Composite(container, SWT.NONE);
    GridLayout tableContainerLayout = new GridLayout();
    GridData tableContainerData = new GridData(GridData.FILL_BOTH);
    tableContainerData.horizontalSpan = 3;
    tableContainer.setLayoutData(tableContainerData);
    tableContainerLayout.numColumns = 2;
    tableContainer.setLayout(tableContainerLayout);
    org.eclipse.swt.widgets.Table tableTablecompositionRequiredProperty = new org.eclipse.swt.widgets.Table(
            tableContainer, SWT.FULL_SELECTION);
    tableTablecompositionRequiredProperty.setHeaderVisible(true);
    GridData gdTablecompositionRequiredProperty = new GridData();
    gdTablecompositionRequiredProperty.grabExcessHorizontalSpace = true;
    gdTablecompositionRequiredProperty.horizontalAlignment = GridData.FILL;
    gdTablecompositionRequiredProperty.grabExcessVerticalSpace = true;
    gdTablecompositionRequiredProperty.verticalAlignment = GridData.FILL;
    tableTablecompositionRequiredProperty.setLayoutData(gdTablecompositionRequiredProperty);
    tableTablecompositionRequiredProperty.setLinesVisible(true);

    // Start of user code for columns definition for TablecompositionRequiredProperty
    TableColumn name = new TableColumn(tableTablecompositionRequiredProperty, SWT.NONE);
    name.setWidth(80);
    name.setText("Label"); //$NON-NLS-1$
    // End of user code

    tablecompositionRequiredProperty = new TableViewer(tableTablecompositionRequiredProperty);
    tablecompositionRequiredProperty.setContentProvider(new ArrayContentProvider());
    tablecompositionRequiredProperty.setLabelProvider(new ITableLabelProvider() {
        //Start of user code for label provider definition for TablecompositionRequiredProperty
        public String getColumnText(Object object, int columnIndex) {
            AdapterFactoryLabelProvider labelProvider = new AdapterFactoryLabelProvider(adapterFactory);
            if (object instanceof EObject) {
                switch (columnIndex) {
                case 0:
                    return labelProvider.getText(object);
                }
            }
            return ""; //$NON-NLS-1$
        }

        public Image getColumnImage(Object element, int columnIndex) {
            return null;
        }

        //End of user code

        public void addListener(ILabelProviderListener listener) {
        }

        public void dispose() {
        }

        public boolean isLabelProperty(Object element, String property) {
            return false;
        }

        public void removeListener(ILabelProviderListener listener) {
        }

    });
    tablecompositionRequiredProperty.getTable().addListener(SWT.MouseDoubleClick, new Listener() {

        public void handleEvent(Event event) {
            if (tablecompositionRequiredProperty.getSelection() instanceof IStructuredSelection) {
                IStructuredSelection selection = (IStructuredSelection) tablecompositionRequiredProperty
                        .getSelection();
                if (selection.getFirstElement() instanceof EObject) {
                    propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(
                            TableCompositionEditorSamplePropertiesEditionPartImpl.this,
                            EefnrViewsRepository.TableCompositionEditorSample.Properties.tablecompositionRequiredProperty,
                            PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.EDIT, null,
                            selection.getFirstElement()));
                    tablecompositionRequiredProperty.refresh();
                }
            }
        }

    });
    GridData tablecompositionRequiredPropertyData = new GridData(GridData.FILL_HORIZONTAL);
    tablecompositionRequiredPropertyData.minimumHeight = 120;
    tablecompositionRequiredPropertyData.heightHint = 120;
    tablecompositionRequiredProperty.getTable().setLayoutData(tablecompositionRequiredPropertyData);
    for (ViewerFilter filter : this.tablecompositionRequiredPropertyFilters) {
        tablecompositionRequiredProperty.addFilter(filter);
    }
    EditingUtils.setID(tablecompositionRequiredProperty.getTable(),
            EefnrViewsRepository.TableCompositionEditorSample.Properties.tablecompositionRequiredProperty);
    EditingUtils.setEEFtype(tablecompositionRequiredProperty.getTable(), "eef::TableComposition::field"); //$NON-NLS-1$
    createTablecompositionRequiredPropertyPanel(tableContainer);
    return container;
}

From source file:org.eclipse.emf.eef.eefnr.parts.impl.TableCompositionEditorSamplePropertiesEditionPartImpl.java

License:Open Source License

/**
 * @param container//w  w  w.  ja v a 2  s .c  om
 * 
 */
protected Composite createTablecompositionOptionalPropertyTableComposition(Composite container) {
    Composite tableContainer = new Composite(container, SWT.NONE);
    GridLayout tableContainerLayout = new GridLayout();
    GridData tableContainerData = new GridData(GridData.FILL_BOTH);
    tableContainerData.horizontalSpan = 3;
    tableContainer.setLayoutData(tableContainerData);
    tableContainerLayout.numColumns = 2;
    tableContainer.setLayout(tableContainerLayout);
    org.eclipse.swt.widgets.Table tableTablecompositionOptionalProperty = new org.eclipse.swt.widgets.Table(
            tableContainer, SWT.FULL_SELECTION);
    tableTablecompositionOptionalProperty.setHeaderVisible(true);
    GridData gdTablecompositionOptionalProperty = new GridData();
    gdTablecompositionOptionalProperty.grabExcessHorizontalSpace = true;
    gdTablecompositionOptionalProperty.horizontalAlignment = GridData.FILL;
    gdTablecompositionOptionalProperty.grabExcessVerticalSpace = true;
    gdTablecompositionOptionalProperty.verticalAlignment = GridData.FILL;
    tableTablecompositionOptionalProperty.setLayoutData(gdTablecompositionOptionalProperty);
    tableTablecompositionOptionalProperty.setLinesVisible(true);

    // Start of user code for columns definition for TablecompositionOptionalProperty
    TableColumn name = new TableColumn(tableTablecompositionOptionalProperty, SWT.NONE);
    name.setWidth(80);
    name.setText("Label"); //$NON-NLS-1$
    // End of user code

    tablecompositionOptionalProperty = new TableViewer(tableTablecompositionOptionalProperty);
    tablecompositionOptionalProperty.setContentProvider(new ArrayContentProvider());
    tablecompositionOptionalProperty.setLabelProvider(new ITableLabelProvider() {
        //Start of user code for label provider definition for TablecompositionOptionalProperty
        public String getColumnText(Object object, int columnIndex) {
            AdapterFactoryLabelProvider labelProvider = new AdapterFactoryLabelProvider(adapterFactory);
            if (object instanceof EObject) {
                switch (columnIndex) {
                case 0:
                    return labelProvider.getText(object);
                }
            }
            return ""; //$NON-NLS-1$
        }

        public Image getColumnImage(Object element, int columnIndex) {
            return null;
        }

        //End of user code

        public void addListener(ILabelProviderListener listener) {
        }

        public void dispose() {
        }

        public boolean isLabelProperty(Object element, String property) {
            return false;
        }

        public void removeListener(ILabelProviderListener listener) {
        }

    });
    tablecompositionOptionalProperty.getTable().addListener(SWT.MouseDoubleClick, new Listener() {

        public void handleEvent(Event event) {
            if (tablecompositionOptionalProperty.getSelection() instanceof IStructuredSelection) {
                IStructuredSelection selection = (IStructuredSelection) tablecompositionOptionalProperty
                        .getSelection();
                if (selection.getFirstElement() instanceof EObject) {
                    propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(
                            TableCompositionEditorSamplePropertiesEditionPartImpl.this,
                            EefnrViewsRepository.TableCompositionEditorSample.Properties.tablecompositionOptionalProperty,
                            PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.EDIT, null,
                            selection.getFirstElement()));
                    tablecompositionOptionalProperty.refresh();
                }
            }
        }

    });
    GridData tablecompositionOptionalPropertyData = new GridData(GridData.FILL_HORIZONTAL);
    tablecompositionOptionalPropertyData.minimumHeight = 120;
    tablecompositionOptionalPropertyData.heightHint = 120;
    tablecompositionOptionalProperty.getTable().setLayoutData(tablecompositionOptionalPropertyData);
    for (ViewerFilter filter : this.tablecompositionOptionalPropertyFilters) {
        tablecompositionOptionalProperty.addFilter(filter);
    }
    EditingUtils.setID(tablecompositionOptionalProperty.getTable(),
            EefnrViewsRepository.TableCompositionEditorSample.Properties.tablecompositionOptionalProperty);
    EditingUtils.setEEFtype(tablecompositionOptionalProperty.getTable(), "eef::TableComposition::field"); //$NON-NLS-1$
    createTablecompositionOptionalPropertyPanel(tableContainer);
    return container;
}

From source file:org.eclipse.emf.eef.eefnr.parts.impl.TotalSamplePropertiesEditionPartImpl.java

License:Open Source License

/**
 * @param container//from  ww  w  . j  a va2s  .  c om
 * 
 */
protected Composite createTablecompositionRequiredPropertyTableComposition(Composite container) {
    Composite tableContainer = new Composite(container, SWT.NONE);
    GridLayout tableContainerLayout = new GridLayout();
    GridData tableContainerData = new GridData(GridData.FILL_BOTH);
    tableContainerData.horizontalSpan = 3;
    tableContainer.setLayoutData(tableContainerData);
    tableContainerLayout.numColumns = 2;
    tableContainer.setLayout(tableContainerLayout);
    org.eclipse.swt.widgets.Table tableTablecompositionRequiredProperty = new org.eclipse.swt.widgets.Table(
            tableContainer, SWT.FULL_SELECTION);
    tableTablecompositionRequiredProperty.setHeaderVisible(true);
    GridData gdTablecompositionRequiredProperty = new GridData();
    gdTablecompositionRequiredProperty.grabExcessHorizontalSpace = true;
    gdTablecompositionRequiredProperty.horizontalAlignment = GridData.FILL;
    gdTablecompositionRequiredProperty.grabExcessVerticalSpace = true;
    gdTablecompositionRequiredProperty.verticalAlignment = GridData.FILL;
    tableTablecompositionRequiredProperty.setLayoutData(gdTablecompositionRequiredProperty);
    tableTablecompositionRequiredProperty.setLinesVisible(true);

    // Start of user code for columns definition for TablecompositionRequiredProperty
    TableColumn name = new TableColumn(tableTablecompositionRequiredProperty, SWT.NONE);
    name.setWidth(80);
    name.setText("Label"); //$NON-NLS-1$
    // End of user code

    tablecompositionRequiredProperty = new TableViewer(tableTablecompositionRequiredProperty);
    tablecompositionRequiredProperty.setContentProvider(new ArrayContentProvider());
    tablecompositionRequiredProperty.setLabelProvider(new ITableLabelProvider() {
        //Start of user code for label provider definition for TablecompositionRequiredProperty
        public String getColumnText(Object object, int columnIndex) {
            AdapterFactoryLabelProvider labelProvider = new AdapterFactoryLabelProvider(adapterFactory);
            if (object instanceof EObject) {
                switch (columnIndex) {
                case 0:
                    return labelProvider.getText(object);
                }
            }
            return ""; //$NON-NLS-1$
        }

        public Image getColumnImage(Object element, int columnIndex) {
            return null;
        }

        //End of user code

        public void addListener(ILabelProviderListener listener) {
        }

        public void dispose() {
        }

        public boolean isLabelProperty(Object element, String property) {
            return false;
        }

        public void removeListener(ILabelProviderListener listener) {
        }

    });
    tablecompositionRequiredProperty.getTable().addListener(SWT.MouseDoubleClick, new Listener() {

        public void handleEvent(Event event) {
            if (tablecompositionRequiredProperty.getSelection() instanceof IStructuredSelection) {
                IStructuredSelection selection = (IStructuredSelection) tablecompositionRequiredProperty
                        .getSelection();
                if (selection.getFirstElement() instanceof EObject) {
                    propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(
                            TotalSamplePropertiesEditionPartImpl.this,
                            EefnrViewsRepository.TotalSample.Properties.tablecompositionRequiredProperty,
                            PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.EDIT, null,
                            selection.getFirstElement()));
                    tablecompositionRequiredProperty.refresh();
                }
            }
        }

    });
    GridData tablecompositionRequiredPropertyData = new GridData(GridData.FILL_HORIZONTAL);
    tablecompositionRequiredPropertyData.minimumHeight = 120;
    tablecompositionRequiredPropertyData.heightHint = 120;
    tablecompositionRequiredProperty.getTable().setLayoutData(tablecompositionRequiredPropertyData);
    for (ViewerFilter filter : this.tablecompositionRequiredPropertyFilters) {
        tablecompositionRequiredProperty.addFilter(filter);
    }
    EditingUtils.setID(tablecompositionRequiredProperty.getTable(),
            EefnrViewsRepository.TotalSample.Properties.tablecompositionRequiredProperty);
    EditingUtils.setEEFtype(tablecompositionRequiredProperty.getTable(), "eef::TableComposition::field"); //$NON-NLS-1$
    createTablecompositionRequiredPropertyPanel(tableContainer);
    return container;
}

From source file:org.eclipse.emf.eef.eefnr.parts.impl.TotalSamplePropertiesEditionPartImpl.java

License:Open Source License

/**
 * @param container/*from w  ww  .j  a  va  2s.c om*/
 * 
 */
protected Composite createTablecompositionOptionalPropertyTableComposition(Composite container) {
    Composite tableContainer = new Composite(container, SWT.NONE);
    GridLayout tableContainerLayout = new GridLayout();
    GridData tableContainerData = new GridData(GridData.FILL_BOTH);
    tableContainerData.horizontalSpan = 3;
    tableContainer.setLayoutData(tableContainerData);
    tableContainerLayout.numColumns = 2;
    tableContainer.setLayout(tableContainerLayout);
    org.eclipse.swt.widgets.Table tableTablecompositionOptionalProperty = new org.eclipse.swt.widgets.Table(
            tableContainer, SWT.FULL_SELECTION);
    tableTablecompositionOptionalProperty.setHeaderVisible(true);
    GridData gdTablecompositionOptionalProperty = new GridData();
    gdTablecompositionOptionalProperty.grabExcessHorizontalSpace = true;
    gdTablecompositionOptionalProperty.horizontalAlignment = GridData.FILL;
    gdTablecompositionOptionalProperty.grabExcessVerticalSpace = true;
    gdTablecompositionOptionalProperty.verticalAlignment = GridData.FILL;
    tableTablecompositionOptionalProperty.setLayoutData(gdTablecompositionOptionalProperty);
    tableTablecompositionOptionalProperty.setLinesVisible(true);

    // Start of user code for columns definition for TablecompositionOptionalProperty
    TableColumn name = new TableColumn(tableTablecompositionOptionalProperty, SWT.NONE);
    name.setWidth(80);
    name.setText("Label"); //$NON-NLS-1$
    // End of user code

    tablecompositionOptionalProperty = new TableViewer(tableTablecompositionOptionalProperty);
    tablecompositionOptionalProperty.setContentProvider(new ArrayContentProvider());
    tablecompositionOptionalProperty.setLabelProvider(new ITableLabelProvider() {
        //Start of user code for label provider definition for TablecompositionOptionalProperty
        public String getColumnText(Object object, int columnIndex) {
            AdapterFactoryLabelProvider labelProvider = new AdapterFactoryLabelProvider(adapterFactory);
            if (object instanceof EObject) {
                switch (columnIndex) {
                case 0:
                    return labelProvider.getText(object);
                }
            }
            return ""; //$NON-NLS-1$
        }

        public Image getColumnImage(Object element, int columnIndex) {
            return null;
        }

        //End of user code

        public void addListener(ILabelProviderListener listener) {
        }

        public void dispose() {
        }

        public boolean isLabelProperty(Object element, String property) {
            return false;
        }

        public void removeListener(ILabelProviderListener listener) {
        }

    });
    tablecompositionOptionalProperty.getTable().addListener(SWT.MouseDoubleClick, new Listener() {

        public void handleEvent(Event event) {
            if (tablecompositionOptionalProperty.getSelection() instanceof IStructuredSelection) {
                IStructuredSelection selection = (IStructuredSelection) tablecompositionOptionalProperty
                        .getSelection();
                if (selection.getFirstElement() instanceof EObject) {
                    propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(
                            TotalSamplePropertiesEditionPartImpl.this,
                            EefnrViewsRepository.TotalSample.Properties.tablecompositionOptionalProperty,
                            PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.EDIT, null,
                            selection.getFirstElement()));
                    tablecompositionOptionalProperty.refresh();
                }
            }
        }

    });
    GridData tablecompositionOptionalPropertyData = new GridData(GridData.FILL_HORIZONTAL);
    tablecompositionOptionalPropertyData.minimumHeight = 120;
    tablecompositionOptionalPropertyData.heightHint = 120;
    tablecompositionOptionalProperty.getTable().setLayoutData(tablecompositionOptionalPropertyData);
    for (ViewerFilter filter : this.tablecompositionOptionalPropertyFilters) {
        tablecompositionOptionalProperty.addFilter(filter);
    }
    EditingUtils.setID(tablecompositionOptionalProperty.getTable(),
            EefnrViewsRepository.TotalSample.Properties.tablecompositionOptionalProperty);
    EditingUtils.setEEFtype(tablecompositionOptionalProperty.getTable(), "eef::TableComposition::field"); //$NON-NLS-1$
    createTablecompositionOptionalPropertyPanel(tableContainer);
    return container;
}