Tabnine Logo
DockLayoutInfo.getDataXML
Code IndexAdd Tabnine to your IDE (free)

How to use
getDataXML
method
in
bibliothek.gui.dock.layout.DockLayoutInfo

Best Java code snippets using bibliothek.gui.dock.layout.DockLayoutInfo.getDataXML (Showing top 11 results out of 315)

origin: org.opentcs.thirdparty.dockingframes/docking-frames-common

/**
 * Gets the layout information as xml element, assuming that the layout information is stored
 * in xml.
 * @return the layout information or <code>null</code> if not stored in xml format
 */
public XElement getLayoutXML(){
  return layout.getDataXML();
}

origin: xyz.cofe/docking-frames-common

/**
 * Gets the layout information as xml element, assuming that the layout information is stored
 * in xml.
 * @return the layout information or <code>null</code> if not stored in xml format
 */
public XElement getLayoutXML(){
  return layout.getDataXML();
}

origin: xyz.cofe/docking-frames-core

return info.getDataXML().getString( "factory" );
origin: xyz.cofe/docking-frames-common

/**
 * Updates the contents of the internal {@link DockLayoutInfo} using <code>factory</code> to read
 * a byte array or an {@link XElement}.
 * @param factory the factory used to read the layout
 * @param placeholders the placeholders that may be used
 */
public void updateLayout( DockFactory<?, ?, Object> factory, PlaceholderStrategy placeholders ){
  try{
    Object data = null;
    
    switch( layout.getKind() ){
      case BYTE:
        data = factory.read( new DataInputStream( new ByteArrayInputStream( layout.getDataByte() ) ), placeholders );
        break;
      case XML:
        data = factory.read( layout.getDataXML(), placeholders );
        break;
    }
    
    if( data != null ){
      layout.setData( new DockLayout<Object>( factory.getID(), data ) );
    }
  }
  catch( IOException e ){
    // since a ByteArrayInputStream never throws an IOException this should never happen
    throw new IllegalStateException( e );
  }
}

origin: org.opentcs.thirdparty.dockingframes/docking-frames-common

/**
 * Updates the contents of the internal {@link DockLayoutInfo} using <code>factory</code> to read
 * a byte array or an {@link XElement}.
 * @param factory the factory used to read the layout
 * @param placeholders the placeholders that may be used
 */
public void updateLayout( DockFactory<?, ?, Object> factory, PlaceholderStrategy placeholders ){
  try{
    Object data = null;
    
    switch( layout.getKind() ){
      case BYTE:
        data = factory.read( new DataInputStream( new ByteArrayInputStream( layout.getDataByte() ) ), placeholders );
        break;
      case XML:
        data = factory.read( layout.getDataXML(), placeholders );
        break;
    }
    
    if( data != null ){
      layout.setData( new DockLayout<Object>( factory.getID(), data ) );
    }
  }
  catch( IOException e ){
    // since a ByteArrayInputStream never throws an IOException this should never happen
    throw new IllegalStateException( e );
  }
}

origin: xyz.cofe/docking-frames-core

info = readEntry( info.getDataXML() );
if( info != null && info.getKind() == DockLayoutInfo.Data.XML ){
  info = original;
origin: xyz.cofe/docking-frames-core

@SuppressWarnings("unchecked")
public void write( PredefinedLayout layout, XElement element ) {
  element.addElement( "replacement" ).addString( "id", layout.getPredefined() );
  DockLayoutInfo info = layout.getDelegate();
  if( info.getKind() == DockLayoutInfo.Data.XML ){
    element.addElement( info.getDataXML() );
  }
  else if( info.getKind() == DockLayoutInfo.Data.DOCK_LAYOUT ){
    DockLayout<?> delegate = layout.getDelegate().getDataLayout();
    String factoryId = delegate.getFactoryID();
    DockFactory<DockElement,?,Object> factory = (DockFactory<DockElement,?,Object>)getFactory( factoryId );
    if( factory == null )
      throw new XException( "Missing factory: " + factoryId );
    XElement xdelegate = element.addElement( "delegate" );
    xdelegate.addString( "id", factoryId );
    factory.write( delegate.getData(), xdelegate );    
  }
  else if( info.getKind() == DockLayoutInfo.Data.NULL ){
    // nothing to store
  }
  else{
    throw new IllegalArgumentException( "Cannot store information as xml, it is neither present as raw xml nor in an understandable format" );
  }
}
origin: org.opentcs.thirdparty.dockingframes/docking-frames-core

@SuppressWarnings("unchecked")
public void write( PredefinedLayout layout, XElement element ) {
  element.addElement( "replacement" ).addString( "id", layout.getPredefined() );
  DockLayoutInfo info = layout.getDelegate();
  if( info.getKind() == DockLayoutInfo.Data.XML ){
    element.addElement( info.getDataXML() );
  }
  else if( info.getKind() == DockLayoutInfo.Data.DOCK_LAYOUT ){
    DockLayout<?> delegate = layout.getDelegate().getDataLayout();
    String factoryId = delegate.getFactoryID();
    DockFactory<DockElement,?,Object> factory = (DockFactory<DockElement,?,Object>)getFactory( factoryId );
    if( factory == null )
      throw new XException( "Missing factory: " + factoryId );
    XElement xdelegate = element.addElement( "delegate" );
    xdelegate.addString( "id", factoryId );
    factory.write( delegate.getData(), xdelegate );    
  }
  else if( info.getKind() == DockLayoutInfo.Data.NULL ){
    // nothing to store
  }
  else{
    throw new IllegalArgumentException( "Cannot store information as xml, it is neither present as raw xml nor in an understandable format" );
  }
}
origin: xyz.cofe/docking-frames-core

/**
 * Tries to read the xml data in <code>layout</code>.
 * @param layout the layout to read
 * @return either a new info or <code>null</code> if the data could
 * not be read
 */
@SuppressWarnings("unchecked")
private DockLayoutInfo fillMissingXML( PredefinedLayout layout ){
  XElement xdelegate = layout.getDelegate().getDataXML();
  String factoryId = xdelegate.getString( "id" );
  Object delegate = null;
  DockFactory<DockElement,?,Object> factory = (DockFactory<DockElement,?,Object>)getFactory( factoryId );
  if( factory == null ){
    DockFactory<?,?,BackupFactoryData<?>> backup = getBackup( factoryId );
    if( backup != null ){
      BackupFactoryData<Object> data = (BackupFactoryData<Object>)backup.read( xdelegate, getPlaceholderStrategy() );
      if( data != null )
        delegate = data.getData();
    }
  }
  else{
    delegate = factory.read( xdelegate, getPlaceholderStrategy() );
  }
  if( delegate == null ){
    return null;
  }
  
  return new DockLayoutInfo( new DockLayout<Object>( factoryId, delegate ) );
}

origin: org.opentcs.thirdparty.dockingframes/docking-frames-core

/**
 * Tries to read the xml data in <code>layout</code>.
 * @param layout the layout to read
 * @return either a new info or <code>null</code> if the data could
 * not be read
 */
@SuppressWarnings("unchecked")
private DockLayoutInfo fillMissingXML( PredefinedLayout layout ){
  XElement xdelegate = layout.getDelegate().getDataXML();
  String factoryId = xdelegate.getString( "id" );
  Object delegate = null;
  DockFactory<DockElement,?,Object> factory = (DockFactory<DockElement,?,Object>)getFactory( factoryId );
  if( factory == null ){
    DockFactory<?,?,BackupFactoryData<?>> backup = getBackup( factoryId );
    if( backup != null ){
      BackupFactoryData<Object> data = (BackupFactoryData<Object>)backup.read( xdelegate, getPlaceholderStrategy() );
      if( data != null )
        delegate = data.getData();
    }
  }
  else{
    delegate = factory.read( xdelegate, getPlaceholderStrategy() );
  }
  if( delegate == null ){
    return null;
  }
  
  return new DockLayoutInfo( new DockLayout<Object>( factoryId, delegate ) );
}

origin: xyz.cofe/docking-frames-core

DockLayoutInfo info = composition.getLayout();
if( info.getKind() == DockLayoutInfo.Data.XML ){
  element.addElement( info.getDataXML() );
bibliothek.gui.dock.layoutDockLayoutInfogetDataXML

Javadoc

Gets the data of this info formated as xml.

Popular methods of DockLayoutInfo

  • setLocation
    Sets the location of the Dockable ,represented by this info, on its parent station.
  • <init>
    Creates a new info.
  • getDataByte
    Gets the data of this info as byte array.
  • getDataLayout
    Gets the data of this info as DockLayout.
  • getKind
    Tells what kind of information can be found in this info.
  • getLocation
    Gets the location of of the Dockable on its parent station.
  • setData
    Sets the information of this info. The object data must either be null, or an instance of XElement,b
  • getPlaceholder
    Gets the representation of this element as placeholder.
  • setPlaceholder
    Sets a placeholder which represents this element.

Popular in Java

  • Reading from database using SQL prepared statement
  • scheduleAtFixedRate (ScheduledExecutorService)
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • notifyDataSetChanged (ArrayAdapter)
  • IOException (java.io)
    Signals a general, I/O-related error. Error details may be specified when calling the constructor, a
  • Collection (java.util)
    Collection is the root of the collection hierarchy. It defines operations on data collections and t
  • Enumeration (java.util)
    A legacy iteration interface.New code should use Iterator instead. Iterator replaces the enumeration
  • LinkedList (java.util)
    Doubly-linked list implementation of the List and Dequeinterfaces. Implements all optional list oper
  • NoSuchElementException (java.util)
    Thrown when trying to retrieve an element past the end of an Enumeration or Iterator.
  • BoxLayout (javax.swing)
  • CodeWhisperer alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now