Search in sources :

Example 1 with ExportAsImageWizard

use of com.archimatetool.editor.diagram.wizard.ExportAsImageWizard in project archi by archimatetool.

the class ExportAsImageAction method run.

@Override
public void run() {
    LayerManager layerManager = (LayerManager) fGraphicalViewer.getEditPartRegistry().get(LayerManager.ID);
    IFigure rootFigure = layerManager.getLayer(LayerConstants.PRINTABLE_LAYERS);
    String name = null;
    Object model = fGraphicalViewer.getContents().getModel();
    if (model instanceof INameable) {
        name = ((INameable) model).getName();
    }
    WizardDialog dialog = new ExtendedWizardDialog(fGraphicalViewer.getControl().getShell(), new ExportAsImageWizard(rootFigure, name), // $NON-NLS-1$
    "ExportAsImageWizard") {

        @Override
        protected void createButtonsForButtonBar(Composite parent) {
            // Change "Finish" to "Save"
            super.createButtonsForButtonBar(parent);
            Button b = getButton(IDialogConstants.FINISH_ID);
            b.setText(Messages.ExportAsImageAction_1);
        }
    };
    dialog.open();
}
Also used : ExtendedWizardDialog(com.archimatetool.editor.ui.components.ExtendedWizardDialog) ExportAsImageWizard(com.archimatetool.editor.diagram.wizard.ExportAsImageWizard) Composite(org.eclipse.swt.widgets.Composite) Button(org.eclipse.swt.widgets.Button) INameable(com.archimatetool.model.INameable) WizardDialog(org.eclipse.jface.wizard.WizardDialog) ExtendedWizardDialog(com.archimatetool.editor.ui.components.ExtendedWizardDialog) LayerManager(org.eclipse.gef.editparts.LayerManager) IFigure(org.eclipse.draw2d.IFigure)

Example 2 with ExportAsImageWizard

use of com.archimatetool.editor.diagram.wizard.ExportAsImageWizard in project archi by archimatetool.

the class ExportAsImageAction method run.

@Override
public void run() {
    String name = null;
    Object model = fGraphViewer.getInput();
    if (model instanceof INameable) {
        name = ((INameable) model).getName();
    }
    WizardDialog dialog = new ExtendedWizardDialog(fGraphViewer.getControl().getShell(), new ExportAsImageWizard(fGraphViewer.getGraphControl().getContents(), name), // $NON-NLS-1$
    "ExportZestViewAsImage") {

        @Override
        protected void createButtonsForButtonBar(Composite parent) {
            // Change "Finish" to "Save"
            super.createButtonsForButtonBar(parent);
            Button b = getButton(IDialogConstants.FINISH_ID);
            b.setText(Messages.ExportAsImageAction_3);
        }
    };
    dialog.open();
}
Also used : ExtendedWizardDialog(com.archimatetool.editor.ui.components.ExtendedWizardDialog) ExportAsImageWizard(com.archimatetool.editor.diagram.wizard.ExportAsImageWizard) Composite(org.eclipse.swt.widgets.Composite) Button(org.eclipse.swt.widgets.Button) INameable(com.archimatetool.model.INameable) WizardDialog(org.eclipse.jface.wizard.WizardDialog) ExtendedWizardDialog(com.archimatetool.editor.ui.components.ExtendedWizardDialog)

Aggregations

ExportAsImageWizard (com.archimatetool.editor.diagram.wizard.ExportAsImageWizard)2 ExtendedWizardDialog (com.archimatetool.editor.ui.components.ExtendedWizardDialog)2 INameable (com.archimatetool.model.INameable)2 WizardDialog (org.eclipse.jface.wizard.WizardDialog)2 Button (org.eclipse.swt.widgets.Button)2 Composite (org.eclipse.swt.widgets.Composite)2 IFigure (org.eclipse.draw2d.IFigure)1 LayerManager (org.eclipse.gef.editparts.LayerManager)1