Search in sources :

Example 11 with PropertiesEditionEvent

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

the class IndexesPropertiesEditionPartImpl method createIndexesAdvancedTableComposition.

/**
 * @param container
 */
protected Composite createIndexesAdvancedTableComposition(Composite parent) {
    this.indexes = new ReferencesTable(getDescription(DatabaseViewsRepository.Indexes.Properties.indexes_, DatabaseMessages.IndexesPropertiesEditionPart_IndexesLabel), new ReferencesTableListener() {

        public void handleAdd() {
            propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(IndexesPropertiesEditionPartImpl.this, DatabaseViewsRepository.Indexes.Properties.indexes_, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.ADD, null, null));
            indexes.refresh();
        }

        public void handleEdit(EObject element) {
            propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(IndexesPropertiesEditionPartImpl.this, DatabaseViewsRepository.Indexes.Properties.indexes_, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.EDIT, null, element));
            indexes.refresh();
        }

        public void handleMove(EObject element, int oldIndex, int newIndex) {
            propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(IndexesPropertiesEditionPartImpl.this, DatabaseViewsRepository.Indexes.Properties.indexes_, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.MOVE, element, newIndex));
            indexes.refresh();
        }

        public void handleRemove(EObject element) {
            propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(IndexesPropertiesEditionPartImpl.this, DatabaseViewsRepository.Indexes.Properties.indexes_, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.REMOVE, null, element));
            indexes.refresh();
        }

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

        public void widgetSelected(SelectionEvent e) {
            if (e.item != null && e.item.getData() instanceof EObject) {
                propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(IndexesPropertiesEditionPartImpl.this, DatabaseViewsRepository.Indexes.Properties.indexes_, PropertiesEditionEvent.CHANGE, PropertiesEditionEvent.SELECTION_CHANGED, null, e.item.getData()));
            }
        }
    });
    GridData indexesData = new GridData(GridData.FILL_HORIZONTAL);
    indexesData.horizontalSpan = 3;
    this.indexes.setLayoutData(indexesData);
    this.indexes.setLowerBound(0);
    this.indexes.setUpperBound(-1);
    indexes.setID(DatabaseViewsRepository.Indexes.Properties.indexes_);
    // $NON-NLS-1$
    indexes.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 12 with PropertiesEditionEvent

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

the class PrimaryKeyPropertiesEditionPartImpl method addColumns.

/**
 */
protected void addColumns() {
    EMFModelViewerDialog dialog = new EMFModelViewerDialog(new AdapterFactoryLabelProvider(adapterFactory), columns.getInput(), columnsFilters, columnsBusinessFilters, false, true) {

        public void process(IStructuredSelection selection) {
            for (Iterator iter = selection.iterator(); iter.hasNext(); ) {
                EObject elem = (EObject) iter.next();
                propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(PrimaryKeyPropertiesEditionPartImpl.this, DatabaseViewsRepository.PrimaryKey.Properties.columns, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.ADD, null, elem));
            }
        }
    };
    dialog.open();
    // Start of user code for addColumns
    // End of user code
    columns.refresh();
}
Also used : EMFModelViewerDialog(org.eclipse.emf.eef.runtime.ui.widgets.EMFModelViewerDialog) EObject(org.eclipse.emf.ecore.EObject) Iterator(java.util.Iterator) 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) IStructuredSelection(org.eclipse.jface.viewers.IStructuredSelection)

Example 13 with PropertiesEditionEvent

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

the class PrimaryKeyPropertiesEditionPartImpl method createCommentsTextarea.

protected Composite createCommentsTextarea(Composite parent) {
    Label commentsLabel = createDescription(parent, DatabaseViewsRepository.PrimaryKey.Properties.comments, DatabaseMessages.PrimaryKeyPropertiesEditionPart_CommentsLabel);
    GridData commentsLabelData = new GridData(GridData.FILL_HORIZONTAL);
    commentsLabelData.horizontalSpan = 3;
    commentsLabel.setLayoutData(commentsLabelData);
    comments = SWTUtils.createScrollableText(parent, SWT.BORDER | SWT.WRAP | SWT.MULTI | SWT.V_SCROLL);
    GridData commentsData = new GridData(GridData.FILL_HORIZONTAL);
    commentsData.horizontalSpan = 2;
    commentsData.heightHint = 80;
    commentsData.widthHint = 200;
    comments.setLayoutData(commentsData);
    comments.addFocusListener(new FocusAdapter() {

        /**
         * {@inheritDoc}
         *
         * @see org.eclipse.swt.events.FocusAdapter#focusLost(org.eclipse.swt.events.FocusEvent)
         */
        public void focusLost(FocusEvent e) {
            if (propertiesEditionComponent != null)
                propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(PrimaryKeyPropertiesEditionPartImpl.this, DatabaseViewsRepository.PrimaryKey.Properties.comments, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.SET, null, comments.getText()));
        }
    });
    EditingUtils.setID(comments, DatabaseViewsRepository.PrimaryKey.Properties.comments);
    // $NON-NLS-1$
    EditingUtils.setEEFtype(comments, "eef::Textarea");
    // $NON-NLS-1$
    SWTUtils.createHelpButton(parent, propertiesEditionComponent.getHelpContent(DatabaseViewsRepository.PrimaryKey.Properties.comments, DatabaseViewsRepository.SWT_KIND), null);
    // End of user code
    return parent;
}
Also used : FocusAdapter(org.eclipse.swt.events.FocusAdapter) Label(org.eclipse.swt.widgets.Label) 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 14 with PropertiesEditionEvent

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

the class SequencePropertiesEditionPartImpl method createStartText.

protected Composite createStartText(Composite parent) {
    createDescription(parent, DatabaseViewsRepository.Sequence.Properties.StartIncrement.start, DatabaseMessages.SequencePropertiesEditionPart_StartLabel);
    start = SWTUtils.createScrollableText(parent, SWT.BORDER);
    GridData startData = new GridData(GridData.FILL_HORIZONTAL);
    start.setLayoutData(startData);
    start.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(SequencePropertiesEditionPartImpl.this, DatabaseViewsRepository.Sequence.Properties.StartIncrement.start, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.SET, null, start.getText()));
        }
    });
    start.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(SequencePropertiesEditionPartImpl.this, DatabaseViewsRepository.Sequence.Properties.StartIncrement.start, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.SET, null, start.getText()));
            }
        }
    });
    EditingUtils.setID(start, DatabaseViewsRepository.Sequence.Properties.StartIncrement.start);
    // $NON-NLS-1$
    EditingUtils.setEEFtype(start, "eef::Text");
    // $NON-NLS-1$
    SWTUtils.createHelpButton(parent, propertiesEditionComponent.getHelpContent(DatabaseViewsRepository.Sequence.Properties.StartIncrement.start, 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 15 with PropertiesEditionEvent

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

the class SequencePropertiesEditionPartImpl method createCycleCheckbox.

protected Composite createCycleCheckbox(Composite parent) {
    cycle = new Button(parent, SWT.CHECK);
    cycle.setText(getDescription(DatabaseViewsRepository.Sequence.Properties.CycleCacheSize.cycle, DatabaseMessages.SequencePropertiesEditionPart_CycleLabel));
    cycle.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(SequencePropertiesEditionPartImpl.this, DatabaseViewsRepository.Sequence.Properties.CycleCacheSize.cycle, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.SET, null, new Boolean(cycle.getSelection())));
        }
    });
    GridData cycleData = new GridData(GridData.FILL_HORIZONTAL);
    cycleData.horizontalSpan = 2;
    cycle.setLayoutData(cycleData);
    EditingUtils.setID(cycle, DatabaseViewsRepository.Sequence.Properties.CycleCacheSize.cycle);
    // $NON-NLS-1$
    EditingUtils.setEEFtype(cycle, "eef::Checkbox");
    // $NON-NLS-1$
    SWTUtils.createHelpButton(parent, propertiesEditionComponent.getHelpContent(DatabaseViewsRepository.Sequence.Properties.CycleCacheSize.cycle, DatabaseViewsRepository.SWT_KIND), null);
    // End of user code
    return parent;
}
Also used : Button(org.eclipse.swt.widgets.Button) 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)

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