Example usage for org.eclipse.jface.wizard WizardDialog setMessage

List of usage examples for org.eclipse.jface.wizard WizardDialog setMessage

Introduction

In this page you can find the example usage for org.eclipse.jface.wizard WizardDialog setMessage.

Prototype

public void setMessage(String newMessage) 

Source Link

Document

Set the message text.

Usage

From source file:cn.cstv.wspscm.commands.SetConstraintOfLineConnectionCommand.java

License:Open Source License

public void execute() {
    //       InputDialog dlg = new InputDialog(shell, "Gef Practice", "New node's name:", "Node", null);
    //       if (Window.OK == dlg.open()) {
    //           value = dlg.getValue();
    //       }/*w  w w.  ja  v a 2 s. co m*/
    if (typeOfConstraint.equals("Strict")) {
        lineConnection.setIsStrict_int(1);
    } else {
        CreateConstraintOfLineConnectionWizard wizard = new CreateConstraintOfLineConnectionWizard(
                typeOfConstraint);
        WizardDialog dialog = new WizardDialog(shell, wizard);
        dialog.create();
        dialog.getShell().setSize(280, 325);

        dialog.setTitle("Set Constraint Wizard");
        dialog.setMessage("Set " + typeOfConstraint);
        if (dialog.open() == WizardDialog.OK) {
            pastOrFuture = wizard.getPastOrFuture();
            value = wizard.getValue();
            constraint = wizard.getConstraint();
            reset = wizard.getReset();
        }

        if (typeOfConstraint.equals("PresentConstraint")) {
            oldValue = lineConnection.getPresentConstraintValue();
            oldConstraint = lineConnection.getPresentConstraintConstraint();
            oldReset = lineConnection.getPresentConstraintReset();
            lineConnection.setPresentConstraintValue(value);
            lineConnection.setPresentConstraintConstraint(constraint);
            lineConnection.setPresentConstraintReset(reset);
        } else if (typeOfConstraint.equals("BooleanConstraint")) {
            if (pastOrFuture.equals("Past")) {
                oldValue = lineConnection.getPastUnwantedMessageConstraintValue();
                oldConstraint = lineConnection.getPastUnwantedMessageConstraintConstraint();
                oldReset = lineConnection.getPastUnwantedMessageConstraintReset();
                lineConnection.setPastUnwantedMessageConstraintValue(value);
                lineConnection.setPastUnwantedMessageConstraintConstraint(constraint);
                lineConnection.setPastUnwantedMessageConstraintReset(reset);
            } else if (pastOrFuture.equals("Future")) {
                oldValue = lineConnection.getFutureUnwantedMessageConstraintValue();
                oldConstraint = lineConnection.getFutureUnwantedMessageConstraintConstraint();
                oldReset = lineConnection.getFutureUnwantedMessageConstraintReset();
                lineConnection.setFutureUnwantedMessageConstraintValue(value);
                lineConnection.setFutureUnwantedMessageConstraintConstraint(constraint);
                lineConnection.setFutureUnwantedMessageConstraintReset(reset);
            }
        } else if (typeOfConstraint.equals("UnwantedMessageConstraint")) {
            if (pastOrFuture.equals("Past")) {
                oldValue = lineConnection.getPastUnwantedMessageConstraintValue();
                oldConstraint = lineConnection.getPastUnwantedMessageConstraintConstraint();
                oldReset = lineConnection.getPastUnwantedMessageConstraintReset();
                lineConnection.setPastUnwantedMessageConstraintValue(value);
                lineConnection.setPastUnwantedMessageConstraintConstraint(constraint);
                lineConnection.setPastUnwantedMessageConstraintReset(reset);
            } else if (pastOrFuture.equals("Future")) {
                oldValue = lineConnection.getFutureUnwantedMessageConstraintValue();
                oldConstraint = lineConnection.getFutureUnwantedMessageConstraintConstraint();
                oldReset = lineConnection.getFutureUnwantedMessageConstraintReset();
                lineConnection.setFutureUnwantedMessageConstraintValue(value);
                lineConnection.setFutureUnwantedMessageConstraintConstraint(constraint);
                lineConnection.setFutureUnwantedMessageConstraintReset(reset);
            }
        } else if (typeOfConstraint.equals("Present")) {
            if (pastOrFuture.equals("Past")) {
                oldValue = lineConnection.getPresentPastValue();
                oldConstraint = lineConnection.getPresentPastConstraint();
                oldReset = lineConnection.getPresentPastReset();
                lineConnection.setPresentPastValue(value);
                lineConnection.setPresentPastConstraint(constraint);
                lineConnection.setPresentPastReset(reset);
            } else if (pastOrFuture.equals("Future")) {
                oldValue = lineConnection.getPresentFutureValue();
                oldConstraint = lineConnection.getPresentFutureConstraint();
                oldReset = lineConnection.getPresentFutureReset();
                lineConnection.setPresentFutureValue(value);
                lineConnection.setPresentFutureConstraint(constraint);
                lineConnection.setPresentFutureReset(reset);
            }
        } else if (typeOfConstraint.equals("WantedChainConstraint")) {
            if (pastOrFuture.equals("Past")) {
                oldValue = lineConnection.getPastWantedChainConstraintValue();
                oldConstraint = lineConnection.getPastWantedChainConstraintConstraint();
                oldReset = lineConnection.getPastWantedChainConstraintReset();
                lineConnection.setPastWantedChainConstraintValue(value);
                lineConnection.setPastWantedChainConstraintConstraint(constraint);
                lineConnection.setPastWantedChainConstraintReset(reset);
            } else if (pastOrFuture.equals("Future")) {
                oldValue = lineConnection.getFutureWantedChainConstraintValue();
                oldConstraint = lineConnection.getFutureWantedChainConstraintConstraint();
                oldReset = lineConnection.getFutureWantedChainConstraintReset();
                lineConnection.setFutureWantedChainConstraintValue(value);
                lineConnection.setFutureWantedChainConstraintConstraint(constraint);
                lineConnection.setFutureWantedChainConstraintReset(reset);
            }
        } else if (typeOfConstraint.equals("UnwantedChainConstraint")) {
            if (pastOrFuture.equals("Past")) {
                oldValue = lineConnection.getPastUnwantedChainConstraintValue();
                oldConstraint = lineConnection.getPastUnwantedChainConstraintConstraint();
                oldReset = lineConnection.getPastUnwantedChainConstraintReset();
                lineConnection.setPastUnwantedChainConstraintValue(value);
                lineConnection.setPastUnwantedChainConstraintConstraint(constraint);
                lineConnection.setPastUnwantedChainConstraintReset(reset);
            } else if (pastOrFuture.equals("Future")) {
                oldValue = lineConnection.getFutureUnwantedChainConstraintValue();
                oldConstraint = lineConnection.getFutureUnwantedChainConstraintConstraint();
                oldReset = lineConnection.getFutureUnwantedChainConstraintReset();
                lineConnection.setFutureUnwantedChainConstraintValue(value);
                lineConnection.setFutureUnwantedChainConstraintConstraint(constraint);
                lineConnection.setFutureUnwantedChainConstraintReset(reset);
            }
        }

    }

}

From source file:com.mercatis.lighthouse3.ui.status.handler.EditErrorTemplateHandler.java

License:Apache License

@Override
protected void execute(Object element) throws ExecutionException {
    if (element instanceof StatusEditingObject) {
        StatusEditingObject statusEditingObject = (StatusEditingObject) element;
        final Status status = statusEditingObject.getStatus();
        LighthouseDomain lighthouseDomain = CommonBaseActivator.getPlugin().getStatusService()
                .getLighthouseDomainForEntity(status);

        TemplateEditor wizard = new TemplateEditor(lighthouseDomain, status.getErrorTemplate());
        WizardDialog dialog = new WizardDialog(Display.getCurrent().getActiveShell(), wizard);
        dialog.create();/*from  w  ww.  j a va 2s .c o m*/
        dialog.getShell().setText("Template editor");
        dialog.setTitle("Edit Error template on " + LabelConverter.getLabel(status));
        dialog.setMessage("An event matching this template will result in an erroneous status.");
        if (dialog.open() == Window.OK) {
            BusyIndicator.showWhile(null, new Runnable() {
                public void run() {
                    CommonBaseActivator.getPlugin().getStatusService().updateStatus(status);
                }
            });
        }
    }
}

From source file:com.mercatis.lighthouse3.ui.status.handler.EditNotificationSettingsHandler.java

License:Apache License

@Override
protected void execute(Object element) throws ExecutionException {
    if (element instanceof StatusEditingObject) {
        StatusEditingObject statusEditingObject = (StatusEditingObject) element;
        final Status status = statusEditingObject.getStatus();
        LighthouseDomain lighthouseDomain = CommonBaseActivator.getPlugin().getStatusService()
                .getLighthouseDomainForEntity(status);

        StatusNotificationEditor wizard = new StatusNotificationEditor(lighthouseDomain, status);
        WizardDialog dialog = new WizardDialog(Display.getCurrent().getActiveShell(), wizard);
        dialog.create();/*  w w w .j  a va  2  s  . c  o m*/
        dialog.getShell().setText("Status Notification Editor");
        dialog.setTitle("Edit status notification template on " + LabelConverter.getLabel(status));
        dialog.setMessage("Please provide information about the receiver and the email templates.");
        if (dialog.open() == Window.OK) {
            BusyIndicator.showWhile(null, new Runnable() {
                public void run() {
                    CommonBaseActivator.getPlugin().getStatusService().updateStatus(status);
                }
            });
        }
    }
}

From source file:com.mercatis.lighthouse3.ui.status.handler.EditOkTemplateHandler.java

License:Apache License

@Override
protected void execute(Object element) throws ExecutionException {
    if (element instanceof StatusEditingObject) {
        StatusEditingObject statusEditingObject = (StatusEditingObject) element;
        final Status status = statusEditingObject.getStatus();
        LighthouseDomain lighthouseDomain = CommonBaseActivator.getPlugin().getStatusService()
                .getLighthouseDomainForEntity(status);

        TemplateEditor wizard = new TemplateEditor(lighthouseDomain, status.getOkTemplate());
        WizardDialog dialog = new WizardDialog(Display.getCurrent().getActiveShell(), wizard);
        dialog.create();//from   w  ww  . j a v a 2  s .  c o  m
        dialog.getShell().setText("Template editor");
        dialog.setTitle("Edit OK template on " + LabelConverter.getLabel(status));
        dialog.setMessage("An event matching this template will result in an ok status.");
        if (dialog.open() == Window.OK) {
            BusyIndicator.showWhile(null, new Runnable() {
                public void run() {
                    CommonBaseActivator.getPlugin().getStatusService().updateStatus(status);
                }
            });
        }
    }
}

From source file:com.versant.core.jdo.tools.plugins.eclipse.views.BaseExplorer.java

License:Open Source License

protected void makeActions() {
    actAddJDONature = new Action() {
        public void run() {
            IProject iProject = getSelectedIProject();
            if (iProject != null) {
                try {
                    VOAAddNatureDialog wizard = new VOAAddNatureDialog(iProject);
                    WizardDialog dialog = new WizardDialog(getSite().getShell(), wizard);
                    PixelConverter converter = new PixelConverter(JavaPlugin.getActiveWorkbenchShell());

                    dialog.setMinimumPageSize(converter.convertWidthInCharsToPixels(70),
                            converter.convertHeightInCharsToPixels(20));
                    dialog.create();//from   w  w w  .  j a va  2  s .  c o m
                    int res = dialog.open();
                    if (res == Window.OK) {
                        IJavaProject iJavaProject = JavaModelManager.getJavaModelManager().getJavaModel()
                                .findJavaProject(iProject);
                        Utils.addJDONature(iJavaProject);
                    }
                    notifyResult(res == Window.OK);
                } catch (Exception x) {
                    VOAToolsPlugin.log(x, "Problems opening Mapping editor.");
                }
                refreshTree(false, true);
            }
        }
    };
    actAddJDONature.setText("Add VOA Nature");
    actAddJDONature.setToolTipText("Add VOA Nature");

    actRemoveJDONature = new Action() {
        public void run() {
            IProject iProject = getSelectedIProject();
            if (iProject != null) {
                IJavaProject iJavaProject = JavaModelManager.getJavaModelManager().getJavaModel()
                        .findJavaProject(iProject);
                RemoveJDONature.removeJDONature(iJavaProject);
                VOAProjectControler.removeInstance(iProject);
                refreshTree(false, true);
            }
        }
    };
    actRemoveJDONature.setText("Remove VOA Nature");
    actRemoveJDONature.setToolTipText("Remove VOA Nature");

    actEnhance = new Action() {
        public void run() {
            EnhanceAction.enhance(getSelectedIProject());
        }
    };
    actEnhance.setText("Enhance Classes");
    actEnhance.setToolTipText("Enhance Classes");

    actAddClass = new Action() {
        public void run() {
            try {
                IProject iProject = getSelectedIProjectInTree();
                if (iProject == null) {
                    return;
                }

                IJavaProject iJavaProject = JavaModelManager.getJavaModelManager().getJavaModel()
                        .findJavaProject(iProject);
                IPackageFragmentRoot[] roots = iJavaProject.getAllPackageFragmentRoots();
                ArrayList elementList = new ArrayList();
                for (int x = 0; x < roots.length; x++) {
                    IPackageFragmentRoot root = roots[x];
                    if (root.getKind() == IPackageFragmentRoot.K_SOURCE) {
                        elementList.addAll(Arrays.asList(root.getChildren()));
                    }
                }
                IJavaElement[] elements = new IJavaElement[elementList.size()];
                elementList.toArray(elements);
                IJavaSearchScope scope = SearchEngine.createJavaSearchScope(elements);
                SelectionDialog dialog = JavaUI.createTypeDialog(getSite().getShell(),
                        getSite().getWorkbenchWindow(), scope,
                        IJavaElementSearchConstants.CONSIDER_CLASSES_AND_INTERFACES, true);
                dialog.setTitle("Make Class Persistent");
                dialog.setMessage("Please select a class to make persistent");

                if (dialog.open() == Window.OK) {
                    VOAProjectControler controler = VOAProjectControler.getInstance(iProject);
                    Object[] results = dialog.getResult();
                    for (int i = 0; i < results.length; i++) {
                        IType itype = (IType) results[i];
                        controler.addClass(itype.getFullyQualifiedName());
                    }
                }
            } catch (Exception e) {
                VOAToolsPlugin.log(e, "Problems adding a persistent class.");
            } finally {
                refreshTree(false, true);
            }
        }
    };
    actAddClass.setText("Make Class Persistent");
    actAddClass.setImageDescriptor(VOAToolsPlugin.imageDescriptorFromPlugin("Versant", "icons/class16.png"));
    actAddClass.setToolTipText("Make  a class in you project persistent.");
}

From source file:org.eclipse.conesc.plugin.model.actions.ConesCGenerateAction.java

License:Open Source License

public void run() {
    ContextDiagram diagram = getSelectedDiagram();
    if (diagram == null)
        return;//from  w ww.j  a va2s.c  o  m

    ConesCGeneratorWizard wizard = new ConesCGeneratorWizard(diagram);
    WizardDialog dialog = new WizardDialog(getWorkbenchPart().getSite().getShell(), wizard);
    dialog.create();
    dialog.getShell().setSize(400, 200);
    dialog.setTitle("ConesC Generator output path.");
    dialog.setMessage("Specify an output folder for generator.");
    if (dialog.open() == WizardDialog.OK) {
        Cashe.deposit("output", wizard.getOutput());
        execute(createGenerateCommand(wizard));
    }
}

From source file:org.eclipse.conesc.plugin.model.actions.ConesCVerifyAction.java

License:Open Source License

public void run() {
    ContextDiagram diagram = getSelectedDiagram();
    if (diagram == null)
        return;//from   w w w  .java2 s  . c o m

    ConesCVerifierWizard wizard = new ConesCVerifierWizard(diagram);
    WizardDialog dialog = new WizardDialog(getWorkbenchPart().getSite().getShell(), wizard);
    dialog.create();
    dialog.getShell().setSize(600, 500/*360*/);
    dialog.setTitle("Context Model Verifier.");
    dialog.setMessage("Specify a CTL expession to verify your model against.");
    if (dialog.open() == WizardDialog.OK) {
        //execute(createVerifyCommand(wizard));
        Cashe.deposit("constraints", wizard.getConstraints());
    }
}

From source file:org.eclipse.conesc.plugin.model.actions.ContextEditAction.java

License:Open Source License

public void run() {
    Context context = getSelectedContext();
    if (context == null)
        return;//from w  ww. j a va 2s.c o m

    ContextEditWizard wizard = new ContextEditWizard(context);
    WizardDialog dialog = new WizardDialog(getWorkbenchPart().getSite().getShell(), wizard);
    dialog.create();
    dialog.getShell().setSize(400, 400);
    dialog.setTitle("Context edit wizard.");
    dialog.setMessage("Editing fields of selected context.");
    if (dialog.open() == WizardDialog.OK) {
        execute(createEditCommand(wizard));
    }
}