本文整理汇总了Java中com.haulmont.cuba.gui.ComponentsHelper.getWindowImplementation方法的典型用法代码示例。如果您正苦于以下问题:Java ComponentsHelper.getWindowImplementation方法的具体用法?Java ComponentsHelper.getWindowImplementation怎么用?Java ComponentsHelper.getWindowImplementation使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.haulmont.cuba.gui.ComponentsHelper
的用法示例。
在下文中一共展示了ComponentsHelper.getWindowImplementation方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setupUpdateTimer
import com.haulmont.cuba.gui.ComponentsHelper; //导入方法依赖的package包/类
protected void setupUpdateTimer() {
int period = webConfig.getAppFoldersRefreshPeriodSec() * 1000;
timer = new FoldersPaneTimer();
timer.setRepeating(true);
timer.setDelay(period);
timer.addActionListener(createAppFolderUpdater());
timer.start();
if (this.isAttached()) {
AppUI ui = AppUI.getCurrent();
stopExistingFoldersPaneTimer(ui);
ui.addTimer(timer);
} else if (frame != null) {
com.haulmont.cuba.gui.components.Window window = ComponentsHelper.getWindowImplementation(frame);
if (window == null) {
throw new IllegalStateException("Null window for CubaFoldersPane");
}
AbstractComponent topLevelFrame = window.unwrapComposition(AbstractComponent.class);
timer.extend(topLevelFrame);
}
}
示例2: build
import com.haulmont.cuba.gui.ComponentsHelper; //导入方法依赖的package包/类
public void build(AppMenu appMenu) {
this.appMenu = appMenu;
Window window = ComponentsHelper.getWindowImplementation(appMenu);
if (window == null) {
throw new IllegalStateException("AppMenu is not belong to Window");
}
List<MenuItem> rootItems = menuConfig.getRootItems();
for (MenuItem menuItem : rootItems) {
if (menuItem.isPermitted(session)) {
createMenuBarItem(window, menuItem);
}
}
removeExtraSeparators();
}
示例3: detachCloseListener
import com.haulmont.cuba.gui.ComponentsHelper; //导入方法依赖的package包/类
private void detachCloseListener() {
// force remove close listener
Frame ownerFrame = getTask().getOwnerFrame();
if (ownerFrame != null) {
Window ownerWindow = ComponentsHelper.getWindowImplementation(ownerFrame);
if (ownerWindow != null) {
ownerWindow.removeCloseListener(closeListener);
String windowClass = ownerFrame.getClass().getCanonicalName();
log.trace("Resources were disposed. Task: {}. Frame: {}", taskExecutor.getTask(), windowClass);
} else {
log.trace("Empty ownerWindow. Resources were not disposed. Task: {}", taskExecutor.getTask());
}
} else {
log.trace("Empty ownerFrame. Resources were not disposed. Task: {}", taskExecutor.getTask());
}
closeListener = null;
}
示例4: isCloseWithShortcutPrevented
import com.haulmont.cuba.gui.ComponentsHelper; //导入方法依赖的package包/类
protected boolean isCloseWithShortcutPrevented(Window currentWindow) {
WebWindow webWindow = (WebWindow) ComponentsHelper.getWindowImplementation(currentWindow);
if (webWindow != null) {
BeforeCloseWithShortcutEvent event = new BeforeCloseWithShortcutEvent(webWindow);
webWindow.fireBeforeCloseWithShortcut(event);
return event.isClosePrevented();
}
return false;
}
示例5: isCloseWithCloseButtonPrevented
import com.haulmont.cuba.gui.ComponentsHelper; //导入方法依赖的package包/类
protected boolean isCloseWithCloseButtonPrevented(Window currentWindow) {
WebWindow webWindow = (WebWindow) ComponentsHelper.getWindowImplementation(currentWindow);
if (webWindow != null) {
BeforeCloseWithCloseButtonEvent event = new BeforeCloseWithCloseButtonEvent(webWindow);
webWindow.fireBeforeCloseWithCloseButton(event);
return event.isClosePrevented();
}
return false;
}
示例6: isCloseWithCloseButtonPrevented
import com.haulmont.cuba.gui.ComponentsHelper; //导入方法依赖的package包/类
protected boolean isCloseWithCloseButtonPrevented(Window currentWindow) {
WebWindow webWindow = (WebWindow) ComponentsHelper.getWindowImplementation(currentWindow);
if (webWindow != null) {
Window.BeforeCloseWithCloseButtonEvent event = new Window.BeforeCloseWithCloseButtonEvent(webWindow);
webWindow.fireBeforeCloseWithCloseButton(event);
return event.isClosePrevented();
}
return false;
}
示例7: build
import com.haulmont.cuba.gui.ComponentsHelper; //导入方法依赖的package包/类
public void build(SideMenu menu) {
Window window = ComponentsHelper.getWindowImplementation(menu);
if (window == null) {
throw new IllegalStateException("SideMenu is not belong to Window");
}
List<MenuItem> rootItems = menuConfig.getRootItems();
for (MenuItem menuItem : rootItems) {
if (menuItem.isPermitted(session)) {
createMenuBarItem(window, menu, menuItem);
}
}
removeExtraSeparators(menu);
}
示例8: handleClickAction
import com.haulmont.cuba.gui.ComponentsHelper; //导入方法依赖的package包/类
protected void handleClickAction() {
Action action = getItemClickAction();
if (action == null) {
action = getEnterAction();
if (action == null) {
action = getAction("edit");
if (action == null) {
action = getAction("view");
}
}
}
if (action != null && action.isEnabled()) {
Window window = ComponentsHelper.getWindowImplementation(WebAbstractTable.this);
if (window instanceof Window.Wrapper) {
window = ((Window.Wrapper) window).getWrappedWindow();
}
if (!(window instanceof Window.Lookup)) {
action.actionPerform(WebAbstractTable.this);
} else {
Window.Lookup lookup = (Window.Lookup) window;
com.haulmont.cuba.gui.components.Component lookupComponent = lookup.getLookupComponent();
if (lookupComponent != this)
action.actionPerform(WebAbstractTable.this);
else if (action.getId().equals(WindowDelegate.LOOKUP_ITEM_CLICK_ACTION_ID)) {
action.actionPerform(WebAbstractTable.this);
}
}
}
}
示例9: createColumns
import com.haulmont.cuba.gui.ComponentsHelper; //导入方法依赖的package包/类
protected Collection<MetaPropertyPath> createColumns(com.vaadin.data.Container ds) {
@SuppressWarnings("unchecked")
final Collection<MetaPropertyPath> properties = (Collection<MetaPropertyPath>) ds.getContainerPropertyIds();
Window window = ComponentsHelper.getWindowImplementation(this);
boolean isLookup = window instanceof Window.Lookup;
for (MetaPropertyPath propertyPath : properties) {
final Table.Column column = columns.get(propertyPath);
if (column != null && !(editable && BooleanUtils.isTrue(column.isEditable()))) {
final String isLink =
column.getXmlDescriptor() == null ?
null : column.getXmlDescriptor().attributeValue("link");
if (propertyPath.getRange().isClass()) {
if (!isLookup && StringUtils.isNotEmpty(isLink)) {
setClickListener(propertyPath.toString(), new LinkCellClickListener());
}
} else if (propertyPath.getRange().isDatatype()) {
if (!isLookup && !StringUtils.isEmpty(isLink)) {
setClickListener(propertyPath.toString(), new LinkCellClickListener());
} else if (editable && BooleanUtils.isTrue(column.isCalculatable())) {
addGeneratedColumn(propertyPath, new CalculatableColumnGenerator());
} else {
if (column.getMaxTextLength() != null) {
addGeneratedColumn(propertyPath, new AbbreviatedColumnGenerator(column));
setClickListener(propertyPath.toString(), new AbbreviatedCellClickListener());
}
}
} else if (!propertyPath.getRange().isEnum()) {
throw new UnsupportedOperationException();
}
}
}
return properties;
}
示例10: handleDoubleClickAction
import com.haulmont.cuba.gui.ComponentsHelper; //导入方法依赖的package包/类
protected void handleDoubleClickAction() {
Action action = getItemClickAction();
if (action == null) {
action = getEnterAction();
if (action == null) {
action = getAction("edit");
if (action == null) {
action = getAction("view");
}
}
}
if (action != null && action.isEnabled()) {
Window window = ComponentsHelper.getWindowImplementation(WebDataGrid.this);
if (window instanceof Window.Wrapper) {
window = ((Window.Wrapper) window).getWrappedWindow();
}
if (!(window instanceof Window.Lookup)) {
action.actionPerform(WebDataGrid.this);
} else {
Window.Lookup lookup = (Window.Lookup) window;
com.haulmont.cuba.gui.components.Component lookupComponent = lookup.getLookupComponent();
if (lookupComponent != this)
action.actionPerform(WebDataGrid.this);
else if (action.getId().equals(WindowDelegate.LOOKUP_ITEM_CLICK_ACTION_ID)) {
action.actionPerform(WebDataGrid.this);
}
}
}
}
示例11: handleClickAction
import com.haulmont.cuba.gui.ComponentsHelper; //导入方法依赖的package包/类
protected void handleClickAction() {
Action action = getItemClickAction();
if (action == null) {
action = getEnterPressAction();
if (action == null) {
action = getAction("edit");
if (action == null) {
action = getAction("view");
}
}
}
if (action != null && action.isEnabled()) {
Window window = ComponentsHelper.getWindowImplementation(WebAbstractTree.this);
if (window instanceof Window.Wrapper) {
window = ((Window.Wrapper) window).getWrappedWindow();
}
if (!(window instanceof Window.Lookup)) {
action.actionPerform(WebAbstractTree.this);
} else {
Window.Lookup lookup = (Window.Lookup) window;
com.haulmont.cuba.gui.components.Component lookupComponent = lookup.getLookupComponent();
if (lookupComponent != this)
action.actionPerform(WebAbstractTree.this);
else if (action.getId().equals(WindowDelegate.LOOKUP_ITEM_CLICK_ACTION_ID)) {
action.actionPerform(WebAbstractTree.this);
}
}
}
}
示例12: handleClickAction
import com.haulmont.cuba.gui.ComponentsHelper; //导入方法依赖的package包/类
protected void handleClickAction() {
Action action = getItemClickAction();
if (action == null) {
action = getEnterPressAction();
if (action == null) {
action = getAction("edit");
if (action == null) {
action = getAction("view");
}
}
}
if (action != null && action.isEnabled()) {
Window window = ComponentsHelper.getWindowImplementation(DesktopTree.this);
if (window instanceof Window.Wrapper) {
window = ((Window.Wrapper) window).getWrappedWindow();
}
if (!(window instanceof Window.Lookup)) {
action.actionPerform(DesktopTree.this);
} else {
Window.Lookup lookup = (Window.Lookup) window;
com.haulmont.cuba.gui.components.Component lookupComponent = lookup.getLookupComponent();
if (lookupComponent != this)
action.actionPerform(DesktopTree.this);
else if (action.getId().equals(WindowDelegate.LOOKUP_ITEM_CLICK_ACTION_ID)) {
action.actionPerform(DesktopTree.this);
}
}
}
}
示例13: loadButtonsPanel
import com.haulmont.cuba.gui.ComponentsHelper; //导入方法依赖的package包/类
protected void loadButtonsPanel(Tree component) {
if (buttonsPanelLoader != null) {
//noinspection unchecked
buttonsPanelLoader.loadComponent();
ButtonsPanel panel = (ButtonsPanel) buttonsPanelLoader.getResultComponent();
Window window = ComponentsHelper.getWindowImplementation(component);
String alwaysVisible = buttonsPanelElement.attributeValue("alwaysVisible");
panel.setVisible(!(window instanceof Window.Lookup) || "true".equals(alwaysVisible));
}
}
示例14: loadButtonsPanel
import com.haulmont.cuba.gui.ComponentsHelper; //导入方法依赖的package包/类
protected void loadButtonsPanel(DataGrid component) {
if (buttonsPanelLoader != null) {
//noinspection unchecked
buttonsPanelLoader.loadComponent();
ButtonsPanel panel = (ButtonsPanel) buttonsPanelLoader.getResultComponent();
Window window = ComponentsHelper.getWindowImplementation(component);
String alwaysVisible = panelElement.attributeValue("alwaysVisible");
panel.setVisible(!(window instanceof Window.Lookup) || "true".equals(alwaysVisible));
}
}
示例15: loadButtonsPanel
import com.haulmont.cuba.gui.ComponentsHelper; //导入方法依赖的package包/类
protected void loadButtonsPanel(T component) {
if (buttonsPanelLoader != null) {
//noinspection unchecked
buttonsPanelLoader.loadComponent();
ButtonsPanel panel = (ButtonsPanel) buttonsPanelLoader.getResultComponent();
Window window = ComponentsHelper.getWindowImplementation(component);
String alwaysVisible = panelElement.attributeValue("alwaysVisible");
panel.setVisible(!(window instanceof Window.Lookup) || "true".equals(alwaysVisible));
}
}