Package org.jivesoftware.smack.packet

Examples of org.jivesoftware.smack.packet.RosterPacket$ItemType


    }
    else if( value instanceof ItemType )
    {

      ItemType itemType = (ItemType) value;

      super.setText( itemType.getTitle() );
    }
    else
    {
      //---else, this is first time and there is no data so it is a DefaultMutableTreeNode
    }
View Full Code Here


    {
      return ImageFactory.getImageIcon( ImageNames.ICON_PROJECT );
    }
    else if( this.lastSelectedNode instanceof ItemType )
    {
      ItemType itemType = (ItemType) this.lastSelectedNode;

      if( itemType.getType() == TaskType.EMAIL )
      {
        return ImageFactory.getImageIcon( ImageNames.ICON_MAIL );
      }
      else if( itemType.getType() == TaskType.MEETING )
      {
        return ImageFactory.getImageIcon( ImageNames.ICON_MEETING );
      }
      else if( itemType.getType() == TaskType.PHONE )
      {
        return ImageFactory.getImageIcon( ImageNames.ICON_TELEPHONE );
      }
      else if( itemType.getType() == TaskType.TASK )
      {
        return ImageFactory.getImageIcon( ImageNames.ICON_TASK );
      }
      else
      {
        logger.finest( "Need to add icon for TaskType: " + itemType.getType() );
        return super.getLeafIcon();
      }
    }
    else
    {
View Full Code Here

   *
   * @param taskType
   *******************************************************************************/
  public void changeCurrentNodeType( TaskType taskType )
  {
    ItemType itemType= (ItemType) this.getSelectedNode();
    itemType.setType( taskType );
  }
View Full Code Here

    if( selectedNode != null )
    {
      logger.finer( "adding node to: '" + selectedNode.getTitle() + "'" );

      ItemType newNode = new ItemType();
      newNode.setTitle( "New Item" );
      newNode.setType( TaskType.TASK );

      GregorianCalendar g = new GregorianCalendar();
      g.setTime( new Date() );
      try
      {
        newNode.setDateCreated( DatatypeFactory.newInstance().newXMLGregorianCalendar( g ) );
      }
      catch( DatatypeConfigurationException e )
      {
        logger.severe( "Trying to create a date on the TaskNode.  " + e );
      }
View Full Code Here

  @Override
  protected Transferable createTransferable( JComponent jComponent )
  {   
    JTree jTree = (JTree) jComponent;
   
    ItemType itemType = (ItemType) jTree.getSelectionPath().getLastPathComponent();   
    this.parent = (BaseType) jTree.getSelectionPath().getParentPath().getLastPathComponent();

    this.originalPath= jTree.getSelectionPath().getParentPath();
   
    return new BaseTypeTransferable( itemType );
View Full Code Here

    JTree jTree = (JTree) jComponent;   
    BaseType target = (BaseType) jTree.getSelectionPath().getLastPathComponent();   

    try
    {
      ItemType source = (ItemType) transferable.getTransferData( ITEM_TYPE_DATA_FLAVOR );
      target.getItem().add( source );
     
     
      //System.out.println( "BEFORE---this.parent.getItem().size()= " + this.parent.getItem().size() );
     
View Full Code Here

         
          List<ItemRefType> itemrefs = new ArrayList<ItemRefType>();
          for(Item i:itemset.getItems()) {
            if(!allItems.contains(i)) {           
              allItems.add(i);
              ItemType pmmlItem = _40Factory.eINSTANCE.createItemType();
              pmmlItem.setId(String.valueOf(allItems.indexOf(i)));
              pmmlItem.setValue(i.toString());
              ruleModel.getItem().add(pmmlItem);

            }
          ItemRefType itemref = _40Factory.eINSTANCE.createItemRefType();
          itemref.setItemRef(String.valueOf(allItems.indexOf(i)));
View Full Code Here

            response = null;
            response = new Presence(Presence.Type.subscribe);
            response.setTo(presence.getFrom());
            connection.sendPacket(response);
            // update the roster with the new user
            RosterPacket rosterPacket = new RosterPacket();
            rosterPacket.setType(IQ.Type.SET);
            RosterPacket.Item item = new RosterPacket.Item(presence.getFrom(), parseName(presence.getFrom()));
            item.addGroupName(OLATBUDDIES);
            item.setItemType(RosterPacket.ItemType.both);
            // item.setItemStatus(RosterPacket.ItemStatus.fromString());
            rosterPacket.addRosterItem(item);
            connection.sendPacket(rosterPacket);
          }
        }
        if (presence.getType() == Presence.Type.subscribe) {
          subscribedUsers.add(presence.getFrom());
View Full Code Here

   * jid="guido@localhost" /> </query> </iq>
   *
   * @param uname a valid username
   */
  protected void removeSubscription(String uname) {
    RosterPacket rosterPacket = new RosterPacket();
    rosterPacket.setType(IQ.Type.SET);
    RosterPacket.Item item = new RosterPacket.Item(uname + "@" + jabberServer, uname);
    item.setItemType(RosterPacket.ItemType.remove);
    rosterPacket.addRosterItem(item);
    try {
      connection.sendPacket(rosterPacket);
    } catch (RuntimeException e) {
      Tracing.logWarn("Error while trying to send Instant Messaging packet.", e, InstantMessagingClient.class);
    }
View Full Code Here

    Presence presence = new Presence(Presence.Type.subscribe);
    presence.setTo(uname + "@" + jabberServer);
    try {
      connection.sendPacket(presence);

      RosterPacket rosterPacket = new RosterPacket();
      rosterPacket.setType(IQ.Type.SET);
      RosterPacket.Item item = new RosterPacket.Item(uname + "@" + jabberServer, uname);
      item.addGroupName(groupname);
      item.setItemType(RosterPacket.ItemType.both);
      rosterPacket.addRosterItem(item);
      connection.sendPacket(rosterPacket);
    } catch (RuntimeException e) {
      Tracing.logWarn("Error while trying to send Instant Messaging packet.", e, InstantMessagingClient.class);
    }
  }
View Full Code Here

TOP

Related Classes of org.jivesoftware.smack.packet.RosterPacket$ItemType

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.