hi shai! i create a container who shows the image when you activate it (for example when you are running a query)
i choose that way because when you call showInfiniteProgress() and you dispose it, the current form may have beheaviors unwanted. because that , i dont want to show a dialog, preferring to show a rotating image and blocking the UI.
was i clear? I need to block de UI while the rotating image is running without use the dialog method.
my code is:
/**
*
* @author roman
*/
public class ContainerExp extends Container
{
Container pane = new Container();
Container glass = new Container();
public ContainerExp()
{
pane.setUIID("Container");
glass.setUIID("InfiniteProgress");
glass.setLayout(new BorderLayout());
Container infiniteContainer = new Container();
TableLayout tl = new TableLayout(1, 1);
infiniteContainer.setLayout(tl);
Constraint consTL = tl.createConstraint();
consTL.setWidthPercentage(100);
consTL.setHeightPercentage(100);
consTL.setHorizontalAlign(Component.CENTER);
consTL.setVerticalAlign(Component.CENTER);
infiniteContainer.addComponent(consTL, new InfiniteProgress());
glass.addComponent(BorderLayout.CENTER, infiniteContainer);
//setUIID("InfiniteProgress");
super.setLayout(new LayeredLayout());
super.addComponent(pane);
}
public void showInfiniteProgress()
{
if (super.contains(glass))
{
super.removeComponent(glass);
}
super.addComponent(glass);
Display.getInstance().getCurrent().setLeadComponent(this);
}
public void removeInfiniteProgress()
{
super.removeComponent(glass);
Display.getInstance().getCurrent().setLeadComponent(null);
}
@Override
public void forceRevalidate()
{
super.forceRevalidate(); //To change body of generated methods, choose Tools | Templates.
}
public void setLayout(Layout layout)
{
pane.setLayout(layout); //To change body of generated methods, choose Tools | Templates.
}
public Container add(Component cmp)
{
return pane.add(cmp); //To change body of generated methods, choose Tools | Templates.
}
@Override
public Container add(Object constraint, Component cmp)
{
return pane.add(constraint, cmp); //To change body of generated methods, choose Tools | Templates.
}
public void addComponent(Component cmp)
{
pane.addComponent(cmp); //To change body of generated methods, choose Tools | Templates.
}
@Override
public void addComponent(Object constraints, Component cmp)
{
pane.addComponent(constraints, cmp); //To change body of generated methods, choose Tools | Templates.
}
@Override
public void removeAll()
{
pane.removeAll(); //To change body of generated methods, choose Tools | Templates.