gpt4 book ai didi

bibliothek.util.xml.XElement.()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-19 05:40:40 25 4
gpt4 key购买 nike

本文整理了Java中bibliothek.util.xml.XElement.<init>()方法的一些代码示例,展示了XElement.<init>()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XElement.<init>()方法的具体详情如下:
包路径:bibliothek.util.xml.XElement
类名称:XElement
方法名:<init>

XElement.<init>介绍

[英]Creates a new entry with given name.
[中]创建具有给定名称的新条目。

代码示例

代码示例来源:origin: xyz.cofe/docking-frames-core

@Override
public XElement copy() {
  XElement copy = new XElement( name );
  copy.copy( this );
  return copy;
}

代码示例来源:origin: org.opentcs.thirdparty.dockingframes/docking-frames-core

@Override
public XElement copy() {
  XElement copy = new XElement( name );
  copy.copy( this );
  return copy;
}

代码示例来源:origin: xyz.cofe/docking-frames-core

/**
 * Creates and adds a new element.
 * @param name the name of the new element
 * @return the new element
 */
public XElement addElement( String name ){
  XElement element = new XElement( name );
  addElement( element );
  return element;
}

代码示例来源:origin: org.opentcs.thirdparty.dockingframes/docking-frames-core

/**
 * Creates and adds a new element.
 * @param name the name of the new element
 * @return the new element
 */
public XElement addElement( String name ){
  XElement element = new XElement( name );
  addElement( element );
  return element;
}

代码示例来源:origin: org.opentcs.thirdparty.dockingframes/docking-frames-common

/**
 * Writes the current and all known layouts into <code>file</code> in xml format.
 * @param file the file to write into
 * @throws IOException if the file is not writable
 */
public void writeXML( File file ) throws IOException{
  XElement root = new XElement( "root" );
  getResources().writeXML( root );
  BufferedOutputStream out = new BufferedOutputStream( new FileOutputStream( file ));
  XIO.writeUTF( root, out );
  out.close();
}

代码示例来源:origin: xyz.cofe/docking-frames-common

/**
 * Writes the current and all known layouts into <code>file</code> in xml format.
 * @param file the file to write into
 * @throws IOException if the file is not writable
 */
public void writeXML( File file ) throws IOException{
  XElement root = new XElement( "root" );
  getResources().writeXML( root );
  BufferedOutputStream out = new BufferedOutputStream( new FileOutputStream( file ));
  XIO.writeUTF( root, out );
  out.close();
}

代码示例来源:origin: xyz.cofe/docking-frames-core

@Override
public void startElement( String uri, String localName, String name,
    Attributes attributes ) throws SAXException {
  XElement element = new XElement( name );
  if( this.element == null ){
    this.element = element;
  }
  else{
    stack.getFirst().addElement( element );
  }
  
  stack.addFirst( element );
  
  // read the attributes
  for( int i = 0, n = attributes.getLength(); i<n; i++ ){
    XAttribute attr = new XAttribute( attributes.getQName( i ));
    attr.setString( attributes.getValue( i ));
    element.addAttribute( attr );
  }
}

代码示例来源:origin: org.opentcs.thirdparty.dockingframes/docking-frames-core

@Override
public void startElement( String uri, String localName, String name,
    Attributes attributes ) throws SAXException {
  XElement element = new XElement( name );
  if( this.element == null ){
    this.element = element;
  }
  else{
    stack.getFirst().addElement( element );
  }
  
  stack.addFirst( element );
  
  // read the attributes
  for( int i = 0, n = attributes.getLength(); i<n; i++ ){
    XAttribute attr = new XAttribute( attributes.getQName( i ));
    attr.setString( attributes.getValue( i ));
    element.addAttribute( attr );
  }
}

代码示例来源:origin: org.orbisgis/orbisgis-view

private void writeXML() throws IOException {
    // Not visible toolbars cannot retrieve their state on next OrbisGIS loading
    for(ToolBarItem item : getToolBarItems()) {
      item.setVisible(true);
      item.setTrackActionVisibleState(false);
    }
    // Make an empty XML tree
    XElement root = new XElement( "root" );
    
    // Use the docking frame serialisation
    commonControl.writeXML(root);
    // Save the tree in the file
    BufferedOutputStream out = new BufferedOutputStream( new FileOutputStream( dockingState ));
    XIO.writeUTF( root, out );
    out.close();
    // Recover original state
    refreshToolBarsState();
}

代码示例来源:origin: org.orbisgis/orbisgis-view

XElement backup = new XElement("layout");
commonControl.writeXML(backup);
try {

代码示例来源:origin: xyz.cofe/docking-frames-common

@SuppressWarnings("unchecked")
public void write( CommonDockStationLayout layout, XElement element ){
  String factoryId = layout.getFactoryId();
  DockFactory<DockElement, ?, Object> factory = (DockFactory<DockElement, ?, Object>)control.intern().getDockFactory( factoryId );
  XElement content = layout.getLayoutXML();
  if( content == null ){
    layout.updateLayout( factory, null );
    DockLayout<?> data = layout.getLayout();
    if( data == null ){
      throw new XException( "data are null, but data were just updated" );
    }
    content = new XElement("content");
    factory.write( data.getData(), content );
  }
  
  String id = layout.getId();
  if( id != null ){
    element.addElement( "id" ).setString( id );
  }
  element.addElement( "root" ).setBoolean( layout.isRoot() );
  
  content.addString( "delegate", factoryId );
  element.addElement( content );
}

代码示例来源:origin: org.opentcs.thirdparty.dockingframes/docking-frames-common

@SuppressWarnings("unchecked")
public void write( CommonDockStationLayout layout, XElement element ){
  String factoryId = layout.getFactoryId();
  DockFactory<DockElement, ?, Object> factory = (DockFactory<DockElement, ?, Object>)control.intern().getDockFactory( factoryId );
  XElement content = layout.getLayoutXML();
  if( content == null ){
    layout.updateLayout( factory, null );
    DockLayout<?> data = layout.getLayout();
    if( data == null ){
      throw new XException( "data are null, but data were just updated" );
    }
    content = new XElement("content");
    factory.write( data.getData(), content );
  }
  
  String id = layout.getId();
  if( id != null ){
    element.addElement( "id" ).setString( id );
  }
  element.addElement( "root" ).setBoolean( layout.isRoot() );
  
  content.addString( "delegate", factoryId );
  element.addElement( content );
}

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com