本文整理汇总了Java中com.haulmont.cuba.gui.components.Window.Lookup方法的典型用法代码示例。如果您正苦于以下问题:Java Window.Lookup方法的具体用法?Java Window.Lookup怎么用?Java Window.Lookup使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.haulmont.cuba.gui.components.Window
的用法示例。
在下文中一共展示了Window.Lookup方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: openLookup
import com.haulmont.cuba.gui.components.Window; //导入方法依赖的package包/类
@Override
public Window.Lookup openLookup(WindowInfo windowInfo, Window.Lookup.Handler handler, OpenType openType, Map<String, Object> params) {
Window.Lookup window = super.openLookup(windowInfo, handler, openType, params);
if (window != null) {
screenProfiler.initProfilerMarkerForWindow(windowInfo.getId());
}
return window;
}
示例2: handleClickAction
import com.haulmont.cuba.gui.components.Window; //导入方法依赖的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);
}
}
}
}
示例3: createColumns
import com.haulmont.cuba.gui.components.Window; //导入方法依赖的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;
}
示例4: handleDoubleClickAction
import com.haulmont.cuba.gui.components.Window; //导入方法依赖的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);
}
}
}
}
示例5: handleClickAction
import com.haulmont.cuba.gui.components.Window; //导入方法依赖的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() && action.isVisible()) {
Window window = ComponentsHelper.getWindow(DesktopAbstractTable.this);
if (window instanceof Window.Wrapper) {
window = ((Window.Wrapper) window).getWrappedWindow();
}
if (!(window instanceof Window.Lookup)) {
action.actionPerform(DesktopAbstractTable.this);
} else {
Window.Lookup lookup = (Window.Lookup) window;
com.haulmont.cuba.gui.components.Component lookupComponent = lookup.getLookupComponent();
if (lookupComponent != this) {
action.actionPerform(DesktopAbstractTable.this);
} else if (action.getId().equals(WindowDelegate.LOOKUP_ITEM_CLICK_ACTION_ID)) {
action.actionPerform(DesktopAbstractTable.this);
}
}
}
}
示例6: handleClickAction
import com.haulmont.cuba.gui.components.Window; //导入方法依赖的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);
}
}
}
}
示例7: openLookup
import com.haulmont.cuba.gui.components.Window; //导入方法依赖的package包/类
@Override
public Window.Lookup openLookup(Class<? extends Entity> entityClass, Window.Lookup.Handler handler, WindowManager.OpenType openType) {
return delegate.openLookup(entityClass, handler, openType);
}
示例8: openLookup
import com.haulmont.cuba.gui.components.Window; //导入方法依赖的package包/类
@Override
public Window.Lookup openLookup(Class<? extends Entity> entityClass, Window.Lookup.Handler handler, WindowManager.OpenType openType) {
return delegate.openLookup(entityClass, handler, openType);
}
示例9: openLookupWindow
import com.haulmont.cuba.gui.components.Window; //导入方法依赖的package包/类
private void openLookupWindow() {
WindowConfig windowConfig = AppBeans.get(WindowConfig.NAME);
String windowAlias;
if (getLookupScreen() != null) {
windowAlias = getLookupScreen();
} else if (getOptionsDatasource() != null) {
windowAlias = windowConfig.getBrowseScreenId(getOptionsDatasource().getMetaClass());
} else {
windowAlias = windowConfig.getBrowseScreenId(getDatasource().getMetaClass());
}
WindowInfo windowInfo = windowConfig.getWindowInfo(windowAlias);
Map<String, Object> params = new HashMap<>();
params.put("windowOpener", DesktopTokenList.this.getFrame().getId());
if (isMultiSelect()) {
WindowParams.MULTI_SELECT.set(params, true);
// for backward compatibility
params.put("multiSelect", "true");
}
if (lookupScreenParams != null) {
params.putAll(lookupScreenParams);
}
WindowManager wm = DesktopComponentsHelper.getTopLevelFrame(DesktopTokenList.this).getWindowManager();
if (lookupOpenMode == WindowManager.OpenType.DIALOG) {
DialogParams dialogParams = wm.getDialogParams();
dialogParams.setResizable(true);
if (lookupScreenDialogParams != null) {
dialogParams.setWidth(lookupScreenDialogParams.getWidth());
dialogParams.setHeight(lookupScreenDialogParams.getHeight());
} else {
dialogParams.setWidth("800px");
dialogParams.setHeight("600px");
}
}
Window.Lookup lookupWindow = wm.openLookup(windowInfo, new Window.Lookup.Handler() {
@Override
public void handleLookup(Collection items) {
if (lookupPickerField.isRefreshOptionsOnLookupClose()) {
lookupPickerField.getOptionsDatasource().refresh();
}
if (isEditable()) {
if (items == null || items.isEmpty()) return;
handleLookupInternal(items);
if (afterLookupSelectionHandler != null) {
afterLookupSelectionHandler.onSelect(items);
}
}
}
}, lookupOpenMode, params);
if (afterLookupCloseHandler != null) {
lookupWindow.addCloseListener(actionId ->
afterLookupCloseHandler.onClose(lookupWindow, actionId)
);
}
}