示例#1
0
 @Override
 protected void buildPropertiesPanel() {
   super.buildPropertiesPanel();
   JComponent buttonBar =
       new ButtonBarBuilder().addGlue().addButton(_applyButton, _discardButton).build();
   buttonBar.setBorder(Borders.DIALOG);
   _propertiesPanel.add(buttonBar, BorderLayout.SOUTH);
 }
 @Override
 protected void doInit() {
   super.doInit();
   root = inflater.inflate(R.layout.textimglistview, mWrapper);
   tvLabel = (TextView) root.findViewById(R.id.tv_img_list_text);
   btnOpt = (ImageView) root.findViewById(R.id.tv_img_list_img);
   listview = (ListView) root.findViewById(R.id.tv_img_list_list);
 }
示例#3
0
 /**
  * Get a cell editor and a validator.
  *
  * <p>If no editor available use default editor and renderer
  */
 public TableCellEditor getCellEditor(int row, int col) {
   EditorBase cell_editor = null;
   // Retrieve the property
   Property p = ((CtrlPropModel) getModel()).getPropertyAt(row);
   Class<?> c = p.field.getType(); // p.fieldType;
   // Get special editor if none then use one based on data type
   cell_editor = p.cell_editor;
   if (cell_editor == null) {
     if (c == boolean.class || c == Boolean.class) {
       cell_editor = new EditorBoolean();
     }
     if (c == int.class || c == Integer.class || c == String.class) {
       cell_editor = new EditorJTextfield();
     }
     if (c == float.class || c == Float.class) {
       cell_editor = new EditorJTextfield();
     }
     p.cell_editor = cell_editor;
   }
   // If we have don't have a validator then get one based on the class
   if (p.validator == null) p.validator = Validator.getDefaultValidator(c);
   if (cell_editor != null && cell_editor.validator == null) cell_editor.validator = p.validator;
   return (cell_editor == null) ? super.getCellEditor(row, col) : cell_editor;
 }