Package org.eclipse.xcde.backend

Examples of org.eclipse.xcde.backend.UserData


              {
              Vector users = register.getUserList().getUsers();
              String localUser = register.getUsername();
              for (int i = 0; i < users.size(); ++i)
                {
                UserData user = (UserData)users.get(i);
                if ((username.equals(user.getUsername()) && !username.equals(localUser)) ||
                  (username.equals(oldname) && !oldname.equals(localUser)))
                  {
                  userText.setBackground(userText.getDisplay().getSystemColor(SWT.COLOR_RED));
                  buttonOK.setEnabled(false);
                  errorLabel.setText("The username already exists on the system");
View Full Code Here


   * @return The string that is the text for the column entry, null otherwise
   */
  public String getColumnText(Object element, int columnIndex)
    {
    String result = null;
    UserData user = (UserData) element;
    //we only return usernames, there is no other text in the table proper
    if (columnIndex == 0)
      result = user.getUsername();
    else if (columnIndex == 4)
      result = user.getConcatPath() == null ? "" : user.getConcatPath();
    return result;
    }
View Full Code Here

  public void refresh()
    {
    viewer.refresh();
    for (int i = 0; i < table.getItemCount(); ++i)
      {
      UserData data = (UserData)table.getItem(i).getData();
      table.getItem(i).setForeground(new Color(table.getDisplay(),data.getColour()));
      }
    }
View Full Code Here

        newReg.getUserList().addChangeListener(this);
        viewer.setInput(newReg.getUserList());
        viewer.refresh();
        for (int i = 0; i < table.getItemCount(); ++i)
          {
          UserData data = (UserData)table.getItem(i).getData();
          table.getItem(i).setForeground(new Color(table.getDisplay(),data.getColour()));
          }
        }
      else
        {
        viewer.setInput(new UserDataList(null));
View Full Code Here

  //no javadoc for this, the super has a great javadoc, we just implement
  //what it says in this case
  public int compare(Viewer viewer, Object o1, Object o2)
    {
    int toReturn = 0;
    UserData one = (UserData)o1;
    UserData two = (UserData)o2;
    switch(criteria)
      {
      case NAME:
        toReturn = collator.compare(one.getUsername(),two.getUsername());
        break;
      case RGB:
        RGB left = one.getColour();
        RGB right = two.getColour();
        toReturn = (left.blue + left.red + left.green) - (right.blue + right.red + right.green);
        break;
      case BUILD:
          //same or not so do XOR and return appropriately (same gets 0)
        toReturn = (one.getBuild() ^ two.getBuild()) ? -1 : 0;
        break;
      case TEST:
        //same or not so do XOR and return appropriately (same gets 0)
        toReturn = (one.getTest() ^ two.getTest()) ? -1 : 0;
        break;
      case LOCATION:
        toReturn = collator.compare(one.getConcatPath(),two.getConcatPath());
        break;
      }
    return toReturn * order;
    }
 
View Full Code Here

    {
    if (property.equals("colour"))
      return true;
    if (property.equals("location"))
      return false;
    UserData user = (UserData)element;
    //restrict to users matching the current user
    if (XCDERegisterProvider.getProvider().getCurrentRegister() != null &&
      user.getUsername().equals(XCDERegisterProvider.getProvider().getCurrentRegister().getUsername()))
      return true;
    return false;
    }
View Full Code Here

   * objects to be rendered by the different table cells.  They must match
   * the datatype expected by the CellEditor.
   */
  public Object getValue(Object element, String property)
    {
    UserData data = (UserData)element;
    if (property.equals("username"))
      return data.getUsername();
    else if (property.equals("colour"))
      return data.getColour();
    else if (property.equals("build"))
      return new Boolean(data.getBuild());
    else if (property.equals("test"))
      return new Boolean(data.getTest());
    return null;
    }
View Full Code Here

     * @parma value The new value of for the cell in question
   */
  public void modify(Object element, String property, Object value)
    {
    TableItem ti = (TableItem)element;
    UserData data = (UserData)ti.getData();
    if (property.equals("username"))
      {
      //update current user to the new name or we lose the ability to
      //edit
      if (XCDERegisterProvider.getProvider().getCurrentRegister() != null)
        XCDERegisterProvider.getProvider().getCurrentRegister().setUsername((String)value);
      }
    else if (property.equals("colour"))
      {
      UserData old = new UserData(data);
      data.setColour((RGB)value);
      ti.setForeground(new Color(ti.getDisplay(),(RGB)value));
      XCDERegisterProvider.getProvider().getCurrentRegister().getUserList().updateUserFromServer(old,data);
      }
    else if (property.equals("build"))
      {
      UserData old = new UserData(data);
      data.setBuild(((Boolean)value).booleanValue());
      XCDERegisterProvider.getProvider().getCurrentRegister().getUserList().updateUser(old,data);
      }
    else if (property.equals("test"))
      {
      UserData old = new UserData(data);
      data.setTest(((Boolean)value).booleanValue());
      XCDERegisterProvider.getProvider().getCurrentRegister().getUserList().updateUser(old,data);
      }
    //notify the backend
    viewer.refresh();
View Full Code Here

TOP

Related Classes of org.eclipse.xcde.backend.UserData

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.