Search in sources :

Example 1 with IFeatures

use of com.archimatetool.model.IFeatures in project archi by archimatetool.

the class IconVisibleSection method createControls.

@Override
protected void createControls(Composite parent) {
    // $NON-NLS-1$
    createLabel(parent, Messages.IconVisibleSection_0 + ":", ITabbedLayoutConstants.STANDARD_LABEL_WIDTH, SWT.CENTER);
    fIconVisibleCombo = new Combo(parent, SWT.READ_ONLY);
    getWidgetFactory().adapt(fIconVisibleCombo, true, true);
    fIconVisibleCombo.setItems(VISIBLE_CHOICES);
    fIconVisibleCombo.addSelectionListener(new SelectionAdapter() {

        @Override
        public void widgetSelected(SelectionEvent e) {
            CompoundCommand result = new CompoundCommand();
            for (EObject selected : getEObjects()) {
                if (isAlive(selected)) {
                    Command cmd = new FeatureCommand(Messages.IconVisibleSection_0, (IFeatures) selected, IDiagramModelObject.FEATURE_ICON_VISIBLE, mapFromComboToValue(), IDiagramModelObject.FEATURE_ICON_VISIBLE_DEFAULT);
                    if (cmd.canExecute()) {
                        result.add(cmd);
                    }
                }
            }
            executeCommand(result.unwrap());
        }
    });
    // Help
    PlatformUI.getWorkbench().getHelpSystem().setHelp(parent, HELP_ID);
}
Also used : FeatureCommand(com.archimatetool.editor.model.commands.FeatureCommand) CompoundCommand(org.eclipse.gef.commands.CompoundCommand) FeatureCommand(com.archimatetool.editor.model.commands.FeatureCommand) Command(org.eclipse.gef.commands.Command) SelectionAdapter(org.eclipse.swt.events.SelectionAdapter) EObject(org.eclipse.emf.ecore.EObject) SelectionEvent(org.eclipse.swt.events.SelectionEvent) Combo(org.eclipse.swt.widgets.Combo) IFeatures(com.archimatetool.model.IFeatures) CompoundCommand(org.eclipse.gef.commands.CompoundCommand)

Example 2 with IFeatures

use of com.archimatetool.model.IFeatures in project archi by archimatetool.

the class ImageSourceSection method createControls.

@Override
protected void createControls(Composite parent) {
    createLabel(parent, Messages.ImageSourceSection_3, ITabbedLayoutConstants.STANDARD_LABEL_WIDTH, SWT.CENTER);
    fImageSourceCombo = new Combo(parent, SWT.READ_ONLY);
    getWidgetFactory().adapt(fImageSourceCombo, true, true);
    fImageSourceCombo.setItems(IMAGE_SOURCE_CHOICES);
    fImageSourceCombo.addSelectionListener(new SelectionAdapter() {

        @Override
        public void widgetSelected(SelectionEvent e) {
            CompoundCommand result = new CompoundCommand();
            for (EObject selected : getEObjects()) {
                if (isAlive(selected)) {
                    Command cmd = new FeatureCommand(Messages.ImageSourceSection_2, (IFeatures) selected, IDiagramModelArchimateObject.FEATURE_IMAGE_SOURCE, mapFromComboToValue(), IDiagramModelArchimateObject.FEATURE_IMAGE_SOURCE_DEFAULT);
                    if (cmd.canExecute()) {
                        result.add(cmd);
                    }
                }
            }
            executeCommand(result.unwrap());
        }
    });
    // Help
    PlatformUI.getWorkbench().getHelpSystem().setHelp(parent, HELP_ID);
}
Also used : FeatureCommand(com.archimatetool.editor.model.commands.FeatureCommand) CompoundCommand(org.eclipse.gef.commands.CompoundCommand) FeatureCommand(com.archimatetool.editor.model.commands.FeatureCommand) Command(org.eclipse.gef.commands.Command) SelectionAdapter(org.eclipse.swt.events.SelectionAdapter) EObject(org.eclipse.emf.ecore.EObject) SelectionEvent(org.eclipse.swt.events.SelectionEvent) Combo(org.eclipse.swt.widgets.Combo) IFeatures(com.archimatetool.model.IFeatures) CompoundCommand(org.eclipse.gef.commands.CompoundCommand)

Example 3 with IFeatures

use of com.archimatetool.model.IFeatures in project archi by archimatetool.

the class JunctionConnectionArrowsSection method createHideArrowsControl.

private void createHideArrowsControl(Composite parent) {
    // $NON-NLS-1$
    createLabel(parent, Messages.JunctionConnectionArrowsSection_0 + ":", ITabbedLayoutConstants.STANDARD_LABEL_WIDTH, SWT.CENTER);
    buttonHideArrowHeads = getWidgetFactory().createButton(parent, null, SWT.CHECK);
    buttonHideArrowHeads.addSelectionListener(new SelectionAdapter() {

        @Override
        public void widgetSelected(SelectionEvent e) {
            CompoundCommand result = new CompoundCommand();
            for (EObject junctionObject : getEObjects()) {
                if (isAlive(junctionObject)) {
                    Command cmd = new FeatureCommand(Messages.JunctionConnectionArrowsSection_1, (IFeatures) junctionObject, IDiagramModelArchimateObject.FEATURE_HIDE_JUNCTION_ARROWS, buttonHideArrowHeads.getSelection(), IDiagramModelArchimateObject.FEATURE_HIDE_JUNCTION_ARROWS_DEFAULT);
                    if (cmd.canExecute()) {
                        result.add(cmd);
                    }
                }
            }
            executeCommand(result.unwrap());
        }
    });
}
Also used : FeatureCommand(com.archimatetool.editor.model.commands.FeatureCommand) CompoundCommand(org.eclipse.gef.commands.CompoundCommand) FeatureCommand(com.archimatetool.editor.model.commands.FeatureCommand) Command(org.eclipse.gef.commands.Command) SelectionAdapter(org.eclipse.swt.events.SelectionAdapter) EObject(org.eclipse.emf.ecore.EObject) SelectionEvent(org.eclipse.swt.events.SelectionEvent) IFeatures(com.archimatetool.model.IFeatures) CompoundCommand(org.eclipse.gef.commands.CompoundCommand)

Example 4 with IFeatures

use of com.archimatetool.model.IFeatures in project archi by archimatetool.

the class LabelRendererSection method createControls.

@Override
protected void createControls(Composite parent) {
    createLabel(parent, Messages.LabelRendererSection_0, ITabbedLayoutConstants.STANDARD_LABEL_WIDTH, SWT.NONE);
    StyledTextControl styledTextControl = createStyledTextControl(parent, SWT.NONE);
    styledTextControl.setMessage(Messages.LabelRendererSection_1);
    fTextRender = new PropertySectionTextControl(styledTextControl.getControl(), TextRenderer.FEATURE_NAME) {

        @Override
        protected void textChanged(String oldText, String newText) {
            CompoundCommand result = new CompoundCommand();
            for (EObject eObject : getEObjects()) {
                if (isAlive(eObject)) {
                    // $NON-NLS-1$
                    Command cmd = new FeatureCommand(Messages.LabelRendererSection_2, (IFeatures) eObject, TextRenderer.FEATURE_NAME, newText, "");
                    if (cmd.canExecute()) {
                        result.add(cmd);
                    }
                }
            }
            executeCommand(result.unwrap());
        }
    };
    // Help ID
    PlatformUI.getWorkbench().getHelpSystem().setHelp(parent, HELP_ID);
}
Also used : FeatureCommand(com.archimatetool.editor.model.commands.FeatureCommand) StyledTextControl(com.archimatetool.editor.ui.components.StyledTextControl) CompoundCommand(org.eclipse.gef.commands.CompoundCommand) FeatureCommand(com.archimatetool.editor.model.commands.FeatureCommand) Command(org.eclipse.gef.commands.Command) EObject(org.eclipse.emf.ecore.EObject) IFeatures(com.archimatetool.model.IFeatures) CompoundCommand(org.eclipse.gef.commands.CompoundCommand)

Example 5 with IFeatures

use of com.archimatetool.model.IFeatures in project archi by archimatetool.

the class DiagramConnectionSection method createDisplayNameControl.

private void createDisplayNameControl(Composite parent) {
    // $NON-NLS-1$
    createLabel(parent, Messages.DiagramConnectionSection_8 + ":", ITabbedLayoutConstants.STANDARD_LABEL_WIDTH, SWT.CENTER);
    fButtonDisplayName = getWidgetFactory().createButton(parent, null, SWT.CHECK);
    fButtonDisplayName.addSelectionListener(new SelectionAdapter() {

        @Override
        public void widgetSelected(SelectionEvent e) {
            CompoundCommand result = new CompoundCommand();
            for (EObject connection : getEObjects()) {
                if (isAlive(connection)) {
                    Command cmd = new FeatureCommand(Messages.DiagramConnectionSection_8, (IFeatures) connection, IDiagramModelConnection.FEATURE_NAME_VISIBLE, fButtonDisplayName.getSelection(), IDiagramModelConnection.FEATURE_NAME_VISIBLE_DEFAULT);
                    if (cmd.canExecute()) {
                        result.add(cmd);
                    }
                }
            }
            executeCommand(result.unwrap());
        }
    });
}
Also used : FeatureCommand(com.archimatetool.editor.model.commands.FeatureCommand) LineWidthCommand(com.archimatetool.editor.diagram.commands.LineWidthCommand) CompoundCommand(org.eclipse.gef.commands.CompoundCommand) ConnectionTextPositionCommand(com.archimatetool.editor.diagram.commands.ConnectionTextPositionCommand) FeatureCommand(com.archimatetool.editor.model.commands.FeatureCommand) Command(org.eclipse.gef.commands.Command) SelectionAdapter(org.eclipse.swt.events.SelectionAdapter) EObject(org.eclipse.emf.ecore.EObject) SelectionEvent(org.eclipse.swt.events.SelectionEvent) IFeatures(com.archimatetool.model.IFeatures) CompoundCommand(org.eclipse.gef.commands.CompoundCommand)

Aggregations

FeatureCommand (com.archimatetool.editor.model.commands.FeatureCommand)6 IFeatures (com.archimatetool.model.IFeatures)6 EObject (org.eclipse.emf.ecore.EObject)6 Command (org.eclipse.gef.commands.Command)6 CompoundCommand (org.eclipse.gef.commands.CompoundCommand)6 SelectionAdapter (org.eclipse.swt.events.SelectionAdapter)5 SelectionEvent (org.eclipse.swt.events.SelectionEvent)5 Combo (org.eclipse.swt.widgets.Combo)3 ConnectionTextPositionCommand (com.archimatetool.editor.diagram.commands.ConnectionTextPositionCommand)1 LineWidthCommand (com.archimatetool.editor.diagram.commands.LineWidthCommand)1 StyledTextControl (com.archimatetool.editor.ui.components.StyledTextControl)1