Search in sources :

Example 46 with PropertiesEditionEvent

use of org.eclipse.emf.eef.runtime.impl.notify.PropertiesEditionEvent in project InformationSystem by ObeoNetwork.

the class DataBasePropertiesEditionPartForm method createUsedLibrariesFlatReferencesTable.

/**
 * @param parent
 */
protected Composite createUsedLibrariesFlatReferencesTable(FormToolkit widgetFactory, Composite parent) {
    createDescription(parent, DatabaseViewsRepository.DataBase_.Properties.usedLibraries, DatabaseMessages.DataBasePropertiesEditionPart_UsedLibrariesLabel);
    usedLibraries = new FlatReferencesTable(parent);
    usedLibraries.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
    usedLibraries.addSelectionChangedListener(new ISelectionChangedListener() {

        public void selectionChanged(SelectionChangedEvent event) {
            if (event.getSelection() instanceof StructuredSelection)
                propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(DataBasePropertiesEditionPartForm.this, DatabaseViewsRepository.DataBase_.Properties.usedLibraries, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.SET, null, ((StructuredSelection) event.getSelection()).toList()));
        }
    });
    GridData usedLibrariesData = new GridData(GridData.FILL_HORIZONTAL);
    usedLibraries.setLayoutData(usedLibrariesData);
    usedLibraries.setID(DatabaseViewsRepository.DataBase_.Properties.usedLibraries);
    // $NON-NLS-1$
    FormUtils.createHelpButton(widgetFactory, parent, propertiesEditionComponent.getHelpContent(DatabaseViewsRepository.DataBase_.Properties.usedLibraries, DatabaseViewsRepository.FORM_KIND), null);
    // End of user code
    return parent;
}
Also used : FlatReferencesTable(org.eclipse.emf.eef.runtime.ui.widgets.FlatReferencesTable) ISelectionChangedListener(org.eclipse.jface.viewers.ISelectionChangedListener) StructuredSelection(org.eclipse.jface.viewers.StructuredSelection) GridData(org.eclipse.swt.layout.GridData) AdapterFactoryLabelProvider(org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider) SelectionChangedEvent(org.eclipse.jface.viewers.SelectionChangedEvent) IPropertiesEditionEvent(org.eclipse.emf.eef.runtime.api.notify.IPropertiesEditionEvent) PropertiesEditionEvent(org.eclipse.emf.eef.runtime.impl.notify.PropertiesEditionEvent)

Example 47 with PropertiesEditionEvent

use of org.eclipse.emf.eef.runtime.impl.notify.PropertiesEditionEvent in project InformationSystem by ObeoNetwork.

the class ForeignKeyElementPropertiesEditionPartForm method createTargetTableText.

protected Composite createTargetTableText(FormToolkit widgetFactory, Composite parent) {
    createDescription(parent, DatabaseViewsRepository.ForeignKeyElement.Properties.targetTable, DatabaseMessages.ForeignKeyElementPropertiesEditionPart_TargetTableLabel);
    // $NON-NLS-1$
    targetTable = widgetFactory.createText(parent, "");
    targetTable.setData(FormToolkit.KEY_DRAW_BORDER, FormToolkit.TEXT_BORDER);
    widgetFactory.paintBordersFor(parent);
    GridData targetTableData = new GridData(GridData.FILL_HORIZONTAL);
    targetTable.setLayoutData(targetTableData);
    targetTable.addFocusListener(new FocusAdapter() {

        /**
         * @see org.eclipse.swt.events.FocusAdapter#focusLost(org.eclipse.swt.events.FocusEvent)
         */
        @Override
        @SuppressWarnings("synthetic-access")
        public void focusLost(FocusEvent e) {
            if (propertiesEditionComponent != null) {
                propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(ForeignKeyElementPropertiesEditionPartForm.this, DatabaseViewsRepository.ForeignKeyElement.Properties.targetTable, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.SET, null, targetTable.getText()));
                propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(ForeignKeyElementPropertiesEditionPartForm.this, DatabaseViewsRepository.ForeignKeyElement.Properties.targetTable, PropertiesEditionEvent.FOCUS_CHANGED, PropertiesEditionEvent.FOCUS_LOST, null, targetTable.getText()));
            }
        }

        /**
         * @see org.eclipse.swt.events.FocusAdapter#focusGained(org.eclipse.swt.events.FocusEvent)
         */
        @Override
        public void focusGained(FocusEvent e) {
            if (propertiesEditionComponent != null) {
                propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(ForeignKeyElementPropertiesEditionPartForm.this, null, PropertiesEditionEvent.FOCUS_CHANGED, PropertiesEditionEvent.FOCUS_GAINED, null, null));
            }
        }
    });
    targetTable.addKeyListener(new KeyAdapter() {

        /**
         * @see org.eclipse.swt.events.KeyAdapter#keyPressed(org.eclipse.swt.events.KeyEvent)
         */
        @Override
        @SuppressWarnings("synthetic-access")
        public void keyPressed(KeyEvent e) {
            if (e.character == SWT.CR) {
                if (propertiesEditionComponent != null)
                    propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(ForeignKeyElementPropertiesEditionPartForm.this, DatabaseViewsRepository.ForeignKeyElement.Properties.targetTable, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.SET, null, targetTable.getText()));
            }
        }
    });
    EditingUtils.setID(targetTable, DatabaseViewsRepository.ForeignKeyElement.Properties.targetTable);
    // $NON-NLS-1$
    EditingUtils.setEEFtype(targetTable, "eef::Text");
    // $NON-NLS-1$
    FormUtils.createHelpButton(widgetFactory, parent, propertiesEditionComponent.getHelpContent(DatabaseViewsRepository.ForeignKeyElement.Properties.targetTable, DatabaseViewsRepository.FORM_KIND), null);
    // End of user code
    return parent;
}
Also used : KeyEvent(org.eclipse.swt.events.KeyEvent) FocusAdapter(org.eclipse.swt.events.FocusAdapter) KeyAdapter(org.eclipse.swt.events.KeyAdapter) GridData(org.eclipse.swt.layout.GridData) IPropertiesEditionEvent(org.eclipse.emf.eef.runtime.api.notify.IPropertiesEditionEvent) PropertiesEditionEvent(org.eclipse.emf.eef.runtime.impl.notify.PropertiesEditionEvent) FocusEvent(org.eclipse.swt.events.FocusEvent)

Example 48 with PropertiesEditionEvent

use of org.eclipse.emf.eef.runtime.impl.notify.PropertiesEditionEvent in project InformationSystem by ObeoNetwork.

the class ForeignKeyElementPropertiesEditionPartForm method createSourceTableText.

protected Composite createSourceTableText(FormToolkit widgetFactory, Composite parent) {
    createDescription(parent, DatabaseViewsRepository.ForeignKeyElement.Properties.sourceTable, DatabaseMessages.ForeignKeyElementPropertiesEditionPart_SourceTableLabel);
    // $NON-NLS-1$
    sourceTable = widgetFactory.createText(parent, "");
    sourceTable.setData(FormToolkit.KEY_DRAW_BORDER, FormToolkit.TEXT_BORDER);
    widgetFactory.paintBordersFor(parent);
    GridData sourceTableData = new GridData(GridData.FILL_HORIZONTAL);
    sourceTable.setLayoutData(sourceTableData);
    sourceTable.addFocusListener(new FocusAdapter() {

        /**
         * @see org.eclipse.swt.events.FocusAdapter#focusLost(org.eclipse.swt.events.FocusEvent)
         */
        @Override
        @SuppressWarnings("synthetic-access")
        public void focusLost(FocusEvent e) {
            if (propertiesEditionComponent != null) {
                propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(ForeignKeyElementPropertiesEditionPartForm.this, DatabaseViewsRepository.ForeignKeyElement.Properties.sourceTable, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.SET, null, sourceTable.getText()));
                propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(ForeignKeyElementPropertiesEditionPartForm.this, DatabaseViewsRepository.ForeignKeyElement.Properties.sourceTable, PropertiesEditionEvent.FOCUS_CHANGED, PropertiesEditionEvent.FOCUS_LOST, null, sourceTable.getText()));
            }
        }

        /**
         * @see org.eclipse.swt.events.FocusAdapter#focusGained(org.eclipse.swt.events.FocusEvent)
         */
        @Override
        public void focusGained(FocusEvent e) {
            if (propertiesEditionComponent != null) {
                propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(ForeignKeyElementPropertiesEditionPartForm.this, null, PropertiesEditionEvent.FOCUS_CHANGED, PropertiesEditionEvent.FOCUS_GAINED, null, null));
            }
        }
    });
    sourceTable.addKeyListener(new KeyAdapter() {

        /**
         * @see org.eclipse.swt.events.KeyAdapter#keyPressed(org.eclipse.swt.events.KeyEvent)
         */
        @Override
        @SuppressWarnings("synthetic-access")
        public void keyPressed(KeyEvent e) {
            if (e.character == SWT.CR) {
                if (propertiesEditionComponent != null)
                    propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(ForeignKeyElementPropertiesEditionPartForm.this, DatabaseViewsRepository.ForeignKeyElement.Properties.sourceTable, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.SET, null, sourceTable.getText()));
            }
        }
    });
    EditingUtils.setID(sourceTable, DatabaseViewsRepository.ForeignKeyElement.Properties.sourceTable);
    // $NON-NLS-1$
    EditingUtils.setEEFtype(sourceTable, "eef::Text");
    // $NON-NLS-1$
    FormUtils.createHelpButton(widgetFactory, parent, propertiesEditionComponent.getHelpContent(DatabaseViewsRepository.ForeignKeyElement.Properties.sourceTable, DatabaseViewsRepository.FORM_KIND), null);
    // End of user code
    return parent;
}
Also used : KeyEvent(org.eclipse.swt.events.KeyEvent) FocusAdapter(org.eclipse.swt.events.FocusAdapter) KeyAdapter(org.eclipse.swt.events.KeyAdapter) GridData(org.eclipse.swt.layout.GridData) IPropertiesEditionEvent(org.eclipse.emf.eef.runtime.api.notify.IPropertiesEditionEvent) PropertiesEditionEvent(org.eclipse.emf.eef.runtime.impl.notify.PropertiesEditionEvent) FocusEvent(org.eclipse.swt.events.FocusEvent)

Example 49 with PropertiesEditionEvent

use of org.eclipse.emf.eef.runtime.impl.notify.PropertiesEditionEvent in project InformationSystem by ObeoNetwork.

the class ForeignKeyElementPropertiesEditionPartForm method createFKColumnFlatComboViewer.

/**
 * @param parent the parent composite
 * @param widgetFactory factory to use to instanciante widget of the form
 */
protected Composite createFKColumnFlatComboViewer(Composite parent, FormToolkit widgetFactory) {
    createDescription(parent, DatabaseViewsRepository.ForeignKeyElement.Properties.fKColumn, DatabaseMessages.ForeignKeyElementPropertiesEditionPart_FKColumnLabel);
    fKColumn = new EObjectFlatComboViewer(parent, !propertiesEditionComponent.isRequired(DatabaseViewsRepository.ForeignKeyElement.Properties.fKColumn, DatabaseViewsRepository.FORM_KIND));
    widgetFactory.adapt(fKColumn);
    fKColumn.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
    GridData fKColumnData = new GridData(GridData.FILL_HORIZONTAL);
    fKColumn.setLayoutData(fKColumnData);
    fKColumn.addSelectionChangedListener(new ISelectionChangedListener() {

        /**
         * {@inheritDoc}
         *
         * @see org.eclipse.jface.viewers.ISelectionChangedListener#selectionChanged(org.eclipse.jface.viewers.SelectionChangedEvent)
         */
        public void selectionChanged(SelectionChangedEvent event) {
            if (propertiesEditionComponent != null)
                propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(ForeignKeyElementPropertiesEditionPartForm.this, DatabaseViewsRepository.ForeignKeyElement.Properties.fKColumn, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.SET, null, getFKColumn()));
        }
    });
    fKColumn.setID(DatabaseViewsRepository.ForeignKeyElement.Properties.fKColumn);
    // $NON-NLS-1$
    FormUtils.createHelpButton(widgetFactory, parent, propertiesEditionComponent.getHelpContent(DatabaseViewsRepository.ForeignKeyElement.Properties.fKColumn, DatabaseViewsRepository.FORM_KIND), null);
    // End of user code
    return parent;
}
Also used : EObjectFlatComboViewer(org.eclipse.emf.eef.runtime.ui.widgets.EObjectFlatComboViewer) ISelectionChangedListener(org.eclipse.jface.viewers.ISelectionChangedListener) GridData(org.eclipse.swt.layout.GridData) AdapterFactoryLabelProvider(org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider) SelectionChangedEvent(org.eclipse.jface.viewers.SelectionChangedEvent) IPropertiesEditionEvent(org.eclipse.emf.eef.runtime.api.notify.IPropertiesEditionEvent) PropertiesEditionEvent(org.eclipse.emf.eef.runtime.impl.notify.PropertiesEditionEvent)

Example 50 with PropertiesEditionEvent

use of org.eclipse.emf.eef.runtime.impl.notify.PropertiesEditionEvent in project InformationSystem by ObeoNetwork.

the class ForeignKeyElementPropertiesEditionPartForm method createPKColumnFlatComboViewer.

/**
 * @param parent the parent composite
 * @param widgetFactory factory to use to instanciante widget of the form
 */
protected Composite createPKColumnFlatComboViewer(Composite parent, FormToolkit widgetFactory) {
    createDescription(parent, DatabaseViewsRepository.ForeignKeyElement.Properties.pKColumn, DatabaseMessages.ForeignKeyElementPropertiesEditionPart_PKColumnLabel);
    pKColumn = new EObjectFlatComboViewer(parent, !propertiesEditionComponent.isRequired(DatabaseViewsRepository.ForeignKeyElement.Properties.pKColumn, DatabaseViewsRepository.FORM_KIND));
    widgetFactory.adapt(pKColumn);
    pKColumn.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
    GridData pKColumnData = new GridData(GridData.FILL_HORIZONTAL);
    pKColumn.setLayoutData(pKColumnData);
    pKColumn.addSelectionChangedListener(new ISelectionChangedListener() {

        /**
         * {@inheritDoc}
         *
         * @see org.eclipse.jface.viewers.ISelectionChangedListener#selectionChanged(org.eclipse.jface.viewers.SelectionChangedEvent)
         */
        public void selectionChanged(SelectionChangedEvent event) {
            if (propertiesEditionComponent != null)
                propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(ForeignKeyElementPropertiesEditionPartForm.this, DatabaseViewsRepository.ForeignKeyElement.Properties.pKColumn, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.SET, null, getPKColumn()));
        }
    });
    pKColumn.setID(DatabaseViewsRepository.ForeignKeyElement.Properties.pKColumn);
    // $NON-NLS-1$
    FormUtils.createHelpButton(widgetFactory, parent, propertiesEditionComponent.getHelpContent(DatabaseViewsRepository.ForeignKeyElement.Properties.pKColumn, DatabaseViewsRepository.FORM_KIND), null);
    // End of user code
    return parent;
}
Also used : EObjectFlatComboViewer(org.eclipse.emf.eef.runtime.ui.widgets.EObjectFlatComboViewer) ISelectionChangedListener(org.eclipse.jface.viewers.ISelectionChangedListener) GridData(org.eclipse.swt.layout.GridData) AdapterFactoryLabelProvider(org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider) SelectionChangedEvent(org.eclipse.jface.viewers.SelectionChangedEvent) IPropertiesEditionEvent(org.eclipse.emf.eef.runtime.api.notify.IPropertiesEditionEvent) PropertiesEditionEvent(org.eclipse.emf.eef.runtime.impl.notify.PropertiesEditionEvent)

Aggregations

PropertiesEditionEvent (org.eclipse.emf.eef.runtime.impl.notify.PropertiesEditionEvent)1056 IPropertiesEditionEvent (org.eclipse.emf.eef.runtime.api.notify.IPropertiesEditionEvent)1052 GridData (org.eclipse.swt.layout.GridData)818 FocusAdapter (org.eclipse.swt.events.FocusAdapter)458 FocusEvent (org.eclipse.swt.events.FocusEvent)458 KeyAdapter (org.eclipse.swt.events.KeyAdapter)283 KeyEvent (org.eclipse.swt.events.KeyEvent)283 EObject (org.eclipse.emf.ecore.EObject)262 SelectionEvent (org.eclipse.swt.events.SelectionEvent)230 SelectionAdapter (org.eclipse.swt.events.SelectionAdapter)228 Label (org.eclipse.swt.widgets.Label)174 ReferencesTable (org.eclipse.emf.eef.runtime.ui.widgets.ReferencesTable)162 ReferencesTableListener (org.eclipse.emf.eef.runtime.ui.widgets.ReferencesTable.ReferencesTableListener)162 AdapterFactoryLabelProvider (org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider)134 ISelectionChangedListener (org.eclipse.jface.viewers.ISelectionChangedListener)116 SelectionChangedEvent (org.eclipse.jface.viewers.SelectionChangedEvent)116 ViewerFilter (org.eclipse.jface.viewers.ViewerFilter)86 IStructuredSelection (org.eclipse.jface.viewers.IStructuredSelection)84 TabElementTreeSelectionDialog (org.eclipse.emf.eef.runtime.ui.widgets.TabElementTreeSelectionDialog)78 EObjectFlatComboViewer (org.eclipse.emf.eef.runtime.ui.widgets.EObjectFlatComboViewer)60