Search in sources :

Example 86 with ReferencesTable

use of org.eclipse.emf.eef.runtime.ui.widgets.ReferencesTable in project InformationSystem by ObeoNetwork.

the class ForeignKeyPropertiesEditionPartImpl method createElementsAdvancedTableComposition.

/**
 * @param container
 */
protected Composite createElementsAdvancedTableComposition(Composite parent) {
    this.elements = new ReferencesTable(getDescription(DatabaseViewsRepository.ForeignKey.Properties.elements, DatabaseMessages.ForeignKeyPropertiesEditionPart_ElementsLabel), new ReferencesTableListener() {

        public void handleAdd() {
            propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(ForeignKeyPropertiesEditionPartImpl.this, DatabaseViewsRepository.ForeignKey.Properties.elements, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.ADD, null, null));
            elements.refresh();
        }

        public void handleEdit(EObject element) {
            propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(ForeignKeyPropertiesEditionPartImpl.this, DatabaseViewsRepository.ForeignKey.Properties.elements, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.EDIT, null, element));
            elements.refresh();
        }

        public void handleMove(EObject element, int oldIndex, int newIndex) {
            propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(ForeignKeyPropertiesEditionPartImpl.this, DatabaseViewsRepository.ForeignKey.Properties.elements, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.MOVE, element, newIndex));
            elements.refresh();
        }

        public void handleRemove(EObject element) {
            propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(ForeignKeyPropertiesEditionPartImpl.this, DatabaseViewsRepository.ForeignKey.Properties.elements, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.REMOVE, null, element));
            elements.refresh();
        }

        public void navigateTo(EObject element) {
        }
    });
    for (ViewerFilter filter : this.elementsFilters) {
        this.elements.addFilter(filter);
    }
    this.elements.setHelpText(propertiesEditionComponent.getHelpContent(DatabaseViewsRepository.ForeignKey.Properties.elements, DatabaseViewsRepository.SWT_KIND));
    this.elements.createControls(parent);
    this.elements.addSelectionListener(new SelectionAdapter() {

        public void widgetSelected(SelectionEvent e) {
            if (e.item != null && e.item.getData() instanceof EObject) {
                propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(ForeignKeyPropertiesEditionPartImpl.this, DatabaseViewsRepository.ForeignKey.Properties.elements, PropertiesEditionEvent.CHANGE, PropertiesEditionEvent.SELECTION_CHANGED, null, e.item.getData()));
            }
        }
    });
    GridData elementsData = new GridData(GridData.FILL_HORIZONTAL);
    elementsData.horizontalSpan = 3;
    this.elements.setLayoutData(elementsData);
    this.elements.setLowerBound(0);
    this.elements.setUpperBound(-1);
    elements.setID(DatabaseViewsRepository.ForeignKey.Properties.elements);
    // $NON-NLS-1$
    elements.setEEFType("eef::AdvancedTableComposition");
    // End of user code
    return parent;
}
Also used : ViewerFilter(org.eclipse.jface.viewers.ViewerFilter) ReferencesTable(org.eclipse.emf.eef.runtime.ui.widgets.ReferencesTable) EObject(org.eclipse.emf.ecore.EObject) SelectionAdapter(org.eclipse.swt.events.SelectionAdapter) SelectionEvent(org.eclipse.swt.events.SelectionEvent) GridData(org.eclipse.swt.layout.GridData) IPropertiesEditionEvent(org.eclipse.emf.eef.runtime.api.notify.IPropertiesEditionEvent) PropertiesEditionEvent(org.eclipse.emf.eef.runtime.impl.notify.PropertiesEditionEvent) ReferencesTableListener(org.eclipse.emf.eef.runtime.ui.widgets.ReferencesTable.ReferencesTableListener)

Example 87 with ReferencesTable

use of org.eclipse.emf.eef.runtime.ui.widgets.ReferencesTable in project InformationSystem by ObeoNetwork.

the class ForeignKeysPropertiesEditionPartImpl method createForeignKeysAdvancedTableComposition.

/**
 * @param container
 */
protected Composite createForeignKeysAdvancedTableComposition(Composite parent) {
    this.foreignKeys = new ReferencesTable(getDescription(DatabaseViewsRepository.ForeignKeys.Properties.foreignKeys_, DatabaseMessages.ForeignKeysPropertiesEditionPart_ForeignKeysLabel), new ReferencesTableListener() {

        public void handleAdd() {
            propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(ForeignKeysPropertiesEditionPartImpl.this, DatabaseViewsRepository.ForeignKeys.Properties.foreignKeys_, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.ADD, null, null));
            foreignKeys.refresh();
        }

        public void handleEdit(EObject element) {
            propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(ForeignKeysPropertiesEditionPartImpl.this, DatabaseViewsRepository.ForeignKeys.Properties.foreignKeys_, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.EDIT, null, element));
            foreignKeys.refresh();
        }

        public void handleMove(EObject element, int oldIndex, int newIndex) {
            propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(ForeignKeysPropertiesEditionPartImpl.this, DatabaseViewsRepository.ForeignKeys.Properties.foreignKeys_, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.MOVE, element, newIndex));
            foreignKeys.refresh();
        }

        public void handleRemove(EObject element) {
            propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(ForeignKeysPropertiesEditionPartImpl.this, DatabaseViewsRepository.ForeignKeys.Properties.foreignKeys_, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.REMOVE, null, element));
            foreignKeys.refresh();
        }

        public void navigateTo(EObject element) {
        }
    });
    for (ViewerFilter filter : this.foreignKeysFilters) {
        this.foreignKeys.addFilter(filter);
    }
    this.foreignKeys.setHelpText(propertiesEditionComponent.getHelpContent(DatabaseViewsRepository.ForeignKeys.Properties.foreignKeys_, DatabaseViewsRepository.SWT_KIND));
    this.foreignKeys.createControls(parent);
    this.foreignKeys.addSelectionListener(new SelectionAdapter() {

        public void widgetSelected(SelectionEvent e) {
            if (e.item != null && e.item.getData() instanceof EObject) {
                propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(ForeignKeysPropertiesEditionPartImpl.this, DatabaseViewsRepository.ForeignKeys.Properties.foreignKeys_, PropertiesEditionEvent.CHANGE, PropertiesEditionEvent.SELECTION_CHANGED, null, e.item.getData()));
            }
        }
    });
    GridData foreignKeysData = new GridData(GridData.FILL_HORIZONTAL);
    foreignKeysData.horizontalSpan = 3;
    this.foreignKeys.setLayoutData(foreignKeysData);
    this.foreignKeys.setLowerBound(0);
    this.foreignKeys.setUpperBound(-1);
    foreignKeys.setID(DatabaseViewsRepository.ForeignKeys.Properties.foreignKeys_);
    // $NON-NLS-1$
    foreignKeys.setEEFType("eef::AdvancedTableComposition");
    // End of user code
    return parent;
}
Also used : ViewerFilter(org.eclipse.jface.viewers.ViewerFilter) ReferencesTable(org.eclipse.emf.eef.runtime.ui.widgets.ReferencesTable) EObject(org.eclipse.emf.ecore.EObject) SelectionAdapter(org.eclipse.swt.events.SelectionAdapter) SelectionEvent(org.eclipse.swt.events.SelectionEvent) GridData(org.eclipse.swt.layout.GridData) IPropertiesEditionEvent(org.eclipse.emf.eef.runtime.api.notify.IPropertiesEditionEvent) PropertiesEditionEvent(org.eclipse.emf.eef.runtime.impl.notify.PropertiesEditionEvent) ReferencesTableListener(org.eclipse.emf.eef.runtime.ui.widgets.ReferencesTable.ReferencesTableListener)

Example 88 with ReferencesTable

use of org.eclipse.emf.eef.runtime.ui.widgets.ReferencesTable in project InformationSystem by ObeoNetwork.

the class TablePropertiesEditionPartImpl method createColumnsAdvancedTableComposition.

/**
 * @param container
 */
protected Composite createColumnsAdvancedTableComposition(Composite parent) {
    this.columns = new ReferencesTable(getDescription(DatabaseViewsRepository.Table.Properties.columns, DatabaseMessages.TablePropertiesEditionPart_ColumnsLabel), new ReferencesTableListener() {

        public void handleAdd() {
            propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(TablePropertiesEditionPartImpl.this, DatabaseViewsRepository.Table.Properties.columns, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.ADD, null, null));
            columns.refresh();
        }

        public void handleEdit(EObject element) {
            propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(TablePropertiesEditionPartImpl.this, DatabaseViewsRepository.Table.Properties.columns, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.EDIT, null, element));
            columns.refresh();
        }

        public void handleMove(EObject element, int oldIndex, int newIndex) {
            propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(TablePropertiesEditionPartImpl.this, DatabaseViewsRepository.Table.Properties.columns, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.MOVE, element, newIndex));
            columns.refresh();
        }

        public void handleRemove(EObject element) {
            propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(TablePropertiesEditionPartImpl.this, DatabaseViewsRepository.Table.Properties.columns, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.REMOVE, null, element));
            columns.refresh();
        }

        public void navigateTo(EObject element) {
        }
    });
    for (ViewerFilter filter : this.columnsFilters) {
        this.columns.addFilter(filter);
    }
    this.columns.setHelpText(propertiesEditionComponent.getHelpContent(DatabaseViewsRepository.Table.Properties.columns, DatabaseViewsRepository.SWT_KIND));
    this.columns.createControls(parent);
    this.columns.addSelectionListener(new SelectionAdapter() {

        public void widgetSelected(SelectionEvent e) {
            if (e.item != null && e.item.getData() instanceof EObject) {
                propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(TablePropertiesEditionPartImpl.this, DatabaseViewsRepository.Table.Properties.columns, PropertiesEditionEvent.CHANGE, PropertiesEditionEvent.SELECTION_CHANGED, null, e.item.getData()));
            }
        }
    });
    GridData columnsData = new GridData(GridData.FILL_HORIZONTAL);
    columnsData.horizontalSpan = 3;
    this.columns.setLayoutData(columnsData);
    this.columns.setLowerBound(0);
    this.columns.setUpperBound(-1);
    columns.setID(DatabaseViewsRepository.Table.Properties.columns);
    // $NON-NLS-1$
    columns.setEEFType("eef::AdvancedTableComposition");
    // End of user code
    return parent;
}
Also used : ViewerFilter(org.eclipse.jface.viewers.ViewerFilter) ReferencesTable(org.eclipse.emf.eef.runtime.ui.widgets.ReferencesTable) EObject(org.eclipse.emf.ecore.EObject) SelectionAdapter(org.eclipse.swt.events.SelectionAdapter) SelectionEvent(org.eclipse.swt.events.SelectionEvent) GridData(org.eclipse.swt.layout.GridData) IPropertiesEditionEvent(org.eclipse.emf.eef.runtime.api.notify.IPropertiesEditionEvent) PropertiesEditionEvent(org.eclipse.emf.eef.runtime.impl.notify.PropertiesEditionEvent) ReferencesTableListener(org.eclipse.emf.eef.runtime.ui.widgets.ReferencesTable.ReferencesTableListener)

Example 89 with ReferencesTable

use of org.eclipse.emf.eef.runtime.ui.widgets.ReferencesTable in project InformationSystem by ObeoNetwork.

the class ViewPropertiesEditionPartImpl method createTablesAdvancedTableComposition.

/**
 * @param container
 */
protected Composite createTablesAdvancedTableComposition(Composite parent) {
    this.tables = new ReferencesTable(getDescription(DatabaseViewsRepository.View.Properties.tables, DatabaseMessages.ViewPropertiesEditionPart_TablesLabel), new ReferencesTableListener() {

        public void handleAdd() {
            propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(ViewPropertiesEditionPartImpl.this, DatabaseViewsRepository.View.Properties.tables, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.ADD, null, null));
            tables.refresh();
        }

        public void handleEdit(EObject element) {
            propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(ViewPropertiesEditionPartImpl.this, DatabaseViewsRepository.View.Properties.tables, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.EDIT, null, element));
            tables.refresh();
        }

        public void handleMove(EObject element, int oldIndex, int newIndex) {
            propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(ViewPropertiesEditionPartImpl.this, DatabaseViewsRepository.View.Properties.tables, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.MOVE, element, newIndex));
            tables.refresh();
        }

        public void handleRemove(EObject element) {
            propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(ViewPropertiesEditionPartImpl.this, DatabaseViewsRepository.View.Properties.tables, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.REMOVE, null, element));
            tables.refresh();
        }

        public void navigateTo(EObject element) {
        }
    });
    for (ViewerFilter filter : this.tablesFilters) {
        this.tables.addFilter(filter);
    }
    this.tables.setHelpText(propertiesEditionComponent.getHelpContent(DatabaseViewsRepository.View.Properties.tables, DatabaseViewsRepository.SWT_KIND));
    this.tables.createControls(parent);
    this.tables.addSelectionListener(new SelectionAdapter() {

        public void widgetSelected(SelectionEvent e) {
            if (e.item != null && e.item.getData() instanceof EObject) {
                propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(ViewPropertiesEditionPartImpl.this, DatabaseViewsRepository.View.Properties.tables, PropertiesEditionEvent.CHANGE, PropertiesEditionEvent.SELECTION_CHANGED, null, e.item.getData()));
            }
        }
    });
    GridData tablesData = new GridData(GridData.FILL_HORIZONTAL);
    tablesData.horizontalSpan = 3;
    this.tables.setLayoutData(tablesData);
    this.tables.setLowerBound(0);
    this.tables.setUpperBound(-1);
    tables.setID(DatabaseViewsRepository.View.Properties.tables);
    // $NON-NLS-1$
    tables.setEEFType("eef::AdvancedTableComposition");
    // End of user code
    return parent;
}
Also used : ViewerFilter(org.eclipse.jface.viewers.ViewerFilter) ReferencesTable(org.eclipse.emf.eef.runtime.ui.widgets.ReferencesTable) EObject(org.eclipse.emf.ecore.EObject) SelectionAdapter(org.eclipse.swt.events.SelectionAdapter) SelectionEvent(org.eclipse.swt.events.SelectionEvent) GridData(org.eclipse.swt.layout.GridData) IPropertiesEditionEvent(org.eclipse.emf.eef.runtime.api.notify.IPropertiesEditionEvent) PropertiesEditionEvent(org.eclipse.emf.eef.runtime.impl.notify.PropertiesEditionEvent) ReferencesTableListener(org.eclipse.emf.eef.runtime.ui.widgets.ReferencesTable.ReferencesTableListener)

Example 90 with ReferencesTable

use of org.eclipse.emf.eef.runtime.ui.widgets.ReferencesTable in project InformationSystem by ObeoNetwork.

the class ViewContainerPropertiesEditionPartImpl method createOwnedElementsAdvancedTableComposition.

/**
 * @param container
 */
protected Composite createOwnedElementsAdvancedTableComposition(Composite parent) {
    this.ownedElements = new ReferencesTable(getDescription(ViewViewsRepository.ViewContainer.Properties.ownedElements, ViewMessages.ViewContainerPropertiesEditionPart_OwnedElementsLabel), new ReferencesTableListener() {

        public void handleAdd() {
            propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(ViewContainerPropertiesEditionPartImpl.this, ViewViewsRepository.ViewContainer.Properties.ownedElements, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.ADD, null, null));
            ownedElements.refresh();
        }

        public void handleEdit(EObject element) {
            propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(ViewContainerPropertiesEditionPartImpl.this, ViewViewsRepository.ViewContainer.Properties.ownedElements, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.EDIT, null, element));
            ownedElements.refresh();
        }

        public void handleMove(EObject element, int oldIndex, int newIndex) {
            propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(ViewContainerPropertiesEditionPartImpl.this, ViewViewsRepository.ViewContainer.Properties.ownedElements, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.MOVE, element, newIndex));
            ownedElements.refresh();
        }

        public void handleRemove(EObject element) {
            propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(ViewContainerPropertiesEditionPartImpl.this, ViewViewsRepository.ViewContainer.Properties.ownedElements, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.REMOVE, null, element));
            ownedElements.refresh();
        }

        public void navigateTo(EObject element) {
        }
    });
    for (ViewerFilter filter : this.ownedElementsFilters) {
        this.ownedElements.addFilter(filter);
    }
    this.ownedElements.setHelpText(propertiesEditionComponent.getHelpContent(ViewViewsRepository.ViewContainer.Properties.ownedElements, ViewViewsRepository.SWT_KIND));
    this.ownedElements.createControls(parent);
    this.ownedElements.addSelectionListener(new SelectionAdapter() {

        public void widgetSelected(SelectionEvent e) {
            if (e.item != null && e.item.getData() instanceof EObject) {
                propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(ViewContainerPropertiesEditionPartImpl.this, ViewViewsRepository.ViewContainer.Properties.ownedElements, PropertiesEditionEvent.CHANGE, PropertiesEditionEvent.SELECTION_CHANGED, null, e.item.getData()));
            }
        }
    });
    GridData ownedElementsData = new GridData(GridData.FILL_HORIZONTAL);
    ownedElementsData.horizontalSpan = 3;
    this.ownedElements.setLayoutData(ownedElementsData);
    this.ownedElements.setLowerBound(0);
    this.ownedElements.setUpperBound(-1);
    ownedElements.setID(ViewViewsRepository.ViewContainer.Properties.ownedElements);
    // $NON-NLS-1$
    ownedElements.setEEFType("eef::AdvancedTableComposition");
    // End of user code
    return parent;
}
Also used : ViewerFilter(org.eclipse.jface.viewers.ViewerFilter) ReferencesTable(org.eclipse.emf.eef.runtime.ui.widgets.ReferencesTable) EObject(org.eclipse.emf.ecore.EObject) SelectionAdapter(org.eclipse.swt.events.SelectionAdapter) SelectionEvent(org.eclipse.swt.events.SelectionEvent) GridData(org.eclipse.swt.layout.GridData) IPropertiesEditionEvent(org.eclipse.emf.eef.runtime.api.notify.IPropertiesEditionEvent) PropertiesEditionEvent(org.eclipse.emf.eef.runtime.impl.notify.PropertiesEditionEvent) ReferencesTableListener(org.eclipse.emf.eef.runtime.ui.widgets.ReferencesTable.ReferencesTableListener)

Aggregations

EObject (org.eclipse.emf.ecore.EObject)162 IPropertiesEditionEvent (org.eclipse.emf.eef.runtime.api.notify.IPropertiesEditionEvent)162 PropertiesEditionEvent (org.eclipse.emf.eef.runtime.impl.notify.PropertiesEditionEvent)162 ReferencesTable (org.eclipse.emf.eef.runtime.ui.widgets.ReferencesTable)162 ReferencesTableListener (org.eclipse.emf.eef.runtime.ui.widgets.ReferencesTable.ReferencesTableListener)162 SelectionAdapter (org.eclipse.swt.events.SelectionAdapter)162 SelectionEvent (org.eclipse.swt.events.SelectionEvent)162 GridData (org.eclipse.swt.layout.GridData)162 ViewerFilter (org.eclipse.jface.viewers.ViewerFilter)84 FlatReferencesTable (org.eclipse.emf.eef.runtime.ui.widgets.FlatReferencesTable)6