Search in sources :

Example 36 with PropertiesEditionEvent

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

the class DataBasePropertiesEditionPartImpl method createNameText.

protected Composite createNameText(Composite parent) {
    createDescription(parent, DatabaseViewsRepository.DataBase_.Properties.name, DatabaseMessages.DataBasePropertiesEditionPart_NameLabel);
    name = SWTUtils.createScrollableText(parent, SWT.BORDER);
    GridData nameData = new GridData(GridData.FILL_HORIZONTAL);
    name.setLayoutData(nameData);
    name.addFocusListener(new FocusAdapter() {

        /**
         * {@inheritDoc}
         *
         * @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(DataBasePropertiesEditionPartImpl.this, DatabaseViewsRepository.DataBase_.Properties.name, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.SET, null, name.getText()));
        }
    });
    name.addKeyListener(new KeyAdapter() {

        /**
         * {@inheritDoc}
         *
         * @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(DataBasePropertiesEditionPartImpl.this, DatabaseViewsRepository.DataBase_.Properties.name, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.SET, null, name.getText()));
            }
        }
    });
    EditingUtils.setID(name, DatabaseViewsRepository.DataBase_.Properties.name);
    // $NON-NLS-1$
    EditingUtils.setEEFtype(name, "eef::Text");
    // $NON-NLS-1$
    SWTUtils.createHelpButton(parent, propertiesEditionComponent.getHelpContent(DatabaseViewsRepository.DataBase_.Properties.name, DatabaseViewsRepository.SWT_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 37 with PropertiesEditionEvent

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

the class ColumnPropertiesEditionPartForm method createPrecisionText.

protected Composite createPrecisionText(FormToolkit widgetFactory, Composite parent) {
    createDescription(parent, DatabaseViewsRepository.Column.Properties.TypeAttributes.precision, DatabaseMessages.ColumnPropertiesEditionPart_PrecisionLabel);
    // $NON-NLS-1$
    precision = widgetFactory.createText(parent, "");
    precision.setData(FormToolkit.KEY_DRAW_BORDER, FormToolkit.TEXT_BORDER);
    widgetFactory.paintBordersFor(parent);
    GridData precisionData = new GridData(GridData.FILL_HORIZONTAL);
    precision.setLayoutData(precisionData);
    precision.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(ColumnPropertiesEditionPartForm.this, DatabaseViewsRepository.Column.Properties.TypeAttributes.precision, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.SET, null, precision.getText()));
                propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(ColumnPropertiesEditionPartForm.this, DatabaseViewsRepository.Column.Properties.TypeAttributes.precision, PropertiesEditionEvent.FOCUS_CHANGED, PropertiesEditionEvent.FOCUS_LOST, null, precision.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(ColumnPropertiesEditionPartForm.this, null, PropertiesEditionEvent.FOCUS_CHANGED, PropertiesEditionEvent.FOCUS_GAINED, null, null));
            }
        }
    });
    precision.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(ColumnPropertiesEditionPartForm.this, DatabaseViewsRepository.Column.Properties.TypeAttributes.precision, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.SET, null, precision.getText()));
            }
        }
    });
    EditingUtils.setID(precision, DatabaseViewsRepository.Column.Properties.TypeAttributes.precision);
    // $NON-NLS-1$
    EditingUtils.setEEFtype(precision, "eef::Text");
    // $NON-NLS-1$
    FormUtils.createHelpButton(widgetFactory, parent, propertiesEditionComponent.getHelpContent(DatabaseViewsRepository.Column.Properties.TypeAttributes.precision, 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 38 with PropertiesEditionEvent

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

the class ColumnPropertiesEditionPartForm method createTypeEMFComboViewer.

protected Composite createTypeEMFComboViewer(FormToolkit widgetFactory, Composite parent) {
    createDescription(parent, DatabaseViewsRepository.Column.Properties.type, DatabaseMessages.ColumnPropertiesEditionPart_TypeLabel);
    type = new EMFComboViewer(parent);
    GridData typeData = new GridData(GridData.FILL_HORIZONTAL);
    type.getCombo().setLayoutData(typeData);
    type.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
    type.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(ColumnPropertiesEditionPartForm.this, DatabaseViewsRepository.Column.Properties.type, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.SET, null, getType()));
        }
    });
    type.setContentProvider(new EMFListContentProvider());
    EditingUtils.setID(type.getCombo(), DatabaseViewsRepository.Column.Properties.type);
    EditingUtils.setEEFtype(type.getCombo(), "eef::Combo");
    // $NON-NLS-1$
    FormUtils.createHelpButton(widgetFactory, parent, propertiesEditionComponent.getHelpContent(DatabaseViewsRepository.Column.Properties.type, DatabaseViewsRepository.FORM_KIND), null);
    // End of user code
    return parent;
}
Also used : EMFListContentProvider(org.eclipse.emf.eef.runtime.ui.providers.EMFListContentProvider) ISelectionChangedListener(org.eclipse.jface.viewers.ISelectionChangedListener) GridData(org.eclipse.swt.layout.GridData) AdapterFactoryLabelProvider(org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider) EMFComboViewer(org.eclipse.emf.eef.runtime.ui.widgets.EMFComboViewer) 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 39 with PropertiesEditionEvent

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

the class ColumnPropertiesEditionPartForm method createLengthText.

protected Composite createLengthText(FormToolkit widgetFactory, Composite parent) {
    createDescription(parent, DatabaseViewsRepository.Column.Properties.TypeAttributes.length, DatabaseMessages.ColumnPropertiesEditionPart_LengthLabel);
    // $NON-NLS-1$
    length = widgetFactory.createText(parent, "");
    length.setData(FormToolkit.KEY_DRAW_BORDER, FormToolkit.TEXT_BORDER);
    widgetFactory.paintBordersFor(parent);
    GridData lengthData = new GridData(GridData.FILL_HORIZONTAL);
    length.setLayoutData(lengthData);
    length.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(ColumnPropertiesEditionPartForm.this, DatabaseViewsRepository.Column.Properties.TypeAttributes.length, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.SET, null, length.getText()));
                propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(ColumnPropertiesEditionPartForm.this, DatabaseViewsRepository.Column.Properties.TypeAttributes.length, PropertiesEditionEvent.FOCUS_CHANGED, PropertiesEditionEvent.FOCUS_LOST, null, length.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(ColumnPropertiesEditionPartForm.this, null, PropertiesEditionEvent.FOCUS_CHANGED, PropertiesEditionEvent.FOCUS_GAINED, null, null));
            }
        }
    });
    length.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(ColumnPropertiesEditionPartForm.this, DatabaseViewsRepository.Column.Properties.TypeAttributes.length, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.SET, null, length.getText()));
            }
        }
    });
    EditingUtils.setID(length, DatabaseViewsRepository.Column.Properties.TypeAttributes.length);
    // $NON-NLS-1$
    EditingUtils.setEEFtype(length, "eef::Text");
    // $NON-NLS-1$
    FormUtils.createHelpButton(widgetFactory, parent, propertiesEditionComponent.getHelpContent(DatabaseViewsRepository.Column.Properties.TypeAttributes.length, 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 40 with PropertiesEditionEvent

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

the class ColumnPropertiesEditionPartForm method createDefaultValueText.

protected Composite createDefaultValueText(FormToolkit widgetFactory, Composite parent) {
    createDescription(parent, DatabaseViewsRepository.Column.Properties.defaultValue, DatabaseMessages.ColumnPropertiesEditionPart_DefaultValueLabel);
    // $NON-NLS-1$
    defaultValue = widgetFactory.createText(parent, "");
    defaultValue.setData(FormToolkit.KEY_DRAW_BORDER, FormToolkit.TEXT_BORDER);
    widgetFactory.paintBordersFor(parent);
    GridData defaultValueData = new GridData(GridData.FILL_HORIZONTAL);
    defaultValue.setLayoutData(defaultValueData);
    defaultValue.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(ColumnPropertiesEditionPartForm.this, DatabaseViewsRepository.Column.Properties.defaultValue, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.SET, null, defaultValue.getText()));
                propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(ColumnPropertiesEditionPartForm.this, DatabaseViewsRepository.Column.Properties.defaultValue, PropertiesEditionEvent.FOCUS_CHANGED, PropertiesEditionEvent.FOCUS_LOST, null, defaultValue.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(ColumnPropertiesEditionPartForm.this, null, PropertiesEditionEvent.FOCUS_CHANGED, PropertiesEditionEvent.FOCUS_GAINED, null, null));
            }
        }
    });
    defaultValue.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(ColumnPropertiesEditionPartForm.this, DatabaseViewsRepository.Column.Properties.defaultValue, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.SET, null, defaultValue.getText()));
            }
        }
    });
    EditingUtils.setID(defaultValue, DatabaseViewsRepository.Column.Properties.defaultValue);
    // $NON-NLS-1$
    EditingUtils.setEEFtype(defaultValue, "eef::Text");
    // $NON-NLS-1$
    FormUtils.createHelpButton(widgetFactory, parent, propertiesEditionComponent.getHelpContent(DatabaseViewsRepository.Column.Properties.defaultValue, 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)

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