PL-5310 Move com.haulmont.cuba.gui.categories to com.haulmont.cuba.gui.app.core

#PL-5310
This commit is contained in:
Eugeny Degtyarjov 2015-04-27 08:13:21 +00:00
parent 8203934e13
commit 06fb20fb33
18 changed files with 43 additions and 36 deletions

View File

@ -29,10 +29,10 @@ public class CategoryAttribute extends StandardEntity {
@JoinColumn(name = "CATEGORY_ID") @JoinColumn(name = "CATEGORY_ID")
private Category category; private Category category;
@Column(name = "NAME", length = NAME_FIELD_LENGTH) @Column(name = "NAME", length = NAME_FIELD_LENGTH, nullable = false)
private String name; private String name;
@Column(name = "CODE", length = CODE_FIELD_LENGTH) @Column(name = "CODE", length = CODE_FIELD_LENGTH, nullable = false)
private String code; private String code;
@Column(name = "ENUMERATION") @Column(name = "ENUMERATION")
@ -57,7 +57,7 @@ public class CategoryAttribute extends StandardEntity {
private Boolean lookup = false; private Boolean lookup = false;
@Column(name = "TARGET_SCREENS") @Column(name = "TARGET_SCREENS")
private String targetScreens;//comma separated list of screenId#componentId pairs. componentId might not exist private String targetScreens;//comma separated list of screenId#componentId pairs. componentId might be empty
@Column(name = "DEFAULT_STRING") @Column(name = "DEFAULT_STRING")
private String defaultString; private String defaultString;

View File

@ -1,9 +1,9 @@
/* /*
* Copyright (c) 2008-2013 Haulmont. All rights reserved. * Copyright (c) 2008-2015 Haulmont. All rights reserved.
* Use is subject to license terms, see http://www.cuba-platform.com/license for details. * Use is subject to license terms, see http://www.cuba-platform.com/license for details.
*/ */
package com.haulmont.cuba.gui.categories; package com.haulmont.cuba.gui.app.core.categories;
import com.haulmont.chile.core.datatypes.Datatypes; import com.haulmont.chile.core.datatypes.Datatypes;
import com.haulmont.chile.core.model.MetaClass; import com.haulmont.chile.core.model.MetaClass;
@ -117,6 +117,7 @@ public class AttributeEditor extends AbstractEditor<CategoryAttribute> {
codeField = factory.createComponent(TextField.NAME); codeField = factory.createComponent(TextField.NAME);
codeField.setId("code"); codeField.setId("code");
codeField.setRequired(true);
codeField.setCaption(getMessage("code")); codeField.setCaption(getMessage("code"));
codeField.setWidth(fieldWidth); codeField.setWidth(fieldWidth);
codeField.setFrame(frame); codeField.setFrame(frame);

View File

@ -1,17 +1,21 @@
/* /*
* Copyright (c) 2008-2013 Haulmont. All rights reserved. * Copyright (c) 2008-2015 Haulmont. All rights reserved.
* Use is subject to license terms, see http://www.cuba-platform.com/license for details. * Use is subject to license terms, see http://www.cuba-platform.com/license for details.
*/ */
package com.haulmont.cuba.gui.categories; package com.haulmont.cuba.gui.app.core.categories;
import com.haulmont.chile.core.datatypes.Datatypes; import com.haulmont.chile.core.datatypes.Datatypes;
import com.haulmont.chile.core.model.MetaClass; import com.haulmont.chile.core.model.MetaClass;
import com.haulmont.chile.core.model.utils.InstanceUtils; import com.haulmont.chile.core.model.utils.InstanceUtils;
import com.haulmont.cuba.core.app.dynamicattributes.PropertyType;
import com.haulmont.cuba.core.entity.Category; import com.haulmont.cuba.core.entity.Category;
import com.haulmont.cuba.core.entity.CategoryAttribute; import com.haulmont.cuba.core.entity.CategoryAttribute;
import com.haulmont.cuba.core.entity.Entity; import com.haulmont.cuba.core.entity.Entity;
import com.haulmont.cuba.core.global.*; import com.haulmont.cuba.core.global.LoadContext;
import com.haulmont.cuba.core.global.MessageTools;
import com.haulmont.cuba.core.global.Metadata;
import com.haulmont.cuba.core.global.UserSessionSource;
import com.haulmont.cuba.gui.WindowManager; import com.haulmont.cuba.gui.WindowManager;
import com.haulmont.cuba.gui.components.*; import com.haulmont.cuba.gui.components.*;
import com.haulmont.cuba.gui.components.actions.ItemTrackingAction; import com.haulmont.cuba.gui.components.actions.ItemTrackingAction;
@ -19,7 +23,6 @@ import com.haulmont.cuba.gui.components.actions.RefreshAction;
import com.haulmont.cuba.gui.components.actions.RemoveAction; import com.haulmont.cuba.gui.components.actions.RemoveAction;
import com.haulmont.cuba.gui.data.DataSupplier; import com.haulmont.cuba.gui.data.DataSupplier;
import com.haulmont.cuba.gui.data.Datasource; import com.haulmont.cuba.gui.data.Datasource;
import com.haulmont.cuba.core.app.dynamicattributes.PropertyType;
import com.haulmont.cuba.gui.data.impl.CollectionPropertyDatasourceImpl; import com.haulmont.cuba.gui.data.impl.CollectionPropertyDatasourceImpl;
import com.haulmont.cuba.gui.data.impl.DsListenerAdapter; import com.haulmont.cuba.gui.data.impl.DsListenerAdapter;
import com.haulmont.cuba.gui.xml.layout.ComponentsFactory; import com.haulmont.cuba.gui.xml.layout.ComponentsFactory;
@ -247,7 +250,7 @@ public class CategoryAttrsFrame extends AbstractFrame {
} }
@Override @Override
public void actionPerform(com.haulmont.cuba.gui.components.Component component) { public void actionPerform(Component component) {
Set<CategoryAttribute> selected = categoryAttrsTable.getSelected(); Set<CategoryAttribute> selected = categoryAttrsTable.getSelected();
if (!selected.isEmpty()) { if (!selected.isEmpty()) {
AttributeEditor editor = openEditor( AttributeEditor editor = openEditor(
@ -280,7 +283,7 @@ public class CategoryAttrsFrame extends AbstractFrame {
} }
@Override @Override
public void actionPerform(com.haulmont.cuba.gui.components.Component component) { public void actionPerform(Component component) {
final CategoryAttribute attribute = metadata.create(CategoryAttribute.class); final CategoryAttribute attribute = metadata.create(CategoryAttribute.class);
attribute.setCategory((Category) categoryDs.getItem()); attribute.setCategory((Category) categoryDs.getItem());
assignNextOrderNo(attribute); assignNextOrderNo(attribute);

View File

@ -1,9 +1,9 @@
/* /*
* Copyright (c) 2008-2013 Haulmont. All rights reserved. * Copyright (c) 2008-2015 Haulmont. All rights reserved.
* Use is subject to license terms, see http://www.cuba-platform.com/license for details. * Use is subject to license terms, see http://www.cuba-platform.com/license for details.
*/ */
package com.haulmont.cuba.gui.categories; package com.haulmont.cuba.gui.app.core.categories;
import com.haulmont.chile.core.model.MetaClass; import com.haulmont.chile.core.model.MetaClass;
import com.haulmont.cuba.core.entity.Category; import com.haulmont.cuba.core.entity.Category;

View File

@ -1,9 +1,9 @@
/* /*
* Copyright (c) 2008-2013 Haulmont. All rights reserved. * Copyright (c) 2008-2015 Haulmont. All rights reserved.
* Use is subject to license terms, see http://www.cuba-platform.com/license for details. * Use is subject to license terms, see http://www.cuba-platform.com/license for details.
*/ */
package com.haulmont.cuba.gui.categories; package com.haulmont.cuba.gui.app.core.categories;
import com.haulmont.chile.core.model.MetaClass; import com.haulmont.chile.core.model.MetaClass;
import com.haulmont.cuba.core.entity.Category; import com.haulmont.cuba.core.entity.Category;

View File

@ -3,7 +3,7 @@
* Use is subject to license terms, see http://www.cuba-platform.com/license for details. * Use is subject to license terms, see http://www.cuba-platform.com/license for details.
*/ */
package com.haulmont.cuba.gui.categories; package com.haulmont.cuba.gui.app.core.categories;
import com.haulmont.chile.core.annotations.MetaClass; import com.haulmont.chile.core.annotations.MetaClass;
import com.haulmont.chile.core.annotations.MetaProperty; import com.haulmont.chile.core.annotations.MetaProperty;

View File

@ -1,11 +1,11 @@
<!-- <!--
~ Copyright (c) 2008-2013 Haulmont. All rights reserved. ~ Copyright (c) 2008-2015 Haulmont. All rights reserved.
~ Use is subject to license terms, see http://www.cuba-platform.com/license for details. ~ Use is subject to license terms, see http://www.cuba-platform.com/license for details.
--> -->
<window xmlns="http://schemas.haulmont.com/cuba/5.4/window.xsd" <window xmlns="http://schemas.haulmont.com/cuba/5.4/window.xsd"
class="com.haulmont.cuba.gui.categories.AttributeEditor" class="com.haulmont.cuba.gui.app.core.categories.AttributeEditor"
messagesPack="com.haulmont.cuba.gui.categories" messagesPack="com.haulmont.cuba.gui.app.core.categories"
datasource="attributeDs" datasource="attributeDs"
caption="msg://AttributeEditor.caption"> caption="msg://AttributeEditor.caption">
<dsContext> <dsContext>
@ -15,7 +15,7 @@
view="category.edit" view="category.edit"
> >
</datasource> </datasource>
<collectionDatasource id="screensDs" class="com.haulmont.cuba.gui.categories.ScreenAndComponent" <collectionDatasource id="screensDs" class="com.haulmont.cuba.gui.app.core.categories.ScreenAndComponent"
allowCommit="false" refreshMode="NEVER"/> allowCommit="false" refreshMode="NEVER"/>
</dsContext> </dsContext>
<layout spacing="true" expand="buttons"> <layout spacing="true" expand="buttons">

View File

@ -1,11 +1,11 @@
<!-- <!--
~ Copyright (c) 2008-2013 Haulmont. All rights reserved. ~ Copyright (c) 2008-2015 Haulmont. All rights reserved.
~ Use is subject to license terms, see http://www.cuba-platform.com/license for details. ~ Use is subject to license terms, see http://www.cuba-platform.com/license for details.
--> -->
<window xmlns="http://schemas.haulmont.com/cuba/5.4/window.xsd" <window xmlns="http://schemas.haulmont.com/cuba/5.4/window.xsd"
class="com.haulmont.cuba.gui.categories.CategoryAttrsFrame" class="com.haulmont.cuba.gui.app.core.categories.CategoryAttrsFrame"
messagesPack="com.haulmont.cuba.gui.categories"> messagesPack="com.haulmont.cuba.gui.app.core.categories">
<layout height="100%" spacing="true"> <layout height="100%" spacing="true">
<table id="categoryAttrsTable" presentations="true" width="100%" height="100%"> <table id="categoryAttrsTable" presentations="true" width="100%" height="100%">

View File

@ -1,11 +1,11 @@
<!-- <!--
~ Copyright (c) 2008-2013 Haulmont. All rights reserved. ~ Copyright (c) 2008-2015 Haulmont. All rights reserved.
~ Use is subject to license terms, see http://www.cuba-platform.com/license for details. ~ Use is subject to license terms, see http://www.cuba-platform.com/license for details.
--> -->
<window xmlns="http://schemas.haulmont.com/cuba/5.4/window.xsd" <window xmlns="http://schemas.haulmont.com/cuba/5.4/window.xsd"
class="com.haulmont.cuba.gui.categories.CategoryBrowser" class="com.haulmont.cuba.gui.app.core.categories.CategoryBrowser"
messagesPack="com.haulmont.cuba.gui.categories" messagesPack="com.haulmont.cuba.gui.app.core.categories"
lookupComponent="categoryTable" lookupComponent="categoryTable"
caption="msg://categories" caption="msg://categories"
focusComponent="categoriesFilter"> focusComponent="categoriesFilter">

View File

@ -1,10 +1,10 @@
<!-- <!--
~ Copyright (c) 2008-2013 Haulmont. All rights reserved. ~ Copyright (c) 2008-2015 Haulmont. All rights reserved.
~ Use is subject to license terms, see http://www.cuba-platform.com/license for details. ~ Use is subject to license terms, see http://www.cuba-platform.com/license for details.
--> -->
<window xmlns="http://schemas.haulmont.com/cuba/5.4/window.xsd" <window xmlns="http://schemas.haulmont.com/cuba/5.4/window.xsd"
class="com.haulmont.cuba.gui.categories.CategoryEditor" class="com.haulmont.cuba.gui.app.core.categories.CategoryEditor"
messagesPack="com.haulmont.cuba.gui.categories" messagesPack="com.haulmont.cuba.gui.app.core.categories"
caption="msg://editorCaption" caption="msg://editorCaption"
datasource="categoryDs" datasource="categoryDs"
focusComponent="name"> focusComponent="name">
@ -30,7 +30,7 @@
</hbox> </hbox>
<label value="msg://attributes" stylename="h2"/> <label value="msg://attributes" stylename="h2"/>
<iframe id="categoryAttrsFrame" src="/com/haulmont/cuba/gui/categories/category-attrs-frame.xml"/> <iframe id="categoryAttrsFrame" src="/com/haulmont/cuba/gui/app/core/categories/category-attrs-frame.xml"/>
<iframe id="windowActions" src="/com/haulmont/cuba/gui/edit-window.actions.xml"/> <iframe id="windowActions" src="/com/haulmont/cuba/gui/edit-window.actions.xml"/>
</layout> </layout>

View File

@ -92,13 +92,13 @@
template="/com/haulmont/cuba/gui/app/core/file/file-edit.xml"/> template="/com/haulmont/cuba/gui/app/core/file/file-edit.xml"/>
<screen id="sys$Category.browse" <screen id="sys$Category.browse"
template="/com/haulmont/cuba/gui/categories/category-browse.xml"/> template="/com/haulmont/cuba/gui/app/core/categories/category-browse.xml"/>
<screen id="sys$Category.edit" <screen id="sys$Category.edit"
template="/com/haulmont/cuba/gui/categories/category-edit.xml"/> template="/com/haulmont/cuba/gui/app/core/categories/category-edit.xml"/>
<screen id="sys$CategoryAttribute.edit" <screen id="sys$CategoryAttribute.edit"
template="/com/haulmont/cuba/gui/categories/attribute-edit.xml"/> template="/com/haulmont/cuba/gui/app/core/categories/attribute-edit.xml"/>
<screen id="sys$EntitySnapshot.view" <screen id="sys$EntitySnapshot.view"
template="/com/haulmont/cuba/gui/app/core/entitydiff/diff-view.xml"/> template="/com/haulmont/cuba/gui/app/core/entitydiff/diff-view.xml"/>
@ -119,7 +119,7 @@
template="/com/haulmont/cuba/gui/app/core/entityinspector/entity-inspector-edit.xml"/> template="/com/haulmont/cuba/gui/app/core/entityinspector/entity-inspector-edit.xml"/>
<screen id="runtimePropertiesFrame" <screen id="runtimePropertiesFrame"
template="/com/haulmont/cuba/gui/runtimeprops/runtime-properties-frame.xml"/> template="/com/haulmont/cuba/gui/app/core/dynamicattributes/runtime-properties-frame.xml"/>
<screen id="aboutWindow" <screen id="aboutWindow"
template="/com/haulmont/cuba/gui/app/core/about/about-window.xml"/> template="/com/haulmont/cuba/gui/app/core/about/about-window.xml"/>

View File

@ -93,6 +93,9 @@ public class RuntimePropsDatasourceImpl
} }
if (!initializedBefore && category == null) { if (!initializedBefore && category == null) {
category = getDefaultCategory(entity); category = getDefaultCategory(entity);
if (mainDs.getMetaClass().getProperty("category") != null) {
entity.setValue("category", category);
}
} }
item = new DynamicAttributesEntity(metaClass); item = new DynamicAttributesEntity(metaClass);

View File

@ -28,7 +28,7 @@ import java.io.InputStream;
*/ */
public class RuntimePropertiesFrameLoader extends IFrameLoader { public class RuntimePropertiesFrameLoader extends IFrameLoader {
private static final String DEFAULT_DESCRIPTOR = "/com/haulmont/cuba/gui/runtimeprops/runtime-properties-frame.xml"; private static final String DEFAULT_DESCRIPTOR = "/com/haulmont/cuba/gui/app/core/dynamicattributes/runtime-properties-frame.xml";
public RuntimePropertiesFrameLoader(Context context, LayoutLoaderConfig config, ComponentsFactory factory) { public RuntimePropertiesFrameLoader(Context context, LayoutLoaderConfig config, ComponentsFactory factory) {
super(context, config, factory); super(context, config, factory);

View File

@ -26,7 +26,7 @@
<class>com.haulmont.cuba.gui.components.filter.descriptor.CustomConditionCreator</class> <class>com.haulmont.cuba.gui.components.filter.descriptor.CustomConditionCreator</class>
<class>com.haulmont.cuba.gui.components.filter.descriptor.DynamicAttributesConditionCreator</class> <class>com.haulmont.cuba.gui.components.filter.descriptor.DynamicAttributesConditionCreator</class>
<class>com.haulmont.cuba.gui.components.filter.descriptor.HeaderConditionDescriptor</class> <class>com.haulmont.cuba.gui.components.filter.descriptor.HeaderConditionDescriptor</class>
<class>com.haulmont.cuba.gui.categories.ScreenAndComponent</class> <class>com.haulmont.cuba.gui.app.core.categories.ScreenAndComponent</class>
</metadata-model> </metadata-model>
</metadata> </metadata>