Search in sources :

Example 56 with PropertiesEditionEvent

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

the class IndexElementPropertiesEditionPartForm method createAscCheckbox.

protected Composite createAscCheckbox(FormToolkit widgetFactory, Composite parent) {
    asc = widgetFactory.createButton(parent, getDescription(DatabaseViewsRepository.IndexElement.Properties.asc, DatabaseMessages.IndexElementPropertiesEditionPart_AscLabel), SWT.CHECK);
    asc.addSelectionListener(new SelectionAdapter() {

        /**
         * {@inheritDoc}
         *
         * @see org.eclipse.swt.events.SelectionAdapter#widgetSelected(org.eclipse.swt.events.SelectionEvent)
         */
        public void widgetSelected(SelectionEvent e) {
            if (propertiesEditionComponent != null)
                propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(IndexElementPropertiesEditionPartForm.this, DatabaseViewsRepository.IndexElement.Properties.asc, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.SET, null, new Boolean(asc.getSelection())));
        }
    });
    GridData ascData = new GridData(GridData.FILL_HORIZONTAL);
    ascData.horizontalSpan = 2;
    asc.setLayoutData(ascData);
    EditingUtils.setID(asc, DatabaseViewsRepository.IndexElement.Properties.asc);
    // $NON-NLS-1$
    EditingUtils.setEEFtype(asc, "eef::Checkbox");
    // $NON-NLS-1$
    FormUtils.createHelpButton(widgetFactory, parent, propertiesEditionComponent.getHelpContent(DatabaseViewsRepository.IndexElement.Properties.asc, DatabaseViewsRepository.FORM_KIND), null);
    // End of user code
    return parent;
}
Also used : 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)

Example 57 with PropertiesEditionEvent

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

the class IndexPropertiesEditionPartForm method createIndexTypeText.

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

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

the class PrimaryKeyPropertiesEditionPartForm method createNameText.

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

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

the class SchemaPropertiesEditionPartForm method createNameText.

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

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

the class FinalStatePropertiesEditionPartForm method createKeywordsMultiValuedEditor.

/**
 */
protected Composite createKeywordsMultiValuedEditor(FormToolkit widgetFactory, Composite parent) {
    // $NON-NLS-1$
    keywords = widgetFactory.createText(parent, "", SWT.READ_ONLY);
    GridData keywordsData = new GridData(GridData.FILL_HORIZONTAL);
    keywordsData.horizontalSpan = 2;
    keywords.setLayoutData(keywordsData);
    EditingUtils.setID(keywords, StatemachineViewsRepository.FinalState.Properties.keywords);
    // $NON-NLS-1$
    EditingUtils.setEEFtype(keywords, "eef::MultiValuedEditor::field");
    editKeywords = widgetFactory.createButton(parent, getDescription(StatemachineViewsRepository.FinalState.Properties.keywords, StatemachineMessages.FinalStatePropertiesEditionPart_KeywordsLabel), SWT.NONE);
    GridData editKeywordsData = new GridData();
    editKeywords.setLayoutData(editKeywordsData);
    editKeywords.addSelectionListener(new SelectionAdapter() {

        /**
         * {@inheritDoc}
         *
         * @see org.eclipse.swt.events.SelectionAdapter#widgetSelected(org.eclipse.swt.events.SelectionEvent)
         */
        public void widgetSelected(SelectionEvent e) {
            EEFFeatureEditorDialog dialog = new EEFFeatureEditorDialog(// $NON-NLS-1$
            keywords.getShell(), // $NON-NLS-1$
            "FinalState", // $NON-NLS-1$
            new AdapterFactoryLabelProvider(adapterFactory), keywordsList, EnvironmentPackage.eINSTANCE.getObeoDSMObject_Keywords().getEType(), null, false, true, null, null);
            if (dialog.open() == Window.OK) {
                keywordsList = dialog.getResult();
                if (keywordsList == null) {
                    keywordsList = new BasicEList();
                }
                keywords.setText(keywordsList.toString());
                propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(FinalStatePropertiesEditionPartForm.this, StatemachineViewsRepository.FinalState.Properties.keywords, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.SET, null, new BasicEList(keywordsList)));
                setHasChanged(true);
            }
        }
    });
    EditingUtils.setID(editKeywords, StatemachineViewsRepository.FinalState.Properties.keywords);
    // $NON-NLS-1$
    EditingUtils.setEEFtype(editKeywords, "eef::MultiValuedEditor::browsebutton");
    // End of user code
    return parent;
}
Also used : SelectionAdapter(org.eclipse.swt.events.SelectionAdapter) BasicEList(org.eclipse.emf.common.util.BasicEList) GridData(org.eclipse.swt.layout.GridData) SelectionEvent(org.eclipse.swt.events.SelectionEvent) AdapterFactoryLabelProvider(org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider) IPropertiesEditionEvent(org.eclipse.emf.eef.runtime.api.notify.IPropertiesEditionEvent) PropertiesEditionEvent(org.eclipse.emf.eef.runtime.impl.notify.PropertiesEditionEvent) EEFFeatureEditorDialog(org.eclipse.emf.eef.runtime.ui.widgets.EEFFeatureEditorDialog)

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