Package org.pentaho.openformula.ui

Examples of org.pentaho.openformula.ui.FieldDefinition


      final DefaultComboBoxModel comboBoxModel = new DefaultComboBoxModel();
      final FieldDefinition[] definitions = getFields();
      for (int i = 0; i < definitions.length; i++)
      {
        final FieldDefinition fieldDefinition = definitions[i];
        comboBoxModel.addElement("=" + FormulaUtil.quoteReference(fieldDefinition.getName()));
      }
      comboBox.setModel(comboBoxModel);
      comboBox.setRenderer(new EmptyValueListCellRenderer());
      comboBox.setEditable(true);
      add(comboBox, BorderLayout.CENTER);
View Full Code Here


    return selectedDefinition;
  }

  public void setSelectedDefinition(final FieldDefinition definition)
  {
    final FieldDefinition old = this.selectedDefinition;
    this.selectedDefinition = definition;
    firePropertyChange(SELECTED_DEFINITION_PROPERTY, old, definition);
  }
View Full Code Here

      {
        final DefaultComboBoxModel comboBoxModel = new DefaultComboBoxModel();
        final FieldDefinition[] definitions = getFields();
        for (int i = 0; i < definitions.length; i++)
        {
          final FieldDefinition fieldDefinition = definitions[i];
          comboBoxModel.addElement("=" + FormulaUtil.quoteReference(fieldDefinition.getName()));
        }
        comboBox.setModel(comboBoxModel);
        comboBox.setRenderer(new EmptyValueListCellRenderer());
        comboBox.setEditable(true);
        add(comboBox, BorderLayout.CENTER);
View Full Code Here

    if (comboBoxActive)
    {
      final Object selectedItem = comboBox.getSelectedItem();
      if (selectedItem instanceof FieldDefinition)
      {
        final FieldDefinition fieldDefinition = (FieldDefinition) selectedItem;
        return fieldDefinition.getName();
      }
      if ("".equals(selectedItem))
      {
        return null;
      }
View Full Code Here

                                                final boolean cellHasFocus)
  {
    super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
    if (value instanceof FieldDefinition)
    {
      final FieldDefinition fd = (FieldDefinition) value;

      // format a display string
      final StringBuilder sb = new StringBuilder(50);
      // Add name
      sb.append(fd.getDisplayName());
      sb.append(" ("); // NON-NLS
      // Add Display name if it's not the same as Name
      if (fd.getName().equals(fd.getDisplayName()) == false)
      {
        sb.append(fd.getName()).append(", "); // NON-NLS
      }
      // Add Type
      sb.append(fd.getFieldType().getName());
      //noinspection MagicCharacter
      sb.append(')');

      setText(sb.toString());
      setIcon(fd.getIcon());
    }
    else
    {
      setIcon(null);
      setText(" ");
View Full Code Here

          editorDialog = new FieldSelectorDialog();
        }

        final FieldDefinition[] fields = getFields();
        final String selectedItem = (String) comboBox.getSelectedItem();
        FieldDefinition selected = null;
        if (selectedItem != null)
        {
          for (int i = 0; i < fields.length; i++)
          {
            final FieldDefinition field = fields[i];
            if (selectedItem.equals(field.getName()))
            {
              selected = field;
              break;
            }
          }
        }
        final FieldDefinition fieldDefinition = editorDialog.performEdit(fields, selected);
        if (fieldDefinition != null)
        {
          comboBox.setSelectedItem(fieldDefinition.getName());
        }
      }
      else if (QUERY_VALUE_ROLE.equals(valueRole))
      {
        final Window window = LibSwingUtil.getWindowAncestor(AbstractStringValueCellEditor.this);
View Full Code Here

    final HashSet<String> columnNames = new HashSet<String>
        (Arrays.asList(activeContext.getReportDataSchemaModel().getColumnNames()));
    final ArrayList<String> retval = new ArrayList<String>();
    for (int i = 0; i < fieldDefinitions.length; i++)
    {
      final FieldDefinition fieldDefinition = fieldDefinitions[i];
      if (columnNames.contains(fieldDefinition.getName()) == false)
      {
        retval.add(fieldDefinition.getName());
      }
    }
    return retval.toArray(new String[retval.size()]);
  }
View Full Code Here

        final ArrayList<Object> items = new ArrayList<Object>();
        for (final Object item : transferData)
        {
          if (item instanceof FieldDefinition)
          {
            final FieldDefinition fd = (FieldDefinition) item;
            items.add(fd.getName());
          }
          else
          {
            items.add(item);
          }
View Full Code Here

  public static String[] convertToColumnNames(final FieldDefinition[] fields)
  {
    final String[] fieldsAsString = new String[fields.length];
    for (int i = 0; i < fields.length; i++)
    {
      FieldDefinition field = fields[i];
      fieldsAsString[i] = field.getName();
    }
    return fieldsAsString;
  }
View Full Code Here

      {
        final DefaultComboBoxModel comboBoxModel = new DefaultComboBoxModel();
        final FieldDefinition[] definitions = getFields();
        for (int i = 0; i < definitions.length; i++)
        {
          final FieldDefinition fieldDefinition = definitions[i];
          comboBoxModel.addElement("=" + FormulaUtil.quoteReference(fieldDefinition.getName()));
        }
        comboBox.setModel(comboBoxModel);
        comboBox.setEditable(true);
        add(comboBox, BorderLayout.CENTER);
        add(ellipsisButton, BorderLayout.EAST);
View Full Code Here

TOP

Related Classes of org.pentaho.openformula.ui.FieldDefinition

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.