Examples of CellEditor


Examples of org.eclipse.jface.viewers.CellEditor

    /**
     * @see org.eclipse.ui.views.properties.PropertyDescriptor#createPropertyEditor(org.eclipse.swt.widgets.Composite)
     */
    public CellEditor createPropertyEditor( Composite parent ) {

        return new CellEditor(parent, SWT.NONE){

            Geometry geometry;
            private Button button;
            private Label label;

View Full Code Here

Examples of org.eclipse.jface.viewers.CellEditor

    }

    @Override
    protected CellEditor getCellEditor(Object element) {
      ExtraParams extraParams = (ExtraParams)element;
      CellEditor cellEditor = extraParams.getCellEditor();
      return cellEditor;
    }
View Full Code Here

Examples of org.eclipse.jface.viewers.CellEditor

  }
  public Map<String, Serializable> getParams() {
    Map<String, Serializable> params = new HashMap<String, Serializable>();
   
    for (ExtraParams def : paramsDefinition) {
      CellEditor cellEditor = def.getCellEditor();
      if(cellEditor !=null && cellEditor.getValue() != null) {
        params.put(def.param.key, def.convertValue(cellEditor.getValue()));
      }
    }
    return params;
  }
View Full Code Here

Examples of org.eclipse.jface.viewers.CellEditor

  private CellEditor[] createCellEditors() {
    CellEditor[] editors = new CellEditor[3];

        //TODO: create a nicer color chooser
        CellEditor celledit0 = new ColorCellEditor(treeViewer.getTree());
        TextCellEditor celledit1 = new TextCellEditor(treeViewer.getTree());
        TextCellEditor celledit2 = new TextCellEditor(treeViewer.getTree());
        editors[0] = celledit0;
        editors[1] = celledit1;
        editors[2] = celledit2;
View Full Code Here

Examples of org.eclipse.jface.viewers.CellEditor

    return "matte_border_insets";
  }

  @Override
  public CellEditor createPropertyEditor(Composite parent) {
    CellEditor editor = new TextCellEditor(parent) {
      @Override
      protected Object doGetValue() {
        String strInsets = (String) super.doGetValue();
        return decodeValue(strInsets);
      }

      @Override
      protected void doSetValue(Object value) {
        super.doSetValue(encodeValue(value));
      }
    };
    editor.setValidator(new InsetsCellEditorValidator());
    return editor;
  }
View Full Code Here

Examples of org.eclipse.jface.viewers.CellEditor

            public void removeListener(ILabelProviderListener iLabelProviderListener) {
            }
        };
        ruleTable.setLabelProvider(labelProvider);

        CellEditor editors [] = new CellEditor[2];
        editors[0] = new TextCellEditor(table);

        ruleTable.setCellEditors(editors);
        ruleTable.setColumnProperties(new String[]{"selectors", "order"});
        ruleTable.setCellModifier(new ICellModifier() {
View Full Code Here

Examples of org.eclipse.jface.viewers.CellEditor

   * @param table   Future Parent Table
   * @return
   */
  public static CellEditor createCellEditor(final Attribut attr, final Table table)
    {
    CellEditor cellEdt = null;

    switch (attr.getType())
      {
      case T_Integer:
        cellEdt = new NumericCellEditor(table, SWT.SINGLE, T_Integer);
View Full Code Here

Examples of org.eclipse.jface.viewers.CellEditor

            }
        });
    }
    private void handleSelect(TreeItem item) {
        for (TreeItem treeItem : tree.getItems()) {
            CellEditor cellEditor = (CellEditor) treeItem.getData(CELL_EDITOR_KEY);
            if (cellEditor != null && !cellEditor.getControl().isDisposed() && !cellEditor.getControl().isVisible()) {
                cellEditor.getControl().setVisible(true);
            }
        }
        CellEditor cellEditor = (CellEditor) item.getData(CELL_EDITOR_KEY);
        if (cellEditor != null) {
            cellEditor.setFocus();
        }
    }
View Full Code Here

Examples of org.eclipse.jface.viewers.CellEditor

            final TreeItem item = new TreeItem(tree, SWT.NONE, i);
            item.setText(0, descriptor.getDisplayName());
            item.setText(1, getStringValue(descriptor, value));

            CellEditor cellEditor = descriptor.createPropertyEditor(tree);
            CellEditorListener cellEditorListener = null;
            if (cellEditor != null) {
                cellEditor.setValue(value);
                cellEditorListener = new CellEditorListener(item, descriptor, cellEditor);
                cellEditor.addListener(cellEditorListener);
                CellEditor.LayoutData layout = cellEditor.getLayoutData();
                TreeEditor treeEditor = new TreeEditor(tree);
                treeEditor.horizontalAlignment = layout.horizontalAlignment;
                treeEditor.grabHorizontal = layout.grabHorizontal;
                treeEditor.minimumWidth = layout.minimumWidth;
                if (cellEditor instanceof ComboBoxCellEditor) {
                    cellEditor.getControl().setBackground(ColorConstants.white);
                    cellEditor.setValidator(new ICellEditorValidator() {
                        public String isValid(Object object) {
                            if (object instanceof Integer && ((Integer) object).intValue() > -1) {
                                return null;
                            }
                            return "empty";
                        }
                    });
                }
                treeEditor.setEditor(cellEditor.getControl(), item, columnToEdit);
                item.setData(CELL_EDITOR_KEY, cellEditor);
                item.setData(TREE_EDITOR_KEY, treeEditor);
            }
            item.setData(PROPERTY_DESCRIPTOR_KEY, descriptor);
            item.setData(CELL_EDITOR_LISTENER_KEY, cellEditorListener);
View Full Code Here

Examples of org.eclipse.jface.viewers.CellEditor

    public BooleanPropertyDescriptor(Object id, String displayName) {
        super(id, displayName);
    }

    public CellEditor createPropertyEditor(Composite parent) {
        CellEditor editor = new ComboBoxCellEditor(parent, new String[] { "true", "false" }, SWT.READ_ONLY) {
            protected void doSetValue(Object value) {
                if (((Boolean) value).booleanValue()) {
                    super.doSetValue(new Integer(0));
                } else {
                    super.doSetValue(new Integer(1));
                }
            }

            protected Object doGetValue() {
                int selection = ((Integer) super.doGetValue()).intValue();
                if (selection == 0) {
                    return new Boolean(true);
                } else {
                    return new Boolean(false);
                }
            }
        };

        if (getValidator() != null)
            editor.setValidator(getValidator());

        return editor;
    }
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.