Byte-Welt Forum

Zurück   Byte-Welt Forum > Projekte > DockingFrames

DockingFrames DockingFrames An extension of Swing, used to flexibly arrange windows. - Ist eine Erweiterung von Swing, mit der flexibel Panels angeordnet werden können.

Antwort
 
Themen-Optionen Thema durchsuchen
Alt 30.03.2009, 18:19   #1
notzippy starter
 
Registriert seit: 12.03.2009
Beiträge: 13
notzippy befindet sich auf einem aufstrebenden Ast
Standard Single dockable in a StackableDockStation

Hi

When there is only a single Dockable in a StackDockStation (which is on a splitDockStation) the the StackDockStation.getDockParent() returns null, but as soon as more then one Dockable is added then StackDockStation.getDockParent() does not return null. Also the StackDockStation does not show any tabs if there is only one dockable. This behavior is understandable, but is it configurable ? Can you force the StackDockStation to always show tabs ? (Not sure if relevant but I am using the BubbleTheme)

Thanks
nz
notzippy ist offline   Mit Zitat antworten
Alt 31.03.2009, 08:25   #2
Beni@work
Gast
 
Beiträge: n/a
Standard Re: Single dockable in a StackableDockStation

Are you certain the StackDockStation is in the tree at all? Having no parent suggest otherwise. And the default behavior of DF is to remove any station that has only one child.

If it is not present you might need to install a "SingleParentRemover" at the DockController (using "setSingleParentRemover"), this SPR should then not remove this special StackDockStation.

As far as I understand my old code (StackDockStation.add and BubbleStackDockComponent), tabs should be visible. I'll have to check again in the evening.
  Mit Zitat antworten
Alt 31.03.2009, 16:45   #3
notzippy starter
 
Registriert seit: 12.03.2009
Beiträge: 13
notzippy befindet sich auf einem aufstrebenden Ast
Standard Re: Single dockable in a StackableDockStation

Calling dockController.setSingleParentRemover(null) allowed me to achieve what I wanted to do - That is to always show the tabs.

Thanks
nz
notzippy ist offline   Mit Zitat antworten
Alt 01.06.2009, 16:11   #4
ley
 
Registriert seit: 22.04.2009
Beiträge: 30
ley befindet sich auf einem aufstrebenden Ast
Standard Re: Single dockable in a StackableDockStation

Hi,

I have a StackDockStation with a single dockable and I want to display the single dockable as a tab folder. I used setSingleParentRemover(null); but it's not working.

Java Code:
  1. package bibliothek.notes;
  2.  
  3. import java.awt.BorderLayout;
  4. import java.awt.GridLayout;
  5.  
  6. import javax.swing.JFrame;
  7. import javax.swing.JPanel;
  8.  
  9. import bibliothek.gui.DockFrontend;
  10. import bibliothek.gui.dock.DefaultDockable;
  11. import bibliothek.gui.dock.SplitDockStation;
  12. import bibliothek.gui.dock.StackDockStation;
  13. import bibliothek.gui.dock.station.split.SplitDockProperty;
  14.  
  15. public class Test4 {
  16.  
  17.     public static void main(String[] args) throws Exception {
  18.         JFrame frame = new JFrame();
  19.         JPanel rootPanel = new JPanel();
  20.  
  21.         DockFrontend frontend = new DockFrontend(frame);
  22.         frontend.getController().setSingleParentRemover(null);
  23.         SplitDockStation root = new SplitDockStation();
  24.         frontend.addRoot("root", root);
  25.        
  26.         StackDockStation stack = new StackDockStation();
  27.         stack.setTitleText("Stack");
  28.  
  29.         frontend.getController().setSingleParentRemover(null);
  30.         DefaultDockable a = new DefaultDockable("a");
  31.  
  32.         frontend.addDockable("dockable1", a);
  33.         DefaultDockable b = new DefaultDockable("b");
  34.         frontend.addDockable("dockable2", b);
  35.  
  36.         root.drop(stack, SplitDockProperty.EAST);
  37.         stack.drop(a);
  38.         // stack.drop(b);
  39.        
  40.         rootPanel.setLayout(new GridLayout(1, 1));
  41.         rootPanel.add(root, BorderLayout.CENTER);
  42.  
  43.         frame.add(rootPanel, BorderLayout.CENTER);
  44.         frame.setBounds(20, 20, 500, 500);
  45.         frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  46.         frame.setVisible(true);
  47.     }
  48. }

Thank you,
ley
ley ist offline   Mit Zitat antworten
Alt 02.06.2009, 17:46   #5
Unregistered
Gast
 
Beiträge: n/a
Standard Re: Single dockable in a StackableDockStation

Sorry my mistype, setting single parent remover to null ensured that the dockable was not merged into its parents parent station, it did not guarantee that the tab would be visible

nz
  Mit Zitat antworten
Alt 02.06.2009, 18:03   #6
Beni
Moderator
 
Benutzerbild von Beni
 
Registriert seit: 27.08.2006
Beiträge: 571
Beni befindet sich auf einem aufstrebenden Ast
Beni eine Nachricht über Skype™ schicken
Standard AW: Single dockable in a StackableDockStation

Currently single tabs are not implemented. One would need to update the code of StackDockStation to allow that. Sorry, but I'm currently too busy to do that.
__________________
Beni ist offline   Mit Zitat antworten
Alt 19.07.2010, 17:41   #7
Unregistriert
Gast
 
Beiträge: n/a
Standard AW: Single dockable in a StackableDockStation

Is it possible now with Version 1.0.8 to have a Single dockable in a StackableDockStation?

I tested with preview 5 (not preview 5d since I could not update to preview 5d because of non-matching Glass Extension) and tried the following:
- control.putProperty(SingleTabDecider.SINGLE_TAB_DE CIDER, SingleTabDecider.ALLWAYS);
-
Code:
control.putProperty(SingleTabDecider.SINGLE_TAB_DECIDER, new CommonSingleTabDecider(control) {
    /**
 * @new
 */
    @Override
    public boolean showSingleTab (DockStation station, Dockable dockable) {
        if( dockable instanceof CommonDockable ){
            CDockable cdockable = ((CommonDockable) dockable).getDockable();
            return cdockable.isSingleTabShown();
        }

        return false;
    }

});
-
Code:
dockable.setTitleShown(true);
dockable.setSingleTabShown(true);
None of these worked. What would be the correct solution?
Or will it be possible in preview 5d?
  Mit Zitat antworten
Alt 19.07.2010, 18:34   #8
Beni
Moderator
 
Benutzerbild von Beni
 
Registriert seit: 27.08.2006
Beiträge: 571
Beni befindet sich auf einem aufstrebenden Ast
Beni eine Nachricht über Skype™ schicken
Standard Re: Single dockable in a StackableDockStation

Yes, Singe-tabs are possible since 1.0.8p1.

You won't see any effect if you use the EclipseTheme, but you will see a change when using any other theme. Calling "setSingleTabShown" is the correct solution. It's working in my applications (1.0.8p5d), you are sure you call the method on the right objects? You don't override the settings later?

(P.S. I'll upload a new glass-extension ASAP, then you can use the newest version).
__________________
Beni ist offline   Mit Zitat antworten
Alt 20.07.2010, 11:55   #9
Unregistriert
Gast
 
Beiträge: n/a
Standard AW: Single dockable in a StackableDockStation

I now tested with version 1.0.8 preview 5d using

Code:
dockable.setSingleTabShown(true);
and

Code:
control.setTheme(ThemeMap.KEY_ECLIPSE_THEME); // Want to use Eclipse Theme
control.putProperty(SingleTabDecider.SINGLE_TAB_DECIDER, new CustomCommonSingleTabDecider(control));
and

Code:
private static class CustomCommonSingleTabDecider extends CommonSingleTabDecider {

    //---- Constructors

    public CustomCommonSingleTabDecider (CControl control) {
        super(control);
    }

    //---- Methods

    @Override
    public boolean showSingleTab (DockStation station, Dockable dockable) {
        if (dockable.asDockStation() != null) {
            return false;
        }
        if (dockable instanceof CommonDockable) {
            final CDockable cdockable= ((CommonDockable) dockable).getDockable();
            return cdockable.isSingleTabShown();
        }

        return false;
    }

}
What else do I have to do to support Singe-tabs also in Eclipse theme?

When running the demo application in bibliothek.sizeAndColor Singe-tabs are also supported for Eclipse theme.

Thanks in advance
  Mit Zitat antworten
Alt 20.07.2010, 16:38   #10
Beni
Moderator
 
Benutzerbild von Beni
 
Registriert seit: 27.08.2006
Beiträge: 571
Beni befindet sich auf einem aufstrebenden Ast
Beni eine Nachricht über Skype™ schicken
Standard Re: Single dockable in a StackableDockStation

I'm currently without a good idea why it should not work. Could you provide a small example application that reproduces the failure?

I assume you do not play around with a "EclipseThemeConnector"? That would be my only idea how to accidentally "kill" tabs in the EclipseTheme.
__________________
Beni ist offline   Mit Zitat antworten
Antwort

Lesezeichen

Stichworte
-


Aktive Benutzer in diesem Thema: 1 (Registrierte Benutzer: 0, Gäste: 1)
 
Themen-Optionen Thema durchsuchen
Thema durchsuchen:

Erweiterte Suche

Forumregeln
Es ist Ihnen erlaubt, neue Themen zu verfassen.
Es ist Ihnen erlaubt, auf Beiträge zu antworten.
Es ist Ihnen nicht erlaubt, Anhänge hochzuladen.
Es ist Ihnen nicht erlaubt, Ihre Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.


Ähnliche Themen
Thema Autor Forum Antworten Letzter Beitrag
Maximize an externalized dockable Peter DockingFrames 5 05.01.2009 21:41
Location of a closed dockable Peter DockingFrames 4 02.11.2008 18:21
[Erledigt] Moving external dockable Unregistered DockingFrames 1 03.09.2008 16:25
Cannot close dockable which appears before focused dockable Parag DockingFrames 1 14.08.2008 20:38
[Erledigt] Dockable sizes and dockable closing in common API Michal Krause DockingFrames 11 27.07.2008 14:07


Alle Zeitangaben in WEZ +1. Es ist jetzt 05:50 Uhr.


Powered by vBulletin® Version 3.8.2 (Deutsch)
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.