Package org.eclipse.core.runtime

Examples of org.eclipse.core.runtime.Status


  @Override
  public List<IStatus> validate() {
    List<IStatus> messages = new ArrayList<IStatus>();
    String location = _txtExportLocation.getText();
    if (location == null || location.trim().equals("")) {
      messages.add(new Status(Status.ERROR, Plugin.PLUGIN_ID, "Please choose a destination file for the design export."));
    } else if (!location.trim().endsWith(".wgadesign")) {
      messages.add(new Status(Status.ERROR, Plugin.PLUGIN_ID, "Destination file must have '.wgadesign' as file extension."));     
    }
   
    return messages;
  }
View Full Code Here


  public List<IStatus> validate() {
    List<IStatus> list = new ArrayList<IStatus>();
    if (getTreeViewer().getTree().getSelectionCount() > 0) {
      IContainer treeSelection = (IContainer) getTreeViewer().getTree().getSelection()[0].getData();
      if (!WGADesignStructureHelper.isValidPortletLocation(treeSelection)) {
        list.add(new Status(Status.ERROR, Plugin.PLUGIN_ID, "You cannot create a portlet here. Please select a folder below the tml folder."));
      }
    } else {
      list.add(new Status(Status.ERROR, Plugin.PLUGIN_ID, "There is no designfolder in workspace."));
    }
    return list;
  }
View Full Code Here

  public List<IStatus> validate() {
    List<IStatus> list = new ArrayList<IStatus>();

    if (_txtPortletName.getText().equals("")) {
      list.add(new Status(Status.ERROR, Plugin.PLUGIN_ID, "Please specify a name for the portlet"));
    } else if (!WGADesignStructureHelper.isValidModuleName(_txtPortletName.getText())) {
      list.add(new Status(Status.ERROR, Plugin.PLUGIN_ID, "Invalid chars in portlet name."));
    } else {
      IContainer targetContainer = _selectedContainer.getFolder(new Path(_txtPortletName.getText()));
      IFile targetFile = _selectedContainer.getFile(new Path(_txtPortletName.getText()));

      if (targetContainer == null || targetContainer.exists()) {

        list.add(new Status(Status.ERROR, Plugin.PLUGIN_ID, "There is already a folder named \"" + _txtPortletName.getText() + "\" below \"" + _selectedContainer.getName() + "\"."));
      } else if (targetFile == null || targetFile.exists()) {
        list.add(new Status(Status.ERROR, Plugin.PLUGIN_ID, "There is already a file named \"" + _txtPortletName.getText() + "\" below \"" + _selectedContainer.getName() + "\"."));

      }
    }

    return list;
View Full Code Here

  @Override
  public List<IStatus> validate() {
    List<IStatus> list = new ArrayList<IStatus>();

    if (!(getTreeViewer().getTree().getSelectionCount() > 0)) {
      list.add(new Status(Status.ERROR, Plugin.PLUGIN_ID, "There is no designfolder in workspace."));
    } else {
      IContainer treeSelection = (IContainer) getTreeViewer().getTree().getSelection()[0].getData();

      if (!WGADesignStructureHelper.isValidScriptLocation(treeSelection)) {
        list.add(new Status(Status.ERROR, Plugin.PLUGIN_ID, "You cannot create a script module here. Please select a folder below the scripts folder."));
      }
    }

    return list;
  }
View Full Code Here

  @Override
  public List<IStatus> validate() {
    List<IStatus> messages = new ArrayList<IStatus>();
    IResource selected = getSelectedResource();
    if (selected == null || !(selected instanceof IContainer) || !getFilter().isValidLocation((IContainer)selected)) {
      messages.add(new Status(Status.ERROR, Plugin.PLUGIN_ID, "Please select a valid design folder."));
    }
    return messages;
  }
View Full Code Here

    }
    _keyExists = false;

    if (_comboFiles != null && !_comboFiles.isDisposed()) {
      if (!WorkbenchUtils.isValidResourceName(_comboFiles.getText())) {
        updateStatus(new Status(Status.ERROR, Activator.PLUGIN_ID, "specialcharacters in Labelfilename"));
        _buttonCreateNewLabel.setEnabled(false);
      }
      if (_comboFiles.getText().length() == 0) {
        updateStatus(new Status(Status.ERROR, Activator.PLUGIN_ID, "no Labelfile selected"));
        _buttonCreateNewLabel.setEnabled(false);
      }
    }

    if (_txtKeyTabNew != null && !_txtKeyTabNew.isDisposed()) {
      String prefix = "";
      if (_buttonCheckPrefix.getSelection()) {
        prefix = _comboPrefix.getText();
      }

      if (_currentLabelContent.containsKey((prefix + _txtKeyTabNew.getText()))) {
        updateStatus(new Status(Status.WARNING, Activator.PLUGIN_ID, "Key already exists"));
        _keyExists = true;
      }

      if (_txtKeyTabNew.getText().length() == 0) {
        updateStatus(new Status(Status.ERROR, Activator.PLUGIN_ID, "no key set"));
        _buttonCreateNewLabel.setEnabled(false);
      }
      if (_txtKeyTabNew.getText().endsWith(".")) {
        updateStatus(new Status(Status.ERROR, Activator.PLUGIN_ID, "Key ends with \".\""));
        _buttonCreateNewLabel.setEnabled(false);
      }
      if (_txtKeyTabNew.getText().contains("..")) {
        updateStatus(new Status(Status.ERROR, Activator.PLUGIN_ID, "Key contains \"..\""));
        _buttonCreateNewLabel.setEnabled(false);
      }
      if (_txtKeyTabNew.getText().contains(" ")) {
        updateStatus(new Status(Status.ERROR, Activator.PLUGIN_ID, "spaces in keyname"));
        _buttonCreateNewLabel.setEnabled(false);
      }

    }
View Full Code Here

          try {
            _resourceIndexManager.init();
            return Status.OK_STATUS;
           
          } catch (CoreException e) {
            return new Status(Status.ERROR, Plugin.PLUGIN_ID, "Unable to indexworkspacefilerefs", e);
          }     
         
        }

      };
View Full Code Here

    return _contextInformationProvider;
  }

  public void logError(String message, Throwable e) {
    if (e != null)
      getLog().log(new Status(Status.ERROR, PLUGIN_ID, message, e));
    else
      getLog().log(new Status(Status.ERROR, PLUGIN_ID, message));
  }
View Full Code Here

  }
 

  public void logError(Throwable e) {
    if (e != null)
      getLog().log(new Status(Status.ERROR, PLUGIN_ID, e.getMessage(), e));
    else
      getLog().log(new Status(Status.ERROR, PLUGIN_ID, "Unknown error occured."));   
  }
View Full Code Here

  }
 

  public void logInfo(String message, Throwable e) {
    if (e != null)
      getLog().log(new Status(Status.INFO, PLUGIN_ID, message, e));
    else
      getLog().log(new Status(Status.INFO, PLUGIN_ID, message));
  }
View Full Code Here

TOP

Related Classes of org.eclipse.core.runtime.Status

Copyright © 2018 www.massapicom. 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.