Examples of ListGridRecord


Examples of com.smartgwt.client.widgets.grid.ListGridRecord

      public void onSuccess(List<Attribute<?>> attributes) {
        // Add the values to the list:
        ListGridRecord[] list = new ListGridRecord[attributes.size()];
        for (int i = 0; i < attributes.size(); i++) {
          ManyToOneAttribute manyToOneAttribute = (ManyToOneAttribute) attributes.get(i);
          ListGridRecord record = new ListGridRecord();
          // set value field to id as text field !
          record.setAttribute(ASSOCIATION_ITEM_VALUE_FIELD_NAME, manyToOneAttribute.getValue().getId()
              .getValue().toString());
          record.setAttribute(ASSOCIATION_ITEM_VALUE_OBJECT_NAME, manyToOneAttribute.getValue());
          for (String name : manyToOneAttribute.getValue().getAllAttributes().keySet()) {
            Attribute<?> attribute = manyToOneAttribute.getValue().getAllAttributes().get(name);
            record.setAttribute(name, attribute.getValue());
          }
          list[i] = record;
        }
        dsResponse.setData(list);
        dsResponse.setStatus(RPCResponse.STATUS_SUCCESS);
View Full Code Here

Examples of com.smartgwt.client.widgets.grid.ListGridRecord

      } else {
        // fake id
        id = NEW_PREFIX + "." + (newRows++);
      }
      // Feature checks out, add it to the grid:
      ListGridRecord record = new ListGridRecord();
      record.setAttribute(ID_NAME, id);
      updateAttributes(associationValue, record);
      idByValue.put(associationValue, id);
      addData(record);
      return false;
    }
View Full Code Here

Examples of com.smartgwt.client.widgets.grid.ListGridRecord

    }
    record.setAttribute(VALUE_HOLDER_RECORD_ATTRIBUTE, associationValue);
  }

  public AssociationValue getSelectedValue() {
    ListGridRecord record = getSelectedRecord();
    if (record != null) {
      return (AssociationValue) record.getAttributeAsObject(VALUE_HOLDER_RECORD_ATTRIBUTE);
    } else {
      return null;
    }
  }
View Full Code Here

Examples of com.smartgwt.client.widgets.grid.ListGridRecord

    }

    public void onCellOver(CellOverEvent event) {
      ListGridField gridField = AttributeListGrid.this.getField(event.getColNum());
      if (gridField.getName().equals(attributeInfo.getName())) {
        ListGridRecord record = event.getRecord();
        String value = record.getAttribute(attributeInfo.getName());
        if (event.getRowNum() != row) {
          if (img != null) {
            cleanup();
          }
          img = new Img(value);
View Full Code Here

Examples of com.smartgwt.client.widgets.grid.ListGridRecord

    }

    public void onCellClick(CellClickEvent event) {
      ListGridField gridField = AttributeListGrid.this.getField(event.getColNum());
      if (gridField.getName().equals(attributeInfo.getName())) {
        ListGridRecord record = event.getRecord();
        String value = record.getAttribute(attributeInfo.getName());
        Window.open(value, "urlWindow", null);
      }
    }
View Full Code Here

Examples of com.smartgwt.client.widgets.grid.ListGridRecord

   *
   * @since 1.6.0
   */
  @Api
  public void onDeselectLayer(LayerDeselectedEvent event) {
    ListGridRecord selected = treeGrid.getSelectedRecord();
    if (selected != null) {
      treeGrid.deselectRecord(selected);
    }
    selectedLayerTreeNode = null;
    htmlSelectedLayer.setContents(I18nProvider.getLayerTree().activeLayer(I18nProvider.getLayerTree().none()));
View Full Code Here

Examples of com.smartgwt.client.widgets.grid.ListGridRecord

      return false;
    }
    featureIds.add(feature.getId());

    // Feature checks out, add it to the grid:
    ListGridRecord record = new ListGridRecord();
    record.setAttribute(FEATURE_ID_FIELD_NAME, feature.getId());
    copyToRecord(feature, record);
    addData(record);
    return true;
  }
View Full Code Here

Examples of com.smartgwt.client.widgets.grid.ListGridRecord

      selectItem.clearValue();
    }
  }

  public void fromItem(ManyToOneAttribute attribute) {
    ListGridRecord record = selectItem.getSelectedRecord();
    if (record != null) {
      Object v = record.getAttributeAsObject(ManyToOneDataSource.ASSOCIATION_ITEM_VALUE_OBJECT_NAME);
      if (v != null && v instanceof AssociationValue) {
        attribute.setValue((AssociationValue) v);
      }
    }
  }
View Full Code Here

Examples of com.smartgwt.client.widgets.grid.ListGridRecord

    public ListGridRecord copyValues(DriftDefinitionTemplate from) {
        return convert(from);
    }

    public static ListGridRecord convert(DriftDefinitionTemplate from) {
        ListGridRecord record = new ListGridRecord();
        DriftDefinition templateDef = from.getTemplateDefinition();

        // column attrs

        record.setAttribute(ATTR_NAME, from.getName());
        record
            .setAttribute(ATTR_DEFINED_BY, from.isUserDefined() ? MSG.common_title_user() : MSG.common_title_plugin());
        record.setAttribute(ATTR_NUM_DEFINITIONS, String.valueOf(from.getDriftDefinitions().size()));
        record.setAttribute(ATTR_PINNED, from.isPinned() ? ImageManager.getPinnedIcon() : ImageManager
            .getUnpinnedIcon());
        record.setAttribute(ATTR_IS_ENABLED, ImageManager.getAvailabilityIcon(templateDef.isEnabled()));
        record.setAttribute(ATTR_DRIFT_HANDLING_MODE, getDriftHandlingModeDisplayName(templateDef
            .getDriftHandlingMode()));
        record.setAttribute(ATTR_INTERVAL, String.valueOf(templateDef.getInterval()));
        record.setAttribute(ATTR_BASE_DIR_STRING, getBaseDirString(templateDef.getBasedir()));
        // fixed value, just the edit icon
        record.setAttribute(ATTR_EDIT, ImageManager.getEditIcon());

        // non-column attrs used in processing

        // don't store the entity unless necessary, it's just overhead
        // record.setAttribute(ATTR_ENTITY, from);
        record.setAttribute(ATTR_ID, from.getId());
        record.setAttribute(ATTR_IS_PINNED, from.isPinned());
        record.setAttribute(ATTR_IS_USER_DEFINED, from.isUserDefined());

        return record;
    }
View Full Code Here

Examples of com.smartgwt.client.widgets.grid.ListGridRecord

        }
        return results;
    }

    private ListGridRecord transform(Summary stat) {
        ListGridRecord record = new ListGridRecord();
        record.setAttribute(FIELD_SERVICENAME, stat.serviceName);
        record.setAttribute(FIELD_METHODNAME, stat.methodName);
        record.setAttribute(FIELD_COUNT, stat.count);
        record.setAttribute(FIELD_SLOWEST, stat.slowest);
        record.setAttribute(FIELD_AVERAGE, stat.average);
        record.setAttribute(FIELD_FASTEST, stat.fastest);
        record.setAttribute(FIELD_STDDEV, stat.stddev);
        return record;
    }
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.