CPerspective

I am glad to see CPerspective?but SingleCDockableFactory is still only [ public SingleCDockable createBackup( String id );]
Many times not only in the constructor initialization.I hope to have more opportunity to control the initialization.
Some initialization need after setvisble(true).but SingleCDockableFactory does not give me a chance.

Why after setvisble(true)?Because Initialization time may be long,need to display a progress bar and lock view.

sorry,my English is very bad. hope you understand.

I’m not sure if I understand entierly the problem.

From my point of view: I would lock the content of the Dockable inside “createBackup”. Then I would add a “CDockableLocationListener” to the CDockable and wait for the event where the Dockable got visible (“CDockableLocationEvent.getNewVisible”). Then I would start the progressbar and start loading the content.
This solution would allow your application to have only one loaded Dockable per stack, and only if the user makes another Dockable visisble the progressbar would appear again. Very much like Eclipse does it.

So: what is missing in this solution? Because from the design of the framework there is not much that the SingleCDockableFactory could do different.

My view has its own individual progress bar ?at the center of the view,and lock the view. (JXLayer Implement)
Under normal circumstances

control.add(dockView);
dockView.setVisible(true);
dockView.init();

Start the progress bar in the init().I can control the initialization process.but,SingleCDockableFactory only createBackup,I lost the opportunity to initialize.but,software support Perspective need SingleCDockableFactory.This interface should support init() function,give users more opportunities to initialize.

public interface SingleCDockableFactory{
     public SingleCDockable createBackup( String id );
     public void initDockable(SingleCDockable dockable);
}

Framework to ensure initDockable after dockable.setvisble(true).
Many times the reality is separate construction and initialization?initialization takes a long time, especially.

A more flexible approach might be to add an interface.So do not change the original interface.

public interface InitDockable {
     public void initDockable(SingleCDockable dockable);

}

class MyFactory implements SingleCDockableFactory,InitDockable{
...........................................
}

Many applications are now net client,not ordinary desktop application?Each view may communicate with the server.Each view may show the progress bar and lock own.Especially in view of start.

But the „createBackup“ method is only called if the Dockable is going to be shown, its created lazily (thats the main reason for the factory). And as I said, with the CDockableLocationListener you can even find out the moment when the dockable is actually shown. I really don’t see why you would need more, until now you did not describe anything that could not be implemented with the methods that already exist. I’m confused by your question :wink:

ok,I try to use the CDockableLocationListener .
Thank you.