本文整理汇总了Java中com.haulmont.cuba.gui.components.Component.Disposable方法的典型用法代码示例。如果您正苦于以下问题:Java Component.Disposable方法的具体用法?Java Component.Disposable怎么用?Java Component.Disposable使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.haulmont.cuba.gui.components.Component
的用法示例。
在下文中一共展示了Component.Disposable方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: showFrame
import com.haulmont.cuba.gui.components.Component; //导入方法依赖的package包/类
@Override
protected void showFrame(Component parent, Frame frame) {
// the same as web window manager does
if (parent instanceof Component.Container) {
Component.Container container = (Component.Container) parent;
for (Component c : container.getComponents()) {
if (c instanceof Component.Disposable) {
Component.Disposable disposable =
(Component.Disposable) c;
if (!disposable.isDisposed()) {
disposable.dispose();
}
}
container.remove(c);
}
container.add(frame);
} else {
throw new IllegalStateException(
"Parent component must be com.haulmont.cuba.gui.components.Component.Container"
);
}
}
示例2: dispose
import com.haulmont.cuba.gui.components.Component; //导入方法依赖的package包/类
/**
* Release resources right before throwing away this WindowManager instance.
*/
public void dispose() {
for (WindowOpenInfo openInfo : windowOpenMode.values()) {
if (openInfo.getOpenMode() == OpenMode.DIALOG) {
JDialog dialog = (JDialog) openInfo.getData();
dialog.setVisible(false);
}
}
if (isMainWindowManager) {
// Stop background tasks
WatchDog watchDog = AppBeans.get(WatchDog.NAME);
watchDog.stopTasks();
}
// Dispose windows
for (Window window : windowOpenMode.keySet()) {
Frame frame = window.getFrame();
if (frame instanceof Component.Disposable)
((Component.Disposable) frame).dispose();
}
tabs.clear();
windowOpenMode.clear();
stacks.clear();
}