• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java PropertyEditor类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.controlsfx.property.editor.PropertyEditor的典型用法代码示例。如果您正苦于以下问题:Java PropertyEditor类的具体用法?Java PropertyEditor怎么用?Java PropertyEditor使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



PropertyEditor类属于org.controlsfx.property.editor包,在下文中一共展示了PropertyEditor类的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: initialize

import org.controlsfx.property.editor.PropertyEditor; //导入依赖的package包/类
@FXML
void initialize() {
	Callback<Item, PropertyEditor<?>> oldFactory = propertySheet.getPropertyEditorFactory();
	propertySheet.setPropertyEditorFactory(new Callback<PropertySheet.Item, PropertyEditor<?>>() {
		@Override
		public PropertyEditor<?> call(PropertySheet.Item item) {
			if (item.getValue() instanceof Image) {
				return ImagePropertyEditor.createImageEditor(item);
			}

			return oldFactory.call(item);
		}
	});
	customCssArea.textProperty().addListener(new ChangeListener<String>() {
		@Override
		public void changed(ObservableValue<? extends String> observable, String oldValue, String newValue) {
			if (newValue != null) {
				getProject().setCss(newValue);
				MainWindow.touch();
				queuePreviewUpdate();
			}
		}
	});

	updateFields();
}
 
开发者ID:Quantencomputer,项目名称:cyoastudio,代码行数:27,代码来源:StyleEditor.java


示例2: getEditor

import org.controlsfx.property.editor.PropertyEditor; //导入依赖的package包/类
@SuppressWarnings("unchecked")
private Node getEditor(PropertySheet.Item item) {
    PropertyEditor editor = getSkinnable().getPropertyEditorFactory().call(item);
    if (editor == null) {
        editor = new AbstractPropertyEditor<Object, TextField>(item, new TextField(), true) {
            {
                getEditor().setEditable(false);
                getEditor().setDisable(true);
            }

            @Override
            protected ObservableValue getObservableValue() {
                return getEditor().textProperty();
            }

            @Override
            public void setValue(Object value) {
                getEditor().setText(value == null ? "" : value.toString());
            }
        };
    }
    editor.setValue(item.getValue());
    return editor.getEditor();
}
 
开发者ID:acmi,项目名称:xdat_editor,代码行数:25,代码来源:PropertySheetSkin.java


示例3: call

import org.controlsfx.property.editor.PropertyEditor; //导入依赖的package包/类
@Override
public PropertyEditor<?> call(PropertySheet.Item item) {

  if (!(item instanceof Parameter))
    throw new IllegalArgumentException(
        "This ParameterEditorFactory can be only used for Parameter instances");

  PropertyEditor<?> editor = super.call(item);

  // Save the reference for the editor
  editorsMap.put(item, editor);

  if (editor instanceof ParameterEditor) {
    addValidator(validationSupport, (Parameter<?>) item, (ParameterEditor<?>) editor);
  }

  return editor;
}
 
开发者ID:mzmine,项目名称:mzmine3,代码行数:19,代码来源:ParameterEditorFactory.java


示例4: ExtendedPropertySheet

import org.controlsfx.property.editor.PropertyEditor; //导入依赖的package包/类
/**
 * Creates an empty property sheet.
 */
public ExtendedPropertySheet() {
  super();
  setModeSwitcherVisible(false);
  setSearchBoxVisible(false);
  setPropertyEditorFactory(new DefaultPropertyEditorFactory() {
    @Override
    public PropertyEditor<?> call(Item item) {
      if (item.getType() == String.class) {
        return new TextPropertyEditor(item);
      }
      if (item.getType() == Integer.class) {
        return new IntegerPropertyEditor(item);
      }
      if (Number.class.isAssignableFrom(item.getType())) {
        return new NumberPropertyEditor(item);
      }
      if (item.getType() == Boolean.class) {
        return new ToggleSwitchEditor(item);
      }
      if (item.getType() == Theme.class) {
        return new ThemePropertyEditor(item);
      }
      return super.call(item);
    }
  });
}
 
开发者ID:wpilibsuite,项目名称:shuffleboard,代码行数:30,代码来源:ExtendedPropertySheet.java


示例5: loadProperties

import org.controlsfx.property.editor.PropertyEditor; //导入依赖的package包/类
private static List<PropertySheetItem> loadProperties(Object obj) {
    Class<?> objClass = obj.getClass();
    List<PropertySheetItem> list = new ArrayList<>();
    while (objClass != Object.class) {
        for (Field field : objClass.getDeclaredFields()) {
            if (field.isSynthetic() || Modifier.isStatic(field.getModifiers()))
                continue;

            if (Collection.class.isAssignableFrom(field.getType()))
                continue;

            if (field.isAnnotationPresent(Hide.class))
                continue;

            String description = "";
            if (field.isAnnotationPresent(Description.class))
                description = field.getAnnotation(Description.class).value();
            Class<? extends PropertyEditor<?>> propertyEditorClass = null;
            if (field.getType() == Boolean.class ||
                    field.getType() == Boolean.TYPE) {
                propertyEditorClass = BooleanPropertyEditor.class;
            } else if (field.isAnnotationPresent(Tex.class)) {
                propertyEditorClass = TexturePropertyEditor.class;
            } else if (field.isAnnotationPresent(Sysstr.class)) {
                propertyEditorClass = SysstringPropertyEditor.class;
            }
            field.setAccessible(true);
            PropertySheetItem property = new FieldProperty(field, objClass.getSimpleName(), description, propertyEditorClass);
            list.add(property);
        }
        objClass = objClass.getSuperclass();
    }
    return list;
}
 
开发者ID:acmi,项目名称:xdat_editor,代码行数:35,代码来源:Controller.java


示例6: BeanProperty

import org.controlsfx.property.editor.PropertyEditor; //导入依赖的package包/类
public BeanProperty(PropertyDescriptor propertyDescriptor, String category, String description, Class<? extends PropertyEditor<?>> propertyEditorClass) {
    this.propertyDescriptor = propertyDescriptor;
    this.category = category;
    this.description = description;
    this.propertyEditorClass = propertyEditorClass;
    this.readMethod = propertyDescriptor.getReadMethod();
    this.writeMethod = propertyDescriptor.getWriteMethod();
}
 
开发者ID:acmi,项目名称:xdat_editor,代码行数:9,代码来源:BeanProperty.java


示例7: call

import org.controlsfx.property.editor.PropertyEditor; //导入依赖的package包/类
@Override
		public PropertyEditor<?> call(Item item) {
			if (item.getType() == File.class) {
				return new DirectoryEditor(item, new TextField());
			}
			if (item instanceof ChoicePropertyItem) {
				return Editors.createChoiceEditor(item, ((ChoicePropertyItem<?>)item).getChoices());
			}
//			// This doesn't work...
//			if (item.getType() == Double.class) {
//				return new DoubleEditor(item, new TextField(), true);
//			}
			return super.call(item);
		}
 
开发者ID:qupath,项目名称:qupath,代码行数:15,代码来源:PreferencePanel.java


示例8: getEditorForParameter

import org.controlsfx.property.editor.PropertyEditor; //导入依赖的package包/类
public <ValueType> PropertyEditor<ValueType> getEditorForParameter(
    Parameter<ValueType> parameter) {

  // Let's lookup the parameter by name, because the actual instance may
  // differ due to the cloning of parameter sets
  Parameter<?> actualParameter = parameters.getParameter(parameter);
  if (actualParameter == null)
    throw new IllegalArgumentException(
        "Parameter " + parameter.getName() + " not found in this component");

  return editorFactory.getEditorForItem(actualParameter);

}
 
开发者ID:mzmine,项目名称:mzmine3,代码行数:14,代码来源:ParameterSheetView.java


示例9: call

import org.controlsfx.property.editor.PropertyEditor; //导入依赖的package包/类
@Override
public PropertyEditor<?> call( PropertySheet.Item item ) {

    Class<?> type = item.getType();

    if ( item.getPropertyEditorClass().isPresent() ) {

        Optional<PropertyEditor<?>> ed = Editors.createCustomEditor(item);

        if ( ed.isPresent() ) {
            return ed.get();
        }

    }

    if ( "gradientStops".equals(item.getName()) ) {
        return new StopListEditor(item);
    } else {
        return super.call(item);
    }

}
 
开发者ID:ESSICS,项目名称:KNOBS,代码行数:23,代码来源:KnobPropertyEditorFactory.java


示例10: getPropertyEditorClass

import org.controlsfx.property.editor.PropertyEditor; //导入依赖的package包/类
@Override
public Optional<Class<? extends PropertyEditor<?>>> getPropertyEditorClass() {
    return Optional.ofNullable(propertyEditorClass);
}
 
开发者ID:acmi,项目名称:xdat_editor,代码行数:5,代码来源:BeanProperty.java


示例11: FieldProperty

import org.controlsfx.property.editor.PropertyEditor; //导入依赖的package包/类
public FieldProperty(Field field, String category, String description, Class<? extends PropertyEditor<?>> propertyEditorClass) {
    this.field = field;
    this.category = category;
    this.description = description;
    this.propertyEditorClass = propertyEditorClass;
}
 
开发者ID:acmi,项目名称:xdat_editor,代码行数:7,代码来源:FieldProperty.java


示例12: ParameterSetupDialog

import org.controlsfx.property.editor.PropertyEditor; //导入依赖的package包/类
ParameterSetupDialog(ParameterSet parameters, @Nullable String title) {

    super(AlertType.CONFIRMATION);

    // Set window icon
    final Image mzMineIcon = new Image("file:icon" + File.separator + "mzmine-icon.png");
    Stage stage = (Stage) getDialogPane().getScene().getWindow();
    stage.getIcons().setAll(mzMineIcon);

    if (title != null) {
      setTitle(title);
    } else {
      setTitle("Parameters");
    }
    setHeaderText("Please set parameter values");
    setResizable(true);

    // Add Help button
    final URL helpURL = parameters.getClass().getResource("help/help.html");
    setupHelpButton(helpURL);

    // Add validation support
    ValidationSupport validationSupport = new ValidationSupport();

    // Add ParmeterSheetView to edit the parameters
    ParameterSheetView sheet = new ParameterSheetView(parameters, validationSupport);
    getDialogPane().setContent(sheet);

    // When the user presses the OK button, we need to commit all the
    // changes in the editors to the actual parameters
    Button okButton = (Button) getDialogPane().lookupButton(ButtonType.OK);
    okButton.addEventFilter(ActionEvent.ACTION, e -> {
      if (validationSupport.isInvalid()) {
        e.consume();
        ValidationResult vr = validationSupport.getValidationResult();
        StringBuilder message = new StringBuilder("Please check the parameter settings:\n\n");
        for (ValidationMessage m : vr.getMessages()) {
          message.append(m.getText());
          message.append("\n");
        }
        MZmineGUI.displayMessage(message.toString());
        return;
      }
      // If valid, commit the values
      for (Parameter<?> parameter : parameters) {
        PropertyEditor<?> editor = sheet.getEditorForParameter(parameter);
        Object value = editor.getValue();
        parameter.setValue(value);
      }

    });

  }
 
开发者ID:mzmine,项目名称:mzmine3,代码行数:54,代码来源:ParameterSetupDialog.java


示例13: getEditorForItem

import org.controlsfx.property.editor.PropertyEditor; //导入依赖的package包/类
@SuppressWarnings("unchecked")
<ValueType> PropertyEditor<ValueType> getEditorForItem(Item item) {
  return (PropertyEditor<ValueType>) editorsMap.get(item);
}
 
开发者ID:mzmine,项目名称:mzmine3,代码行数:5,代码来源:ParameterEditorFactory.java


示例14: getPropertyEditorClass

import org.controlsfx.property.editor.PropertyEditor; //导入依赖的package包/类
@SuppressWarnings({"rawtypes", "unchecked"})
@Override
public Optional<Class<? extends PropertyEditor<?>>> getPropertyEditorClass() {
  return (Optional) editorClass;
}
 
开发者ID:mzmine,项目名称:mzmine3,代码行数:6,代码来源:AbstractParameter.java



注:本文中的org.controlsfx.property.editor.PropertyEditor类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java ILineScatterCandleRadarDataSet类代码示例发布时间:2022-05-23
下一篇:
Java AccessToken类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap