当前位置: 首页>>代码示例>>Java>>正文


Java IntrospectedProperty.setValue方法代码示例

本文整理汇总了Java中com.intellij.uiDesigner.propertyInspector.IntrospectedProperty.setValue方法的典型用法代码示例。如果您正苦于以下问题:Java IntrospectedProperty.setValue方法的具体用法?Java IntrospectedProperty.setValue怎么用?Java IntrospectedProperty.setValue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.intellij.uiDesigner.propertyInspector.IntrospectedProperty的用法示例。


在下文中一共展示了IntrospectedProperty.setValue方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: initDefaultProperties

import com.intellij.uiDesigner.propertyInspector.IntrospectedProperty; //导入方法依赖的package包/类
public void initDefaultProperties(@NotNull final ComponentItem item) {
  final IntrospectedProperty[] properties = getPalette().getIntrospectedProperties(this);
  for (final IntrospectedProperty property : properties) {
    final Object initialValue = item.getInitialValue(property);
    if (initialValue != null) {
      try {
        //noinspection unchecked
        property.setValue(this, initialValue);
      }
      catch (Exception e) {
        throw new RuntimeException(e);
      }
    }
  }

  myConstraints.restore(item.getDefaultConstraints());
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:18,代码来源:RadComponent.java

示例2: loadLwProperty

import com.intellij.uiDesigner.propertyInspector.IntrospectedProperty; //导入方法依赖的package包/类
public void loadLwProperty(final LwComponent lwComponent,
                           final LwIntrospectedProperty lwProperty,
                           final IntrospectedProperty property) {
  myLoadingProperties = true;
  try {
    try {
      final Object value = lwComponent.getPropertyValue(lwProperty);
      //noinspection unchecked
      property.setValue(this, value);
    }
    catch (Exception e) {
      LOG.error(e);
      //TODO[anton,vova]: show error and continue to load form
    }
  }
  finally {
    myLoadingProperties = false;
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:20,代码来源:RadComponent.java

示例3: morphComponent

import com.intellij.uiDesigner.propertyInspector.IntrospectedProperty; //导入方法依赖的package包/类
private static boolean morphComponent(final GuiEditor editor, final RadComponent oldComponent, ComponentItem targetItem) {
  targetItem = InsertComponentProcessor.replaceAnyComponentItem(editor, targetItem, "Morph to Non-Palette Component");
  if (targetItem == null) {
    return false;
  }
  final RadComponent newComponent = InsertComponentProcessor.createInsertedComponent(editor, targetItem);
  if (newComponent == null) return false;
  newComponent.setBinding(oldComponent.getBinding());
  newComponent.setCustomLayoutConstraints(oldComponent.getCustomLayoutConstraints());
  newComponent.getConstraints().restore(oldComponent.getConstraints());

  updateBoundFieldType(editor, oldComponent, targetItem);

  final IProperty[] oldProperties = oldComponent.getModifiedProperties();
  final Palette palette = Palette.getInstance(editor.getProject());
  for(IProperty prop: oldProperties) {
    IntrospectedProperty newProp = palette.getIntrospectedProperty(newComponent, prop.getName());
    if (newProp == null || !prop.getClass().equals(newProp.getClass())) continue;
    Object oldValue = prop.getPropertyValue(oldComponent);
    try {
      //noinspection unchecked
      newProp.setValue(newComponent, oldValue);
    }
    catch (Exception e) {
      // ignore
    }
  }

  retargetComponentProperties(editor, oldComponent, newComponent);
  final RadContainer parent = oldComponent.getParent();
  int index = parent.indexOfComponent(oldComponent);
  parent.removeComponent(oldComponent);
  parent.addComponent(newComponent, index);
  newComponent.setSelected(true);

  if (oldComponent.isDefaultBinding()) {
    final String text = FormInspectionUtil.getText(newComponent.getModule(), newComponent);
    if (text != null) {
      String binding = BindingProperty.suggestBindingFromText(newComponent, text);
      if (binding != null) {
        new BindingProperty(newComponent.getProject()).setValueEx(newComponent, binding);
      }
    }
    newComponent.setDefaultBinding(true);
  }
  return true;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:48,代码来源:MorphAction.java


注:本文中的com.intellij.uiDesigner.propertyInspector.IntrospectedProperty.setValue方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。