Java 类com.intellij.uiDesigner.Properties 实例源码

项目:intellij-ce-playground    文件:Palette.java   
/**
 * @return "inplace" property for the component with the specified class.
 * <b>DO NOT USE THIS METHOD DIRECTLY</b>. Use {@link RadComponent#getInplaceProperty(int, int) }
 * instead.
 */
@Nullable
public IntrospectedProperty getInplaceProperty(@NotNull final RadComponent component) {
  final String inplaceProperty = Properties.getInstance().getInplaceProperty(component.getComponentClass());
  final IntrospectedProperty[] properties = getIntrospectedProperties(component);
  for (int i = properties.length - 1; i >= 0; i--) {
    final IntrospectedProperty property = properties[i];
    if (property.getName().equals(inplaceProperty)) {
      return property;
    }
  }
  return null;
}
项目:tools-idea    文件:Palette.java   
/**
 * @return "inplace" property for the component with the specified class.
 * <b>DO NOT USE THIS METHOD DIRECTLY</b>. Use {@link com.intellij.uiDesigner.radComponents.RadComponent#getInplaceProperty(int, int) }
 * instead.
 */
@Nullable
public IntrospectedProperty getInplaceProperty(@NotNull final RadComponent component) {
  final String inplaceProperty = Properties.getInstance().getInplaceProperty(component.getComponentClass());
  final IntrospectedProperty[] properties = getIntrospectedProperties(component);
  for (int i = properties.length - 1; i >= 0; i--) {
    final IntrospectedProperty property = properties[i];
    if(property.getName().equals(inplaceProperty)){
      return property;
    }
  }
  return null;
}
项目:consulo-ui-designer    文件:Palette.java   
/**
 * @return "inplace" property for the component with the specified class.
 * <b>DO NOT USE THIS METHOD DIRECTLY</b>. Use {@link com.intellij.uiDesigner.radComponents.RadComponent#getInplaceProperty(int, int) }
 * instead.
 */
@Nullable
public IntrospectedProperty getInplaceProperty(@NotNull final RadComponent component) {
  final String inplaceProperty = Properties.getInstance().getInplaceProperty(component.getComponentClass());
  final IntrospectedProperty[] properties = getIntrospectedProperties(component);
  for (int i = properties.length - 1; i >= 0; i--) {
    final IntrospectedProperty property = properties[i];
    if(property.getName().equals(inplaceProperty)){
      return property;
    }
  }
  return null;
}
项目:intellij-ce-playground    文件:PropertyInspectorTable.java   
private SimpleTextAttributes getTextAttributes(final int row, final Property property) {
  // 1. Text
  ErrorInfo errInfo = getErrorInfoForRow(row);

  SimpleTextAttributes result;
  boolean modified;
  try {
    modified = isModifiedForSelection(property);
  }
  catch(Exception ex) {
    // ignore exceptions here - they'll be reported as red property values
    modified = false;
  }
  if (errInfo == null) {
    result = modified ? SimpleTextAttributes.REGULAR_BOLD_ATTRIBUTES : SimpleTextAttributes.REGULAR_ATTRIBUTES;
  }
  else {
    final HighlightSeverity severity = errInfo.getHighlightDisplayLevel().getSeverity();
    Map<HighlightSeverity, SimpleTextAttributes> cache = modified ? myModifiedHighlightAttributes : myHighlightAttributes;
    result = cache.get(severity);
    if (result == null) {
      final TextAttributesKey attrKey = SeverityRegistrar.getSeverityRegistrar(myProject).getHighlightInfoTypeBySeverity(severity).getAttributesKey();
      TextAttributes textAttrs = EditorColorsManager.getInstance().getGlobalScheme().getAttributes(attrKey);
      if (modified) {
        textAttrs = textAttrs.clone();
        textAttrs.setFontType(textAttrs.getFontType() | Font.BOLD);
      }
      result = SimpleTextAttributes.fromTextAttributes(textAttrs);
      cache.put(severity, result);
    }
  }

  if (property instanceof IntrospectedProperty) {
    final RadComponent c = mySelection.get(0);
    if (Properties.getInstance().isPropertyDeprecated(c.getModule(), c.getComponentClass(), property.getName())) {
      return new SimpleTextAttributes(result.getBgColor(), result.getFgColor(), result.getWaveColor(),
                                      result.getStyle() | SimpleTextAttributes.STYLE_STRIKEOUT);
    }
  }

  return result;
}
项目:tools-idea    文件:PropertyInspectorTable.java   
private SimpleTextAttributes getTextAttributes(final int row, final Property property) {
  // 1. Text
  ErrorInfo errInfo = getErrorInfoForRow(row);

  SimpleTextAttributes result;
  boolean modified;
  try {
    modified = isModifiedForSelection(property);
  }
  catch(Exception ex) {
    // ignore exceptions here - they'll be reported as red property values
    modified = false;
  }
  if (errInfo == null) {
    result = modified ? SimpleTextAttributes.REGULAR_BOLD_ATTRIBUTES : SimpleTextAttributes.REGULAR_ATTRIBUTES;
  }
  else {
    final HighlightSeverity severity = errInfo.getHighlightDisplayLevel().getSeverity();
    Map<HighlightSeverity, SimpleTextAttributes> cache = modified ? myModifiedHighlightAttributes : myHighlightAttributes;
    result = cache.get(severity);
    if (result == null) {
      final TextAttributesKey attrKey = SeverityUtil.getSeverityRegistrar(myProject).getHighlightInfoTypeBySeverity(severity).getAttributesKey();
      TextAttributes textAttrs = EditorColorsManager.getInstance().getGlobalScheme().getAttributes(attrKey);
      if (modified) {
        textAttrs = textAttrs.clone();
        textAttrs.setFontType(textAttrs.getFontType() | Font.BOLD);
      }
      result = SimpleTextAttributes.fromTextAttributes(textAttrs);
      cache.put(severity, result);
    }
  }

  if (property instanceof IntrospectedProperty) {
    final RadComponent c = mySelection.get(0);
    if (Properties.getInstance().isPropertyDeprecated(c.getModule(), c.getComponentClass(), property.getName())) {
      return new SimpleTextAttributes(result.getBgColor(), result.getFgColor(), result.getWaveColor(),
                                      result.getStyle() | SimpleTextAttributes.STYLE_STRIKEOUT);
    }
  }

  return result;
}
项目:consulo-ui-designer    文件:PropertyInspectorTable.java   
private SimpleTextAttributes getTextAttributes(final int row, final Property property)
{
    // 1. Text
    ErrorInfo errInfo = getErrorInfoForRow(row);

    SimpleTextAttributes result;
    boolean modified;
    try
    {
        modified = isModifiedForSelection(property);
    }
    catch(Exception ex)
    {
        // ignore exceptions here - they'll be reported as red property values
        modified = false;
    }
    if(errInfo == null)
    {
        result = modified ? SimpleTextAttributes.REGULAR_BOLD_ATTRIBUTES : SimpleTextAttributes.REGULAR_ATTRIBUTES;
    }
    else
    {
        final HighlightSeverity severity = errInfo.getHighlightDisplayLevel().getSeverity();
        Map<HighlightSeverity, SimpleTextAttributes> cache = modified ? myModifiedHighlightAttributes : myHighlightAttributes;
        result = cache.get(severity);
        if(result == null)
        {
            final TextAttributesKey attrKey = SeverityRegistrar.getSeverityRegistrar(myProject).getHighlightInfoTypeBySeverity(severity)
                    .getAttributesKey();
            TextAttributes textAttrs = EditorColorsManager.getInstance().getGlobalScheme().getAttributes(attrKey);
            if(modified)
            {
                textAttrs = textAttrs.clone();
                textAttrs.setFontType(textAttrs.getFontType() | Font.BOLD);
            }
            result = SimpleTextAttributes.fromTextAttributes(textAttrs);
            cache.put(severity, result);
        }
    }

    if(property instanceof IntrospectedProperty)
    {
        final RadComponent c = mySelection.get(0);
        if(Properties.getInstance().isPropertyDeprecated(c.getModule(), c.getComponentClass(), property.getName()))
        {
            return new SimpleTextAttributes(result.getBgColor(), result.getFgColor(), result.getWaveColor(),
                    result.getStyle() | SimpleTextAttributes.STYLE_STRIKEOUT);
        }
    }

    return result;
}