Examples of IMessageManager


Examples of org.eclipse.ui.forms.IMessageManager

            }
        }
    }

    private void reloadRepos() {
        final IMessageManager messages = getManagedForm().getMessageManager();
        messages.removeMessage(MESSAGE_KEY, viewer.getControl());
        allRepos.clear();

        try {
            allRepos.addAll(Central.getWorkspace().getPlugins(Repository.class));
        } catch (Exception e) {
            messages.addMessage(MESSAGE_KEY, "Repository List: Unable to load OSGi Repositories. " + e.getMessage(), e, IMessageProvider.ERROR, viewer.getControl());

            // Load the repos and clear the error message if the Workspace is initialised later.
            Central.onWorkspaceInit(new Function<Workspace,Void>() {
                @Override
                public Void run(final Workspace ws) {
                    SWTConcurrencyUtil.execForControl(viewer.getControl(), true, new Runnable() {
                        @Override
                        public void run() {
                            allRepos.clear();
                            allRepos.addAll(ws.getPlugins(Repository.class));
                            messages.removeMessage(MESSAGE_KEY, viewer.getControl());
                        }
                    });
                    return null;
                }
            });
View Full Code Here

Examples of org.eclipse.ui.forms.IMessageManager

    form.getBody().setLayout(new GridLayout(2, false));

    Composite sbody = form.getBody();

    if (node != null) {
      final IMessageManager mmng = form.getMessageManager();

      form.setText(node.getPatternName());

      IPropertyDescriptor idDescriptor = null;
      IPropertyDescriptor descriptionDescriptor = null;
View Full Code Here

Examples of org.eclipse.ui.forms.IMessageManager

    });

    //richToolTipMessageManager = new RichMessageToolTipManager(managedForm);
    //form.getForm().setMessageToolTipManager(richToolTipMessageManager);

    final IMessageManager mmng = managedForm.getMessageManager();

    TableWrapLayout layout = new TableWrapLayout();
    form.getBody().setLayout(layout);
    Section section = toolkit.createSection(form.getBody(),
        Section.TITLE_BAR);
    section.setText("Local field messages");
    Composite sbody = toolkit.createComposite(section);
    section.setClient(sbody);
    GridLayout glayout = new GridLayout();
    glayout.horizontalSpacing = 10;
    glayout.numColumns = 2;
    sbody.setLayout(glayout);
    toolkit.paintBordersFor(sbody);
    createDecoratedTextField("Field1", toolkit, sbody, mmng);
    createDecoratedTextField("Field2", toolkit, sbody, mmng);
    createDecoratedTextField("Field3", toolkit, sbody, mmng);
    final Button button1 = toolkit.createButton(form.getBody(),
        "Add general error", SWT.CHECK);
    button1.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(SelectionEvent e) {
        if (button1.getSelection()) {
          mmng.addMessage("saveError", "Save Error", null,
              IMessageProvider.ERROR);
        } else {
          mmng.removeMessage("saveError");
        }
      }
    });
    final Button button2 = toolkit.createButton(form.getBody(),
        "Add static message", SWT.CHECK);
    button2.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(SelectionEvent e) {
        if (button2.getSelection()) {
          mmng.addMessage("info", "Secondary info", null,
              IMessageProvider.NONE);
        } else {
          mmng.removeMessage("info");
        }
      }
    });
    final Button button3 = toolkit.createButton(form.getBody(),
        "Auto update", SWT.CHECK);
    button3.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(SelectionEvent e) {
        mmng.setAutoUpdate(button3.getSelection());
      }
    });
    button3.setSelection(true);
  }
View Full Code Here

Examples of org.eclipse.ui.forms.IMessageManager

      public void widgetSelected(SelectionEvent e) {
        boolean selection = manageMessage.getSelection();
        if (!selection)
          autoUpdate.setSelection(true);
        autoUpdate.setEnabled(selection);
        IMessageManager mm = form.getMessageManager();
        mm.setAutoUpdate(false);
        if (selection) {
          for (int i = 0; i < checkboxes.length; i++) {
            addRemoveMessage(checkboxes[i], mm);
          }
        }
        else {
          mm.removeAllMessages();
        }
        mm.setAutoUpdate(true);
        error.setEnabled(!selection);
        warning.setEnabled(!selection);
        info.setEnabled(!selection);
        cancel.setEnabled(!selection);
        if (selection) {
View Full Code Here

Examples of org.eclipse.ui.forms.IMessageManager

  void showDependenciesError(boolean show) {
    showGeneralError(show, "_UI_Unresolved_dependencies");
  }

  void showGeneralError(boolean show, String msgKey) {
    IMessageManager msgManager = getManagedForm().getMessageManager();
    if(show) {
      String msg = UIPlugin.getLocalString(msgKey);
      msgManager.addMessage(msgKey, msg, null, IMessageProvider.ERROR);
    }
    else
      msgManager.removeMessage(msgKey);
    msgManager.update();
  }
View Full Code Here

Examples of org.eclipse.ui.forms.IMessageManager

        }
      }
    }

    int validateModuleName(String name, String key, Control control) {
      IMessageManager msgManager = getManagedForm().getMessageManager();
      if(name == null) {
        String msg = UIPlugin.getLocalString("_UI_Module_name_missing");
        if(control == null)
          msgManager.addMessage(key, msg, null, IMessageProvider.ERROR);
        else
          msgManager.addMessage(DEFAULT_MESSAGE_KEY, msg, null, IMessageProvider.ERROR, control);
        return IMessageProvider.ERROR;
      }

      int syntaxSeverity = IMessageProvider.NONE;
      String syntax = null;
      try {
        checkName(name, true);
      }
      catch(IllegalArgumentException e) {
        try {
          checkName(name, false);
          syntax = e.getMessage();
          syntaxSeverity = IMessageProvider.WARNING;
        }
        catch(IllegalArgumentException e2) {
          syntax = e2.getMessage();
          syntaxSeverity = IMessageProvider.ERROR;
        }
      }
      if(syntax != null)
        if(control == null)
          msgManager.addMessage(key, syntax, null, syntaxSeverity);
        else
          msgManager.addMessage(DEFAULT_MESSAGE_KEY, syntax, null, syntaxSeverity, control);
      else if(control != null)
        msgManager.removeMessage(DEFAULT_MESSAGE_KEY, control);
      return syntaxSeverity;
    }
View Full Code Here

Examples of org.eclipse.ui.forms.IMessageManager

        msgManager.removeMessage(DEFAULT_MESSAGE_KEY, control);
      return syntaxSeverity;
    }

    int validateOwnerName(String name, String key, Control control) {
      IMessageManager msgManager = getManagedForm().getMessageManager();
      if(name == null) {
        String msg = UIPlugin.getLocalString("_UI_Module_owner_missing");
        if(control == null)
          msgManager.addMessage(key, msg, null, IMessageProvider.ERROR);
        else
          msgManager.addMessage(DEFAULT_MESSAGE_KEY, msg, null, IMessageProvider.ERROR, control);
        return IMessageProvider.ERROR;
      }

      int syntaxSeverity = IMessageProvider.NONE;
      String syntax = null;
      try {
        checkOwner(name, true);
      }
      catch(IllegalArgumentException e) {
        try {
          checkOwner(name, false);
          syntax = e.getMessage();
          syntaxSeverity = IMessageProvider.WARNING;
        }
        catch(IllegalArgumentException e2) {
          syntax = e2.getMessage();
          syntaxSeverity = IMessageProvider.ERROR;
        }
      }
      if(syntax != null)
        if(control == null)
          msgManager.addMessage(key, syntax, null, syntaxSeverity);
        else
          msgManager.addMessage(DEFAULT_MESSAGE_KEY, syntax, null, syntaxSeverity, control);
      else if(control != null)
        msgManager.removeMessage(DEFAULT_MESSAGE_KEY, control);
      return syntaxSeverity;
    }
View Full Code Here

Examples of org.eclipse.ui.forms.IMessageManager

        msgManager.removeMessage(DEFAULT_MESSAGE_KEY, control);
      return syntaxSeverity;
    }

    int validateVersion(String version, Control control) {
      IMessageManager msgManager = getManagedForm().getMessageManager();
      if(version == null) {
        String msg = UIPlugin.getLocalString("_UI_Module_version_missing");
        msgManager.addMessage(DEFAULT_MESSAGE_KEY, msg, null, IMessageProvider.ERROR, control);
        return IMessageProvider.ERROR;
      }
      int result = IMessageProvider.NONE;
      try {
        Version.fromString(version);
        msgManager.removeMessage(DEFAULT_MESSAGE_KEY, control);
      }
      catch(IllegalArgumentException e) {
        msgManager.addMessage(DEFAULT_MESSAGE_KEY, e.getMessage(), null, IMessageProvider.ERROR, control);
        result = IMessageProvider.ERROR;
      }
      return result;
    }
View Full Code Here

Examples of org.eclipse.ui.forms.IMessageManager

      }
      return result;
    }

    int validateVersionRequirement(String versionRequirement, String key) {
      IMessageManager msgManager = getManagedForm().getMessageManager();
      if(versionRequirement == null) {
        String msg = UIPlugin.getLocalString("_UI_Module_version_requirement_missing");
        msgManager.addMessage(key, msg, null, IMessageProvider.ERROR);
        return IMessageProvider.ERROR;
      }
      int result = IMessageProvider.NONE;
      try {
        VersionRange.create(versionRequirement);
      }
      catch(IllegalArgumentException e) {
        msgManager.addMessage(key, e.getMessage(), null, IMessageProvider.ERROR);
        result = IMessageProvider.ERROR;
      }
      return result;
    }
View Full Code Here

Examples of org.eclipse.ui.forms.IMessageManager

          int row = getRowNumber(element);
          int severity = validateDependencyName(fullName, "n" + row); //$NON-NLS-1$

          MetadataModel.Dependency dep = (MetadataModel.Dependency) element;
          if(!dep.isResolved()) {
            IMessageManager msgManager = getManagedForm().getMessageManager();
            msgManager.addMessage(
              "d" + row, MetadataModel.getUnresolvedMessage(dep), null, IMessageProvider.ERROR);
            severity = IMessage.ERROR;
          }

          if(severity == IMessage.ERROR)
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.