Java 类com.intellij.uiDesigner.propertyInspector.editors.IntEnumEditor 实例源码

项目:intellij-ce-playground    文件:Properties.java   
@SuppressWarnings({"HardCodedStringLiteral"})
private void loadEnumProperties(final String className, final Element enumPropertyElement) {
  Map<String, IntEnumEditor.Pair[]> map = new HashMap<String, IntEnumEditor.Pair[]>();
  for(final Object o: enumPropertyElement.getChildren("property")) {
    final Element e = (Element) o;
    final String name = LwXmlReader.getRequiredString(e, "name");
    final List list = e.getChildren("constant");
    IntEnumEditor.Pair[] pairs = new IntEnumEditor.Pair[list.size()];
    for(int i=0; i<list.size(); i++) {
      Element constant = (Element) list.get(i);
      int value = LwXmlReader.getRequiredInt(constant, "value");
      String message = constant.getAttributeValue("message");
      String text = (message != null)
                    ? UIDesignerBundle.message(message)
                    : LwXmlReader.getRequiredString(constant, "name");
      pairs [i] = new IntEnumEditor.Pair(value, text);
    }
    map.put(name, pairs);
  }
  if (map.size() > 0) {
    myClass2EnumProperties.put(className, map);
  }
}
项目:tools-idea    文件:Properties.java   
@SuppressWarnings({"HardCodedStringLiteral"})
private void loadEnumProperties(final String className, final Element enumPropertyElement) {
  Map<String, IntEnumEditor.Pair[]> map = new HashMap<String, IntEnumEditor.Pair[]>();
  for(final Object o: enumPropertyElement.getChildren("property")) {
    final Element e = (Element) o;
    final String name = LwXmlReader.getRequiredString(e, "name");
    final List list = e.getChildren("constant");
    IntEnumEditor.Pair[] pairs = new IntEnumEditor.Pair[list.size()];
    for(int i=0; i<list.size(); i++) {
      Element constant = (Element) list.get(i);
      int value = LwXmlReader.getRequiredInt(constant, "value");
      String message = constant.getAttributeValue("message");
      String text = (message != null)
                    ? UIDesignerBundle.message(message)
                    : LwXmlReader.getRequiredString(constant, "name");
      pairs [i] = new IntEnumEditor.Pair(value, text);
    }
    map.put(name, pairs);
  }
  if (map.size() > 0) {
    myClass2EnumProperties.put(className, map);
  }
}
项目:consulo-ui-designer    文件:Properties.java   
@SuppressWarnings({"HardCodedStringLiteral"})
private void loadEnumProperties(final String className, final Element enumPropertyElement)
{
    Map<String, IntEnumEditor.Pair[]> map = new HashMap<>();
    for(final Object o : enumPropertyElement.getChildren("property"))
    {
        final Element e = (Element) o;
        final String name = LwXmlReader.getRequiredString(e, "name");
        final List list = e.getChildren("constant");
        IntEnumEditor.Pair[] pairs = new IntEnumEditor.Pair[list.size()];
        for(int i = 0; i < list.size(); i++)
        {
            Element constant = (Element) list.get(i);
            int value = LwXmlReader.getRequiredInt(constant, "value");
            String message = constant.getAttributeValue("message");
            String text = (message != null) ? UIDesignerBundle.message(message) : LwXmlReader.getRequiredString(constant, "name");
            pairs[i] = new IntEnumEditor.Pair(value, text);
        }
        map.put(name, pairs);
    }
    if(map.size() > 0)
    {
        myClass2EnumProperties.put(className, map);
    }
}
项目:intellij-ce-playground    文件:Palette.java   
/**
 * Helper method
 */
private static IntroIntProperty createIntEnumProperty(
  final String name,
  final Method readMethod,
  final Method writeMethod,
  final IntEnumEditor.Pair[] pairs
) {
  return new IntroIntProperty(
    name,
    readMethod,
    writeMethod,
    new IntEnumRenderer(pairs),
    new IntEnumEditor(pairs), false);
}
项目:intellij-ce-playground    文件:AlignProperty.java   
private IntEnumEditor.Pair[] getPairs() {
  return new IntEnumEditor.Pair[] {
    new IntEnumEditor.Pair(GridConstraints.ALIGN_LEFT,
                           myHorizontal ? UIDesignerBundle.message("property.left") : UIDesignerBundle.message("property.top")),
    new IntEnumEditor.Pair(GridConstraints.ALIGN_CENTER, UIDesignerBundle.message("property.center")),
    new IntEnumEditor.Pair(GridConstraints.ALIGN_RIGHT,
                           myHorizontal ? UIDesignerBundle.message("property.right") : UIDesignerBundle.message("property.bottom")),
    new IntEnumEditor.Pair(GridConstraints.ALIGN_FILL, UIDesignerBundle.message("property.fill"))
  };
}
项目:intellij-ce-playground    文件:RadFlowLayoutManager.java   
private void initPairs() {
  if (myPairs == null) {
    myPairs = new IntEnumEditor.Pair[] {
      new IntEnumEditor.Pair(FlowLayout.CENTER, UIDesignerBundle.message("property.center")),
      new IntEnumEditor.Pair(FlowLayout.LEFT, UIDesignerBundle.message("property.left")),
      new IntEnumEditor.Pair(FlowLayout.RIGHT, UIDesignerBundle.message("property.right")),
      new IntEnumEditor.Pair(FlowLayout.LEADING, UIDesignerBundle.message("property.leading")),
      new IntEnumEditor.Pair(FlowLayout.TRAILING, UIDesignerBundle.message("property.trailing"))
    };
  }
}
项目:intellij-ce-playground    文件:Properties.java   
@Nullable
public IntEnumEditor.Pair[] getEnumPairs(final Class aClass, final String name) {
  for (Class c = aClass; c != null; c = c.getSuperclass()) {
    final Map<String, IntEnumEditor.Pair[]> map = myClass2EnumProperties.get(c.getName());
    if (map != null) {
      return map.get(name);
    }
  }
  return null;
}
项目:tools-idea    文件:Palette.java   
/**
 * Helper method
 */
private static IntroIntProperty createIntEnumProperty(
  final String name,
  final Method readMethod,
  final Method writeMethod,
  final IntEnumEditor.Pair[] pairs
){
  return new IntroIntProperty(
    name,
    readMethod,
    writeMethod,
    new IntEnumRenderer(pairs),
    new IntEnumEditor(pairs), false);
}
项目:tools-idea    文件:AlignProperty.java   
private IntEnumEditor.Pair[] getPairs() {
  return new IntEnumEditor.Pair[] {
    new IntEnumEditor.Pair(GridConstraints.ALIGN_LEFT,
                           myHorizontal ? UIDesignerBundle.message("property.left") : UIDesignerBundle.message("property.top")),
    new IntEnumEditor.Pair(GridConstraints.ALIGN_CENTER, UIDesignerBundle.message("property.center")),
    new IntEnumEditor.Pair(GridConstraints.ALIGN_RIGHT,
                           myHorizontal ? UIDesignerBundle.message("property.right") : UIDesignerBundle.message("property.bottom")),
    new IntEnumEditor.Pair(GridConstraints.ALIGN_FILL, UIDesignerBundle.message("property.fill"))
  };
}
项目:tools-idea    文件:RadFlowLayoutManager.java   
private void initPairs() {
  if (myPairs == null) {
    myPairs = new IntEnumEditor.Pair[] {
      new IntEnumEditor.Pair(FlowLayout.CENTER, UIDesignerBundle.message("property.center")),
      new IntEnumEditor.Pair(FlowLayout.LEFT, UIDesignerBundle.message("property.left")),
      new IntEnumEditor.Pair(FlowLayout.RIGHT, UIDesignerBundle.message("property.right")),
      new IntEnumEditor.Pair(FlowLayout.LEADING, UIDesignerBundle.message("property.leading")),
      new IntEnumEditor.Pair(FlowLayout.TRAILING, UIDesignerBundle.message("property.trailing"))
    };
  }
}
项目:tools-idea    文件:Properties.java   
@Nullable
public IntEnumEditor.Pair[] getEnumPairs(final Class aClass, final String name) {
  for (Class c = aClass; c != null; c = c.getSuperclass()) {
    final Map<String, IntEnumEditor.Pair[]> map = myClass2EnumProperties.get(c.getName());
    if (map != null) {
      return map.get(name);
    }
  }
  return null;
}
项目:consulo-ui-designer    文件:Palette.java   
/**
 * Helper method
 */
private static IntroIntProperty createIntEnumProperty(
  final String name,
  final Method readMethod,
  final Method writeMethod,
  final IntEnumEditor.Pair[] pairs
){
  return new IntroIntProperty(
    name,
    readMethod,
    writeMethod,
    new IntEnumRenderer(pairs),
    new IntEnumEditor(pairs), false);
}
项目:consulo-ui-designer    文件:AlignProperty.java   
private IntEnumEditor.Pair[] getPairs() {
  return new IntEnumEditor.Pair[] {
    new IntEnumEditor.Pair(GridConstraints.ALIGN_LEFT,
                           myHorizontal ? UIDesignerBundle.message("property.left") : UIDesignerBundle.message("property.top")),
    new IntEnumEditor.Pair(GridConstraints.ALIGN_CENTER, UIDesignerBundle.message("property.center")),
    new IntEnumEditor.Pair(GridConstraints.ALIGN_RIGHT,
                           myHorizontal ? UIDesignerBundle.message("property.right") : UIDesignerBundle.message("property.bottom")),
    new IntEnumEditor.Pair(GridConstraints.ALIGN_FILL, UIDesignerBundle.message("property.fill"))
  };
}
项目:consulo-ui-designer    文件:RadFlowLayoutManager.java   
private void initPairs() {
  if (myPairs == null) {
    myPairs = new IntEnumEditor.Pair[] {
      new IntEnumEditor.Pair(FlowLayout.CENTER, UIDesignerBundle.message("property.center")),
      new IntEnumEditor.Pair(FlowLayout.LEFT, UIDesignerBundle.message("property.left")),
      new IntEnumEditor.Pair(FlowLayout.RIGHT, UIDesignerBundle.message("property.right")),
      new IntEnumEditor.Pair(FlowLayout.LEADING, UIDesignerBundle.message("property.leading")),
      new IntEnumEditor.Pair(FlowLayout.TRAILING, UIDesignerBundle.message("property.trailing"))
    };
  }
}
项目:consulo-ui-designer    文件:Properties.java   
@Nullable
public IntEnumEditor.Pair[] getEnumPairs(final Class aClass, final String name)
{
    for(Class c = aClass; c != null; c = c.getSuperclass())
    {
        final Map<String, IntEnumEditor.Pair[]> map = myClass2EnumProperties.get(c.getName());
        if(map != null)
        {
            return map.get(name);
        }
    }
    return null;
}
项目:intellij-ce-playground    文件:IntEnumRenderer.java   
public IntEnumRenderer(@NotNull final IntEnumEditor.Pair[] pairs) {
  myPairs = pairs;
}
项目:intellij-ce-playground    文件:Properties.java   
public Properties(){
  myClass2InplaceProperty = new HashMap<String,String>();
  myClass2ExpertProperties = new HashMap<String,HashSet<String>>();
  myClass2EnumProperties = new HashMap<String, Map<String, IntEnumEditor.Pair[]>>();
  myClass2DeprecatedProperties = new HashMap<String, Set<String>>();
}
项目:tools-idea    文件:IntEnumRenderer.java   
public IntEnumRenderer(@NotNull final IntEnumEditor.Pair[] pairs) {
  myPairs = pairs;
}
项目:tools-idea    文件:Properties.java   
public Properties(){
  myClass2InplaceProperty = new HashMap<String,String>();
  myClass2ExpertProperties = new HashMap<String,HashSet<String>>();
  myClass2EnumProperties = new HashMap<String, Map<String, IntEnumEditor.Pair[]>>();
  myClass2DeprecatedProperties = new HashMap<String, Set<String>>();
}
项目:consulo-ui-designer    文件:IntEnumRenderer.java   
public IntEnumRenderer(@NotNull final IntEnumEditor.Pair[] pairs) {
  myPairs = pairs;
}