Search in sources :

Example 6 with EEFFeatureEditorDialog

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

the class StatePropertiesEditionPartImpl method createKeywordsMultiValuedEditor.

protected Composite createKeywordsMultiValuedEditor(Composite parent) {
    keywords = SWTUtils.createScrollableText(parent, SWT.BORDER | SWT.READ_ONLY);
    GridData keywordsData = new GridData(GridData.FILL_HORIZONTAL);
    keywordsData.horizontalSpan = 2;
    keywords.setLayoutData(keywordsData);
    EditingUtils.setID(keywords, StatemachineViewsRepository.State.Properties.keywords);
    // $NON-NLS-1$
    EditingUtils.setEEFtype(keywords, "eef::MultiValuedEditor::field");
    editKeywords = new Button(parent, SWT.NONE);
    editKeywords.setText(getDescription(StatemachineViewsRepository.State.Properties.keywords, StatemachineMessages.StatePropertiesEditionPart_KeywordsLabel));
    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$
            "State", // $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(StatePropertiesEditionPartImpl.this, StatemachineViewsRepository.State.Properties.keywords, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.SET, null, new BasicEList(keywordsList)));
                setHasChanged(true);
            }
        }
    });
    EditingUtils.setID(editKeywords, StatemachineViewsRepository.State.Properties.keywords);
    // $NON-NLS-1$
    EditingUtils.setEEFtype(editKeywords, "eef::MultiValuedEditor::browsebutton");
    // End of user code
    return parent;
}
Also used : Button(org.eclipse.swt.widgets.Button) 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)

Example 7 with EEFFeatureEditorDialog

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

the class TransitionPropertiesEditionPartImpl method createKeywordsMultiValuedEditor.

protected Composite createKeywordsMultiValuedEditor(Composite parent) {
    keywords = SWTUtils.createScrollableText(parent, SWT.BORDER | SWT.READ_ONLY);
    GridData keywordsData = new GridData(GridData.FILL_HORIZONTAL);
    keywordsData.horizontalSpan = 2;
    keywords.setLayoutData(keywordsData);
    EditingUtils.setID(keywords, StatemachineViewsRepository.Transition.Properties.keywords);
    // $NON-NLS-1$
    EditingUtils.setEEFtype(keywords, "eef::MultiValuedEditor::field");
    editKeywords = new Button(parent, SWT.NONE);
    editKeywords.setText(getDescription(StatemachineViewsRepository.Transition.Properties.keywords, StatemachineMessages.TransitionPropertiesEditionPart_KeywordsLabel));
    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$
            "Transition", // $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(TransitionPropertiesEditionPartImpl.this, StatemachineViewsRepository.Transition.Properties.keywords, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.SET, null, new BasicEList(keywordsList)));
                setHasChanged(true);
            }
        }
    });
    EditingUtils.setID(editKeywords, StatemachineViewsRepository.Transition.Properties.keywords);
    // $NON-NLS-1$
    EditingUtils.setEEFtype(editKeywords, "eef::MultiValuedEditor::browsebutton");
    // End of user code
    return parent;
}
Also used : Button(org.eclipse.swt.widgets.Button) 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)

Example 8 with EEFFeatureEditorDialog

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

the class TypeInstancePropertiesEditionPartImpl method createLiteralsMultiValuedEditor.

protected Composite createLiteralsMultiValuedEditor(Composite parent) {
    literals = SWTUtils.createScrollableText(parent, SWT.BORDER | SWT.READ_ONLY);
    GridData literalsData = new GridData(GridData.FILL_HORIZONTAL);
    literalsData.horizontalSpan = 2;
    literals.setLayoutData(literalsData);
    EditingUtils.setID(literals, TypeslibraryViewsRepository.TypeInstance.Properties.literals);
    // $NON-NLS-1$
    EditingUtils.setEEFtype(literals, "eef::MultiValuedEditor::field");
    editLiterals = new Button(parent, SWT.NONE);
    editLiterals.setText(getDescription(TypeslibraryViewsRepository.TypeInstance.Properties.literals, TypeslibraryMessages.TypeInstancePropertiesEditionPart_LiteralsLabel));
    GridData editLiteralsData = new GridData();
    editLiterals.setLayoutData(editLiteralsData);
    editLiterals.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$
            literals.getShell(), // $NON-NLS-1$
            "TypeInstance", // $NON-NLS-1$
            new AdapterFactoryLabelProvider(adapterFactory), literalsList, TypesLibraryPackage.eINSTANCE.getTypeInstance_Literals().getEType(), null, false, true, null, null);
            if (dialog.open() == Window.OK) {
                literalsList = dialog.getResult();
                if (literalsList == null) {
                    literalsList = new BasicEList();
                }
                literals.setText(literalsList.toString());
                propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(TypeInstancePropertiesEditionPartImpl.this, TypeslibraryViewsRepository.TypeInstance.Properties.literals, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.SET, null, new BasicEList(literalsList)));
                setHasChanged(true);
            }
        }
    });
    EditingUtils.setID(editLiterals, TypeslibraryViewsRepository.TypeInstance.Properties.literals);
    // $NON-NLS-1$
    EditingUtils.setEEFtype(editLiterals, "eef::MultiValuedEditor::browsebutton");
    // End of user code
    return parent;
}
Also used : Button(org.eclipse.swt.widgets.Button) 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)

Example 9 with EEFFeatureEditorDialog

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

the class ColumnPropertiesEditionPartImpl method createLiteralsMultiValuedEditor.

protected Composite createLiteralsMultiValuedEditor(Composite parent) {
    literals = SWTUtils.createScrollableText(parent, SWT.BORDER | SWT.READ_ONLY);
    GridData literalsData = new GridData(GridData.FILL_HORIZONTAL);
    literalsData.horizontalSpan = 2;
    literals.setLayoutData(literalsData);
    EditingUtils.setID(literals, DatabaseViewsRepository.Column.Properties.literals);
    // $NON-NLS-1$
    EditingUtils.setEEFtype(literals, "eef::MultiValuedEditor::field");
    editLiterals = new Button(parent, SWT.NONE);
    editLiterals.setText(getDescription(DatabaseViewsRepository.Column.Properties.literals, DatabaseMessages.ColumnPropertiesEditionPart_LiteralsLabel));
    GridData editLiteralsData = new GridData();
    editLiterals.setLayoutData(editLiteralsData);
    editLiterals.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$
            literals.getShell(), // $NON-NLS-1$
            "Column", // $NON-NLS-1$
            new AdapterFactoryLabelProvider(adapterFactory), literalsList, TypesLibraryPackage.eINSTANCE.getTypeInstance_Literals().getEType(), null, false, true, null, null);
            if (dialog.open() == Window.OK) {
                literalsList = dialog.getResult();
                if (literalsList == null) {
                    literalsList = new BasicEList();
                }
                literals.setText(literalsList.toString());
                propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(ColumnPropertiesEditionPartImpl.this, DatabaseViewsRepository.Column.Properties.literals, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.SET, null, new BasicEList(literalsList)));
                setHasChanged(true);
            }
        }
    });
    EditingUtils.setID(editLiterals, DatabaseViewsRepository.Column.Properties.literals);
    // $NON-NLS-1$
    EditingUtils.setEEFtype(editLiterals, "eef::MultiValuedEditor::browsebutton");
    // End of user code
    return parent;
}
Also used : Button(org.eclipse.swt.widgets.Button) 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)

Example 10 with EEFFeatureEditorDialog

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

the class TypeInstancePropertiesEditionPartForm method createLiteralsMultiValuedEditor.

/**
 */
protected Composite createLiteralsMultiValuedEditor(FormToolkit widgetFactory, Composite parent) {
    // $NON-NLS-1$
    literals = widgetFactory.createText(parent, "", SWT.READ_ONLY);
    GridData literalsData = new GridData(GridData.FILL_HORIZONTAL);
    literalsData.horizontalSpan = 2;
    literals.setLayoutData(literalsData);
    EditingUtils.setID(literals, TypeslibraryViewsRepository.TypeInstance.Properties.literals);
    // $NON-NLS-1$
    EditingUtils.setEEFtype(literals, "eef::MultiValuedEditor::field");
    editLiterals = widgetFactory.createButton(parent, getDescription(TypeslibraryViewsRepository.TypeInstance.Properties.literals, TypeslibraryMessages.TypeInstancePropertiesEditionPart_LiteralsLabel), SWT.NONE);
    GridData editLiteralsData = new GridData();
    editLiterals.setLayoutData(editLiteralsData);
    editLiterals.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$
            literals.getShell(), // $NON-NLS-1$
            "TypeInstance", // $NON-NLS-1$
            new AdapterFactoryLabelProvider(adapterFactory), literalsList, TypesLibraryPackage.eINSTANCE.getTypeInstance_Literals().getEType(), null, false, true, null, null);
            if (dialog.open() == Window.OK) {
                literalsList = dialog.getResult();
                if (literalsList == null) {
                    literalsList = new BasicEList();
                }
                literals.setText(literalsList.toString());
                propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(TypeInstancePropertiesEditionPartForm.this, TypeslibraryViewsRepository.TypeInstance.Properties.literals, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.SET, null, new BasicEList(literalsList)));
                setHasChanged(true);
            }
        }
    });
    EditingUtils.setID(editLiterals, TypeslibraryViewsRepository.TypeInstance.Properties.literals);
    // $NON-NLS-1$
    EditingUtils.setEEFtype(editLiterals, "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

BasicEList (org.eclipse.emf.common.util.BasicEList)16 AdapterFactoryLabelProvider (org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider)16 IPropertiesEditionEvent (org.eclipse.emf.eef.runtime.api.notify.IPropertiesEditionEvent)16 PropertiesEditionEvent (org.eclipse.emf.eef.runtime.impl.notify.PropertiesEditionEvent)16 EEFFeatureEditorDialog (org.eclipse.emf.eef.runtime.ui.widgets.EEFFeatureEditorDialog)16 SelectionAdapter (org.eclipse.swt.events.SelectionAdapter)16 SelectionEvent (org.eclipse.swt.events.SelectionEvent)16 GridData (org.eclipse.swt.layout.GridData)16 Button (org.eclipse.swt.widgets.Button)8