本文整理汇总了Java中com.haulmont.cuba.gui.components.Window.getCaption方法的典型用法代码示例。如果您正苦于以下问题:Java Window.getCaption方法的具体用法?Java Window.getCaption怎么用?Java Window.getCaption使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.haulmont.cuba.gui.components.Window
的用法示例。
在下文中一共展示了Window.getCaption方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createDialogWindow
import com.haulmont.cuba.gui.components.Window; //导入方法依赖的package包/类
protected CubaWindow createDialogWindow(Window window) {
CubaWindow dialogWindow = new CubaWindow(window.getCaption());
if (window.getIcon() != null) {
dialogWindow.setIcon(WebComponentsHelper.getIcon(window.getIcon()));
}
dialogWindow.setErrorHandler(ui);
dialogWindow.addContextActionHandler(new DialogWindowActionHandler(window));
return dialogWindow;
}
示例2: update
import com.haulmont.cuba.gui.components.Window; //导入方法依赖的package包/类
public void update() {
AppUI ui = AppUI.getCurrent();
boolean isTestMode = ui.isTestMode();
linksLayout.removeAllComponents();
btn2win.clear();
for (Iterator<Window> it = windows.iterator(); it.hasNext();) {
Window window = it.next();
Button button = new CubaButton(StringUtils.trimToEmpty(window.getCaption()), new BtnClickListener());
button.setSizeUndefined();
button.setStyleName(BaseTheme.BUTTON_LINK);
button.setTabIndex(-1);
if (isTestMode) {
button.setCubaId("breadCrubms_Button_" + window.getId());
button.setId(ui.getTestIdManager().getTestId("breadCrubms_Button_" + window.getId()));
}
btn2win.put(button, window);
if (it.hasNext()) {
linksLayout.addComponent(button);
Label separatorLab = new Label(" > ");
separatorLab.setStyleName("c-breadcrumbs-separator");
separatorLab.setSizeUndefined();
separatorLab.setContentMode(ContentMode.HTML);
linksLayout.addComponent(separatorLab);
} else {
Label captionLabel = new Label(window.getCaption());
captionLabel.setStyleName("c-breadcrumbs-win-caption");
captionLabel.setSizeUndefined();
linksLayout.addComponent(captionLabel);
this.label = captionLabel;
}
}
}
示例3: saveScreenHistory
import com.haulmont.cuba.gui.components.Window; //导入方法依赖的package包/类
public void saveScreenHistory(Window window, WindowManager.OpenMode openMode) {
Security security = AppBeans.get(Security.NAME);
if (security.isEntityOpPermitted(ScreenHistoryEntity.class, EntityOp.CREATE)
&& window.getFrame() != null
&& (window.getFrame() instanceof Window.Editor)
&& openMode != WindowManager.OpenMode.DIALOG
&& (screenIds == null || screenIds.contains(window.getId())))
{
String caption = window.getCaption();
UUID entityId = null;
Frame frame = window.getFrame();
Entity entity = null;
if (frame instanceof Window.Editor) {
entity = ((Window.Editor) frame).getItem();
if (entity != null) {
if (PersistenceHelper.isNew(entity)) {
return;
}
if (StringUtils.isBlank(caption))
caption = messages.getTools().getEntityCaption(entity.getMetaClass()) + " " + entity.getInstanceName();
entityId = (UUID) entity.getId();
}
}
ScreenHistoryEntity screenHistoryEntity = metadata.create(ScreenHistoryEntity.class);
screenHistoryEntity.setCaption(StringUtils.abbreviate(caption, 255));
screenHistoryEntity.setUrl(makeLink(window));
screenHistoryEntity.setEntityId(entityId);
addAdditionalFields(screenHistoryEntity, entity);
CommitContext cc = new CommitContext(Collections.singleton(screenHistoryEntity));
DataService dataService = AppBeans.get(DataService.NAME);
dataService.commit(cc);
}
}