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


Java JDOMExternalizable类代码示例

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


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

示例1: write

import com.intellij.openapi.util.JDOMExternalizable; //导入依赖的package包/类
static Element write(ProjectRoot projectRoot) throws WriteExternalException {
  Element element = new Element(ELEMENT_ROOT);
  if (projectRoot instanceof SimpleProjectRoot) {
    element.setAttribute(ATTRIBUTE_TYPE, SIMPLE_ROOT);
    ((JDOMExternalizable)projectRoot).writeExternal(element);
  }
  else if (projectRoot instanceof CompositeProjectRoot) {
    element.setAttribute(ATTRIBUTE_TYPE, COMPOSITE_ROOT);
    ((CompositeProjectRoot)projectRoot).writeExternal(element);
  }
  else {
    throw new IllegalArgumentException("Wrong root: " + projectRoot);
  }

  return element;
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:17,代码来源:ProjectRootUtil.java

示例2: deserializeState

import com.intellij.openapi.util.JDOMExternalizable; //导入依赖的package包/类
@SuppressWarnings({"unchecked"})
@Nullable
public static <T> T deserializeState(@Nullable Element stateElement, Class <T> stateClass, @Nullable T mergeInto) {
  if (stateElement == null) {
    return mergeInto;
  }
  else if (stateClass == Element.class) {
    return (T)stateElement;
  }
  else if (JDOMExternalizable.class.isAssignableFrom(stateClass)) {
    if (mergeInto != null) {
      String elementText = JDOMUtil.writeElement(stateElement, "\n");
      LOG.error("State is " + stateClass.getName() + ", merge into is " + mergeInto.toString() + ", state element text is " + elementText);
    }

    T t = ReflectionUtil.newInstance(stateClass);
    try {
      ((JDOMExternalizable)t).readExternal(stateElement);
      return t;
    }
    catch (InvalidDataException e) {
      throw new RuntimeException(e);
    }
  }
  else if (mergeInto == null) {
    return XmlSerializer.deserialize(stateElement, stateClass);
  }
  else {
    XmlSerializer.deserializeInto(mergeInto, stateElement);
    return mergeInto;
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:33,代码来源:DefaultStateSerializer.java

示例3: serializeState

import com.intellij.openapi.util.JDOMExternalizable; //导入依赖的package包/类
@Nullable
static Element serializeState(@Nonnull Object state, @Nullable final Storage storage) throws WriteExternalException {
  if (state instanceof Element) {
    return (Element)state;
  }
  else if (state instanceof JDOMExternalizable) {
    Element element = new Element("temp_element");
    ((JDOMExternalizable)state).writeExternal(element);
    return element;
  }
  else {
    return XmlSerializer.serializeIfNotDefault(state, new SkipDefaultValuesSerializationFilters());
  }
}
 
开发者ID:consulo,项目名称:consulo,代码行数:15,代码来源:DefaultStateSerializer.java

示例4: deserializeState

import com.intellij.openapi.util.JDOMExternalizable; //导入依赖的package包/类
@SuppressWarnings({"unchecked"})
@Nullable
public static <T> T deserializeState(@Nullable Element stateElement, Class <T> stateClass, @Nullable T mergeInto) throws StateStorageException {
  if (stateElement == null) return mergeInto;

  if (stateClass.equals(Element.class)) {
    //assert mergeInto == null;
    return (T)stateElement;
  }
  else if (JDOMExternalizable.class.isAssignableFrom(stateClass)) {
    if (mergeInto != null) {
      String elementText = JDOMUtil.writeElement(stateElement, "\n");
      LOG.error("State is " + stateClass.getName() + ", merge into is " + mergeInto.toString() + ", state element text is " + elementText);
    }
    final T t = ReflectionUtil.newInstance(stateClass);
    try {
      ((JDOMExternalizable)t).readExternal(stateElement);
      return t;
    }
    catch (InvalidDataException e) {
      throw new StateStorageException(e);
    }
  }
  else if (mergeInto == null) {
    return XmlSerializer.deserialize(stateElement, stateClass);
  }
  else {
    XmlSerializer.deserializeInto(mergeInto, stateElement);
    return mergeInto;
  }
}
 
开发者ID:consulo,项目名称:consulo,代码行数:32,代码来源:DefaultStateSerializer.java

示例5: registerProperty

import com.intellij.openapi.util.JDOMExternalizable; //导入依赖的package包/类
/**
 * @deprecated
 */
public <T extends JDOMExternalizable> void  registerProperty(ListProperty<T> property, @NonNls String itemTagName, Factory<T> factory) {
  registerProperty(property, itemTagName, Externalizer.FactoryBased.create(factory));
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:7,代码来源:ExternalizablePropertyContainer.java

示例6: create

import com.intellij.openapi.util.JDOMExternalizable; //导入依赖的package包/类
public static <T extends JDOMExternalizable> FactoryBased<T> create(Factory<T> factory) {
  return new FactoryBased<T>(factory);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:4,代码来源:Externalizer.java

示例7: readExternal

import com.intellij.openapi.util.JDOMExternalizable; //导入依赖的package包/类
public void readExternal(Element element) throws InvalidDataException {
    ((JDOMExternalizable)editorOptions).readExternal(element);
    ((JDOMExternalizable)externalEditorOptions).readExternal(element);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:5,代码来源:OptionsImpl.java

示例8: writeExternal

import com.intellij.openapi.util.JDOMExternalizable; //导入依赖的package包/类
public void writeExternal(Element element) throws WriteExternalException {
    ((JDOMExternalizable)editorOptions).writeExternal(element);
    ((JDOMExternalizable)externalEditorOptions).writeExternal(element);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:5,代码来源:OptionsImpl.java

示例9: readExternal

import com.intellij.openapi.util.JDOMExternalizable; //导入依赖的package包/类
public void readExternal(Element element) throws InvalidDataException {
    ((JDOMExternalizable)gridOptions).readExternal(element);
    ((JDOMExternalizable)transparencyChessboardOptions).readExternal(element);
    ((JDOMExternalizable)zoomOptions).readExternal(element);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:6,代码来源:EditorOptionsImpl.java

示例10: writeExternal

import com.intellij.openapi.util.JDOMExternalizable; //导入依赖的package包/类
public void writeExternal(Element element) throws WriteExternalException {
    ((JDOMExternalizable)gridOptions).writeExternal(element);
    ((JDOMExternalizable)transparencyChessboardOptions).writeExternal(element);
    ((JDOMExternalizable)zoomOptions).writeExternal(element);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:6,代码来源:EditorOptionsImpl.java

示例11: bindList

import com.intellij.openapi.util.JDOMExternalizable; //导入依赖的package包/类
public <T extends JDOMExternalizable> TableListBinding<T> bindList(JTable table, ColumnInfo[] columns, ListProperty<T> property) {
  final TableListBinding<T> binding = new TableListBinding<T>(table, columns, property);
  myBindings.add(binding);
  return binding;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:6,代码来源:UIPropertyBinding.java

示例12: JDOMExternalizableWrapper

import com.intellij.openapi.util.JDOMExternalizable; //导入依赖的package包/类
public JDOMExternalizableWrapper(JDOMExternalizable jdomExternalizable) {
  myJDOMExternalizable = jdomExternalizable;
}
 
开发者ID:consulo,项目名称:consulo,代码行数:4,代码来源:JDOMExternalizableWrapper.java


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