use of org.jowidgets.cap.ui.api.widgets.ICapApiBluePrintFactory in project jo-client-platform by jo-source.
the class AttributeFilterDialogBluePrintFactory method createDialogBluePrint.
static IInputDialogBluePrint<IUiConfigurableFilter<? extends Object>> createDialogBluePrint(final IBeanTableModel<?> model, final int columnIndex, final IExecutionContext executionContext, final IFilterType filterType) {
final IBluePrintFactory bpf = Toolkit.getBluePrintFactory();
final ICapApiBluePrintFactory capBpf = CapUiToolkit.bluePrintFactory();
final IInputContentCreator<IUiConfigurableFilter<? extends Object>> contentCreator = new IInputContentCreator<IUiConfigurableFilter<? extends Object>>() {
private IAttributeFilterControl filterControl;
@Override
public void setValue(final IUiConfigurableFilter<? extends Object> value) {
filterControl.setValue(value);
}
@Override
public IUiConfigurableFilter<? extends Object> getValue() {
return filterControl.getValue();
}
@Override
public void createContent(final IInputContentContainer container) {
container.setLayout(new MigLayoutDescriptor("[][grow, 0::]", "10[]0"));
final IAttribute<?> attribute = model.getAttribute(columnIndex);
container.add(Toolkit.getBluePrintFactory().textLabel(attribute.getCurrentLabel()).setMarkup(Markup.STRONG));
filterControl = container.add(capBpf.attributeFilterControl(model.getAttributes()), "growx, w 0::");
if (filterType != null) {
filterControl.setAttribute(attribute, filterType);
}
}
};
final IInputDialogBluePrint<IUiConfigurableFilter<? extends Object>> dialogBp = bpf.inputDialog(contentCreator);
dialogBp.setExecutionContext(executionContext);
dialogBp.setMissingInputHint(Messages.getString("AttributeFilterDialogBluePrintFactory.please_edit_the_filter"));
dialogBp.setMinPackSize(new Dimension(600, 170));
dialogBp.setMaxPackSize(new Dimension(1024, 400));
return dialogBp;
}
use of org.jowidgets.cap.ui.api.widgets.ICapApiBluePrintFactory in project jo-client-platform by jo-source.
the class BeanLinkPanelImpl method createModifiedFormBp.
private <BEAN_TYPE> IBeanFormBluePrint<BEAN_TYPE> createModifiedFormBp(final IBeanFormBluePrint<BEAN_TYPE> formBp) {
final ICapApiBluePrintFactory cbpf = CapUiToolkit.bluePrintFactory();
cbpf.beanForm();
final IBeanFormBluePrint<BEAN_TYPE> result = CapUiToolkit.bluePrintFactory().beanForm();
result.setSetup(formBp);
result.setEditModeValidationLabel(null);
result.setCreateModeValidationLabel(null);
result.setSaveAction(null);
result.setUndoAction(null);
return result;
}
use of org.jowidgets.cap.ui.api.widgets.ICapApiBluePrintFactory in project jo-client-platform by jo-source.
the class CsvExportExecutor method createExecutionTaskDialog.
private static IExecutionTaskDialog createExecutionTaskDialog(final IExecutionContext executionContext, final IExecutionTask executionTask) {
final ICapApiBluePrintFactory cbpf = CapUiToolkit.bluePrintFactory();
final IExecutionTaskDialogBluePrint executionTaskDialogBp = cbpf.executionTaskDialog(executionContext, executionTask);
executionTaskDialogBp.setModal(false);
final IWindow activeWindow = Toolkit.getActiveWindow();
return activeWindow.createChildWindow(executionTaskDialogBp);
}
use of org.jowidgets.cap.ui.api.widgets.ICapApiBluePrintFactory in project jo-client-platform by jo-source.
the class BeanLinkCreatorCommand method getBeanLink.
private IBeanLink<LINK_BEAN_TYPE, LINKABLE_BEAN_TYPE> getBeanLink(final IExecutionContext executionContext) {
final ICapApiBluePrintFactory cbpf = CapUiToolkit.bluePrintFactory();
final IBeanLinkPanelBluePrint<LINK_BEAN_TYPE, LINKABLE_BEAN_TYPE> linkPanelBp = cbpf.beanLinkPanel();
linkPanelBp.setLinkBeanForm(linkBeanForm);
linkPanelBp.setLinkableBeanForm(linkableBeanForm);
linkPanelBp.setLinkableTable(linkableTable);
final IBeanLinkDialogBluePrint<LINK_BEAN_TYPE, LINKABLE_BEAN_TYPE> dialogBp = cbpf.beanLinkDialog(linkPanelBp);
dialogBp.setMinPackSize(new Dimension(800, 600));
dialogBp.setMaxPackSize(new Dimension(1600, 1000));
dialogBp.setExecutionContext(executionContext);
dialogBp.setMissingInputHint(null);
dialogBp.setContentScrolled(false);
if (dialogBounds != null) {
dialogBp.setPosition(dialogBounds.getPosition()).setSize(dialogBounds.getSize());
dialogBp.autoPackOff().autoCenterOff();
}
final IBeanLinkDialog<LINK_BEAN_TYPE, LINKABLE_BEAN_TYPE> linkDialog;
linkDialog = Toolkit.getActiveWindow().createChildWindow(dialogBp);
final IBeanProxy<LINK_BEAN_TYPE> defaultLinkBean;
if (linkDefaultFactory != null) {
defaultLinkBean = linkDefaultFactory.create();
} else {
defaultLinkBean = createDefaultBean(linkBeanForm, linkBeanTypeId, linkBeanType, linkBeanPropertyValidators);
}
final List<IBeanProxy<LINKABLE_BEAN_TYPE>> defaultLinkedBeans;
if (linkableBeanForm != null) {
defaultLinkedBeans = Collections.singletonList(createDefaultBean(linkableBeanForm, linkableBeanTypeId, linkableBeanType, linkableBeanPropertyValidators));
} else {
defaultLinkedBeans = Collections.emptyList();
}
linkDialog.setValue(new IBeanLink<LINK_BEAN_TYPE, LINKABLE_BEAN_TYPE>() {
@Override
public IBeanProxy<LINK_BEAN_TYPE> getLinkBean() {
return defaultLinkBean;
}
@Override
public List<IBeanProxy<LINKABLE_BEAN_TYPE>> getLinkableBeans() {
return defaultLinkedBeans;
}
});
linkDialog.setVisible(true);
final IBeanLink<LINK_BEAN_TYPE, LINKABLE_BEAN_TYPE> result;
if (linkDialog.isOkPressed()) {
final IBeanLink<LINK_BEAN_TYPE, LINKABLE_BEAN_TYPE> dialogValue = linkDialog.getValue();
result = new IBeanLink<LINK_BEAN_TYPE, LINKABLE_BEAN_TYPE>() {
@Override
public IBeanProxy<LINK_BEAN_TYPE> getLinkBean() {
final IBeanProxy<LINK_BEAN_TYPE> original = dialogValue.getLinkBean();
return original != null ? original : defaultLinkBean;
}
@Override
public List<IBeanProxy<LINKABLE_BEAN_TYPE>> getLinkableBeans() {
return dialogValue.getLinkableBeans();
}
};
} else {
result = null;
}
dialogBounds = linkDialog.getBounds();
linkDialog.dispose();
return result;
}
use of org.jowidgets.cap.ui.api.widgets.ICapApiBluePrintFactory in project jo-client-platform by jo-source.
the class EntityRelationTreeDetailView method initialize.
void initialize(final IBeanTable<?> rootTable, final IBeanRelationTree<?> relationTree, final Collection<IAction> linkCreatorActions) {
if (!intialized) {
final IContainer container = context.getContainer();
container.setLayout(MigLayoutFactory.growingInnerCellLayout());
final ICapApiBluePrintFactory cbpf = CapUiToolkit.bluePrintFactory();
final IBeanRelationTreeDetailBluePrint<?> treeDetailBp = cbpf.beanRelationTreeDetail(relationTree.getModel());
final IBeanRelationTreeDetail<?> relationTreeDetail = container.add(treeDetailBp, MigLayoutFactory.GROWING_CELL_CONSTRAINTS);
final IBeanTableModel<?> rootTableModel = rootTable.getModel();
final IPluginPropertiesBuilder propBuilder = PluginProperties.builder();
propBuilder.add(IEntityComponentRelationTreeDetailViewPlugin.BEAN_TYPE_PROPERTY_KEY, rootTableModel.getBeanType());
propBuilder.add(IEntityComponentRelationTreeDetailViewPlugin.ENTITIY_ID_PROPERTY_KEY, rootTableModel.getEntityId());
final IPluginProperties pluginProperties = propBuilder.build();
final List<IEntityComponentRelationTreeDetailViewPlugin> plugins = PluginProvider.getPlugins(IEntityComponentRelationTreeDetailViewPlugin.ID, pluginProperties);
for (final IEntityComponentRelationTreeDetailViewPlugin plugin : plugins) {
plugin.onInitialize(pluginProperties, context, rootTable, relationTree, relationTreeDetail, linkCreatorActions);
}
intialized = true;
}
}
Aggregations