Package bibliothek.util

Examples of bibliothek.util.Path


    // need to reset
    List<Location> history = getPropertyHistory( dockable.intern() );
    CLocationMode next = null;
    for( int i = history.size()-1; i >= 0 && next == null; i-- ){
      Location check = history.get( i );
      Path path = check.getMode();
      String root = check.getRoot();
      if( path != null && root != null ){
        CLocationMode mode = getMode( path );
        if( mode != null ){
          CStation<?> station = control.getOwner().getStation( root );
View Full Code Here


            DockableEntry entry = new DockableEntry();
            dockables.add( entry );
            entry.id = in.readUTF();
            if( in.readBoolean() ){
              String key = in.readUTF();
                entry.current = version7 ? resuceMode( key ) : new Path( key );
            }
           
            entry.history = new Path[ in.readInt() ];
            for( int j = 0; j < entry.history.length; j++ ){
              String key = in.readUTF();
                entry.history[j] = version7 ? resuceMode( key ) : new Path( key );
            }
           
            if( version7 ){
              int count = 0;
              for( int j = 0; j < entry.history.length; j++ ){
                if( entry.history[j] != null ){
                  count++;
                }
              }
              if( count != entry.history.length ){
                Path[] temp = entry.history;
                entry.history = new Path[ count ];
                int index = 0;
                for( int j = 0; j < temp.length; j++ ){
                  if( temp[j] != null ){
                    entry.history[ index++ ] = temp[j];
                  }
                }
              }
            }
           
            entry.properties = new HashMap<Path, B>();
            for( int j = 0, m = in.readInt(); j<m; j++ ){
              String key = in.readUTF();
              Path mode = version7 ? resuceMode( key ) : new Path( key );
              B property = converter.readProperty( in );
              if( mode != null ){
                entry.properties.put( mode, property );
              }
            }
        }
       
        // new since 1.0.8
        modes.clear();
       
        if( version7 ){
            rescueSettings( in, version );
        }
        else{
          for( int i = 0, n = in.readInt(); i<n; i++ ){
            Path id = new Path( in.readUTF() );
           
            int count = in.readInt();
            byte[] content = new byte[ count ];
           
            int offset = 0;
View Full Code Here

            DockableEntry entry = new DockableEntry();
            dockables.add( entry );
            entry.id = xentry.getString( "id" );
            XAttribute current = xentry.getAttribute( "current" );
            if( current != null )
              entry.current = new Path( current.getString() );

            XElement xhistory = xentry.getElement( "history" );
            if( xhistory == null )
              entry.history = new Path[]{};
            else{
              XElement[] xmodes = xhistory.getElements( "mode" );
              entry.history = new Path[ xmodes.length ];
              for( int i = 0; i < xmodes.length; i++ )
                entry.history[i] = new Path( xmodes[i].getString() );
            }

            XElement xproperties = xentry.getElement( "properties" );
            entry.properties = new HashMap<Path, B>();
            if( xproperties != null ){
              for( XElement xproperty : xproperties.getElements( "property" )){
                entry.properties.put( new Path( xproperty.getString( "id" )), converter.readPropertyXML( xproperty ) );
              }
            }
          }
        }
       
        modes.clear();
        XElement melement = element.getElement( "modes" );
        if( melement != null ){
          for( XElement xmode : melement.getElements( "entry" )){
            Path id = new Path( xmode.getString( "id" ));
            ModeSettingFactory<A> factory = factories.get( id );
            if( factory != null ){
              ModeSetting<A> setting = factory.create();
              setting.read( xmode, converter );
              modes.put( setting.getModeId(), setting );
View Full Code Here

                CColorBridgeExtension.EXTENSION_NAME, CColorBridgeExtension.class, CColorBridgeExtension.PARAMETER_NAME, this );
            List<CColorBridgeExtension> extensions = controller.getExtensions().load( name );
           
            for( Map.Entry<Path, ColorBridgeFactory> entry : colorBridgeFactories.entrySet() ){
                ColorBridge bridge = entry.getValue().create( colors );
                Path key = entry.getKey();
               
                List<CColorBridgeExtension> filtered = new ArrayList<CColorBridgeExtension>();
                for( CColorBridgeExtension extension : extensions ){
                  if( key.equals( extension.getKey() )){
                    filtered.add( extension );
                  }
                }

                if( !filtered.isEmpty() ){
View Full Code Here

                  temporary.add( key );
                }
            }
           
            if( entry != null ){
                Path current = settings.getCurrent( i );
                Path old = null;
                if( entry.dockable != null ){
                  M oldMode = getCurrentMode( entry.dockable );
                  if( oldMode != null ){
                    old = oldMode.getUniqueIdentifier();
                  }
                }
               
                if( current == null )
                    current = old;
               
                entry.history.clear();
                for( Path next : settings.getHistory( i ))
                    entry.history.add( next );
               
                entry.properties = settings.getProperties( i );
               
                if( (old == null && current != null) || (old != null && !old.equals( current ))){
                    applyDuringRead( key, old, current, entry.dockable );
                }
            }
        }
   
View Full Code Here

         */
        public void putMode( ModeHandle mode ){
          if( mode != null ){
            ModeHandle oldMode = peekMode();
              if( oldMode != mode ){
                Path id = mode.mode.getUniqueIdentifier();
                addToHistory( id, mode.mode.current( dockable ) );
                rebuild( dockable );
                fireModeChanged( dockable, oldMode == null ? null : oldMode.mode, mode.mode );
              }
              else{
View Full Code Here

    maybeDeploy();

    // find current location
    LocationModeManagerPerspective manager = perspective.getLocationManager();
    Location location = manager.getLocation( dockable );
    Path mode = null;
    if( location == null ) {
      ExtendedMode eMode = manager.getMode( dockable );
      if( eMode != null ) {
        mode = eMode.getModeIdentifier();
      }
View Full Code Here

     * @param combiner how to combine paths of models and of preferences
     */
    public CPreferenceModel( CControl control, PathCombiner combiner ){
        super( combiner, control.getController() );
        DockController controller = control.intern().getController();
        putLinked( new Path( "shortcuts" ), "preference.shortcuts", new CKeyStrokePreferenceModel( controller.getProperties() ) );
        putLinked( new Path( "buttonContent" ), "preference.buttonContent", new ButtonContentPreferenceModel( controller ) );
        putLinked( new Path( "layout" ), "preference.layout", new CLayoutPreferenceModel( control ));
        putLinked( new Path( "layout.BubbleTheme" ), "theme.bubble", new BubbleThemePreferenceModel( controller.getProperties() ));
        putLinked( new Path( "layout.EclipseTheme" ), "theme.eclipse", new EclipseThemePreferenceModel( controller.getProperties() ));
    }
View Full Code Here

     * Grants access to the preferences concerning the global {@link KeyStroke}s.
     * @return the model, not <code>null</code>
     * @throws IllegalStateException if the model was removed or replaced by the client
     */
    public CKeyStrokePreferenceModel getKeyStrokePreferences(){
      PreferenceModel model = getModel( new Path( "shortcuts" ) );
      if( model instanceof CKeyStrokePreferenceModel ){
        return (CKeyStrokePreferenceModel)model;
      }
      else{
        throw new IllegalStateException( "this model has been removed" );
View Full Code Here

     * Grants access to the preferences concerning layout options like "where are the tabs placed?".
     * @return the model, not <code>null</code>
     * @throws IllegalStateException if the model was removed or replaced by the client
     */
    public CLayoutPreferenceModel getLayoutPreferences(){
      PreferenceModel model = getModel( new Path( "layout" ) );
      if( model instanceof CLayoutPreferenceModel ){
        return (CLayoutPreferenceModel)model;
      }
      else{
        throw new IllegalStateException( "this model has been removed" );
View Full Code Here

TOP

Related Classes of bibliothek.util.Path

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.