Refs #1752 Camel case for all GUI components

This commit is contained in:
Konstantin Krivopustov 2012-12-19 06:54:21 +00:00
parent a09a830ba5
commit ca6c3f357f
31 changed files with 224 additions and 318 deletions

View File

@ -17,9 +17,8 @@ import java.util.HashMap;
import java.util.Map;
/**
* <p>$Id$</p>
*
* @author krivopustov
* @version $Id$
*/
@ManagedBean(ComponentsFactory.NAME)
public class DesktopComponentsFactory implements ComponentsFactory {
@ -61,7 +60,7 @@ public class DesktopComponentsFactory implements ComponentsFactory {
classes.put(OptionsGroup.NAME, DesktopOptionsGroup.class);
classes.put(FileUploadField.NAME, DesktopFileUploadField.class);
classes.put(FileMultiUploadField.NAME, DesktopFileMultiUploadField.class);
classes.put(Tabsheet.NAME, DesktopTabsheet.class);
classes.put(TabSheet.NAME, DesktopTabSheet.class);
classes.put(Embedded.NAME, DesktopEmbedded.class);
classes.put(WidgetsTree.NAME, DesktopWidgetsTree.class);
classes.put(GroupBoxLayout.NAME, DesktopGroupBox.class);

View File

@ -25,13 +25,12 @@ import java.awt.event.*;
import java.util.*;
/**
* <p>$Id$</p>
*
* @author krivopustov
* @version $Id$
*/
public class DesktopTabsheet
public class DesktopTabSheet
extends DesktopAbstractComponent<JTabbedPane>
implements Tabsheet, Component.Container, AutoExpanding {
implements TabSheet, Component.Container, AutoExpanding {
protected Map<Component, String> components = new HashMap<Component, String>();
protected List<TabImpl> tabs = new ArrayList<TabImpl>();
@ -48,7 +47,7 @@ public class DesktopTabsheet
protected Set<TabChangeListener> listeners = new HashSet<TabChangeListener>();
public DesktopTabsheet() {
public DesktopTabSheet() {
impl = new JTabbedPane();
}
@ -283,7 +282,7 @@ public class DesktopTabsheet
lti.tabContent.add(comp);
lti.tabContent.expand(comp, "", "");
final Window window = ComponentsHelper.getWindow(DesktopTabsheet.this);
final Window window = ComponentsHelper.getWindow(DesktopTabSheet.this);
if (window != null) {
ComponentsHelper.walkComponents(
lti.tabContent,
@ -355,7 +354,7 @@ public class DesktopTabsheet
return false;
}
protected class TabImpl implements Tabsheet.Tab {
protected class TabImpl implements TabSheet.Tab {
private String name;
private Component component;
@ -395,7 +394,7 @@ public class DesktopTabsheet
@Override
public void setCaption(String caption) {
this.caption = caption;
DesktopTabsheet.this.impl.setTitleAt(getTabIndex(), caption);
DesktopTabSheet.this.impl.setTitleAt(getTabIndex(), caption);
getButtonTabComponent().setCaption(caption);
}
@ -430,7 +429,7 @@ public class DesktopTabsheet
public void setVisible(boolean visible) {
if (visible != this.visible) {
this.visible = visible;
DesktopTabsheet.this.updateTabVisibility(this);
DesktopTabSheet.this.updateTabVisibility(this);
}
}
@ -475,7 +474,7 @@ public class DesktopTabsheet
}
public int getTabIndex() {
return DesktopTabsheet.this.impl.indexOfTabComponent(buttonTabComponent);
return DesktopTabSheet.this.impl.indexOfTabComponent(buttonTabComponent);
}
@Override

View File

@ -20,7 +20,6 @@ import org.apache.commons.logging.LogFactory;
import org.dom4j.Element;
import java.io.InputStream;
import java.util.List;
import java.util.Map;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
@ -96,9 +95,9 @@ public class WindowCreationHelper {
final String subComponentId = matcher.group(2);
final Component customComponent = window.getComponent(customComponentId);
if (customComponent != null) {
if (customComponent instanceof Tabsheet) {
final Tabsheet tabsheet = (Tabsheet) customComponent;
final Tabsheet.Tab tab = tabsheet.getTab(subComponentId);
if (customComponent instanceof TabSheet) {
final TabSheet tabsheet = (TabSheet) customComponent;
final TabSheet.Tab tab = tabsheet.getTab(subComponentId);
if (tab != null) {
Integer permissionValue = permissionEntry.getValue();
if (permissionValue == UiPermissionValue.HIDE.getValue())

View File

@ -17,7 +17,7 @@
<layout expand="windowActions">
<vbox id="vBox" margin="true" spacing="true" stylename="edit-area">
<hbox height="30" spacing="true">
<multiupload id="multiUpload" width="90px"/>
<multiUpload id="multiUpload" width="90px"/>
<button action="uploadsTable.remove" icon="icons/remove.png"/>
</hbox>

View File

@ -60,7 +60,7 @@ public class GroupBrowser extends AbstractWindow {
protected Table usersTable;
@Inject
protected Tabsheet tabsheet;
protected TabSheet tabsheet;
@Inject
protected UserSession userSession;
@ -133,9 +133,9 @@ public class GroupBrowser extends AbstractWindow {
});
tabsheet.addListener(
new Tabsheet.TabChangeListener() {
new TabSheet.TabChangeListener() {
@Override
public void tabChanged(Tabsheet.Tab newTab) {
public void tabChanged(TabSheet.Tab newTab) {
if ("constraintsTab".equals(newTab.getName()))
initConstraintsTab();
else if ("attributesTab".equals(newTab.getName()))

View File

@ -66,7 +66,7 @@
</tree>
</vbox>
<vbox margin="false;false;false;true" height="100%" width="100%">
<tabsheet id="tabsheet" height="100%" width="100%">
<tabSheet id="tabsheet" height="100%" width="100%">
<tab id="usersTab" caption="msg://tabsheet.users">
<vbox expand="usersTable" spacing="true" margin="true" height="100%" width="100%">
<buttonsPanel>
@ -135,7 +135,7 @@
</table>
</vbox>
</tab>
</tabsheet>
</tabSheet>
</vbox>
</split>
</layout>

View File

@ -62,7 +62,7 @@
</hbox>
</hbox>
<tabsheet id="permissionsTabsheet">
<tabSheet id="permissionsTabsheet">
<tab id="screenPermissionsTab" caption="msg://screen-permissions">
<iframe src="/com/haulmont/cuba/gui/app/security/role/edit/tabs/screens-permission-tab.xml"
id="screensTabFrame" width="100%" height="100%"/>
@ -83,7 +83,7 @@
<iframe src="/com/haulmont/cuba/gui/app/security/role/edit/tabs/ui-permission-tab.xml"
id="uiTabFrame" width="100%" height="100%"/>
</tab>
</tabsheet>
</tabSheet>
<iframe id="windowActions" screen="editWindowActions"/>
</layout>
</window>

View File

@ -1,16 +0,0 @@
package com.haulmont.cuba.gui.components;
/**
* Component for evaluate custom script code at client side
* <p>$Id$</p>
*
* @author artamonov
*/
public interface ClientScriptHost extends Component, Component.BelongToFrame{
void evaluateScript(String script);
void viewDocument(String documentUrl);
void getResource(String resourceUrl);
}

View File

@ -1,21 +1,20 @@
/*
* Copyright (c) 2010 Haulmont Technology Ltd. All Rights Reserved.
* Copyright (c) 2012 Haulmont Technology Ltd. All Rights Reserved.
* Haulmont Technology proprietary and confidential.
* Use is subject to license terms.
* Author: Yuryi Artamonov
* Created: 17.11.2010 18:04:54
*
* $Id$
*/
package com.haulmont.cuba.gui.components;
import java.util.Map;
import java.util.UUID;
/**
* @author artamonov
* @version $Id$
*/
public interface FileMultiUploadField extends Component, Component.HasCaption, Component.BelongToFrame {
String NAME = "multiupload";
String NAME = "multiUpload";
int QUEUE_LIMIT_EXCEEDED = -100;
int FILE_EXCEEDS_SIZE_LIMIT = -110;

View File

@ -0,0 +1,16 @@
/*
* Copyright (c) 2012 Haulmont Technology Ltd. All Rights Reserved.
* Haulmont Technology proprietary and confidential.
* Use is subject to license terms.
*/
package com.haulmont.cuba.gui.components;
/**
* @author krivopustov
* @version $Id$
*/
public interface FlowBoxLayout extends BoxLayout {
String NAME = "flowBox";
}

View File

@ -1,18 +1,17 @@
/*
* Copyright (c) 2008 Haulmont Technology Ltd. All Rights Reserved.
* Copyright (c) 2012 Haulmont Technology Ltd. All Rights Reserved.
* Haulmont Technology proprietary and confidential.
* Use is subject to license terms.
* Author: Nikolay Gorodnov
* Created: 17.08.2009 17:09:25
*
* $Id$
*/
package com.haulmont.cuba.gui.components;
/**
* @author gorodnov
* @version $Id$
*/
public interface HtmlBoxLayout extends ExpandingLayout, Component.BelongToFrame {
String NAME = "htmlbox";
String NAME = "htmlBox";
String getTemplateName();
void setTemplateName(String templateName);

View File

@ -30,10 +30,9 @@ import java.util.*;
/**
* Universal frame for editing Runtime properties
* of any {@link com.haulmont.cuba.core.entity.CategorizedEntity} subclass.
* <p/>
* <p>$Id$</p>
*
* @author devyatkin
* @version $Id$
*/
public class RuntimePropertiesFrame extends AbstractWindow {
@ -41,7 +40,8 @@ public class RuntimePropertiesFrame extends AbstractWindow {
private RuntimePropsDatasource rds;
private CollectionDatasource categoriesDs;
public static final String NAME = "runtimePropertiesFrame";
public static final String NAME = "runtimeProperties";
private static final String DEFAULT_FIELD_WIDTH = "100%";
private String rows;
private String cols;

View File

@ -1,11 +1,7 @@
/*
* Copyright (c) 2008 Haulmont Technology Ltd. All Rights Reserved.
* Copyright (c) 2012 Haulmont Technology Ltd. All Rights Reserved.
* Haulmont Technology proprietary and confidential.
* Use is subject to license terms.
* Author: Dmitry Abramov
* Created: 16.01.2009 17:33:46
* $Id$
*/
package com.haulmont.cuba.gui.components;
@ -14,11 +10,13 @@ import org.dom4j.Element;
import java.util.Collection;
public interface Tabsheet
extends
Component, Component.BelongToFrame
{
String NAME = "tabsheet";
/**
* @author abramov
* @version $Id$
*/
public interface TabSheet extends Component, Component.BelongToFrame {
String NAME = "tabSheet";
Tab addTab(String name, Component component);
Tab addLazyTab(String name, Element descriptor, ComponentLoader loader);

View File

@ -1,19 +1,18 @@
/*
* Copyright (c) 2008 Haulmont Technology Ltd. All Rights Reserved.
* Copyright (c) 2012 Haulmont Technology Ltd. All Rights Reserved.
* Haulmont Technology proprietary and confidential.
* Use is subject to license terms.
* Author: Nikolay Gorodnov
* Created: 12.08.2009 12:39:22
*
* $Id$
*/
package com.haulmont.cuba.gui.components;
/**
* @author gorodnov
* @version $Id$
*/
public interface ToggleBoxLayout extends Component.Container,
Component.HasSettings, Component.HasCaption, Component.BelongToFrame
{
String NAME = "togglebox";
Component.HasSettings, Component.HasCaption, Component.BelongToFrame {
String NAME = "toggleBox";
void toggle();
void setOn(boolean on);

View File

@ -1246,15 +1246,15 @@
<xs:choice minOccurs="1" maxOccurs="unbounded">
<xs:element name="vbox" type="boxLayout"/>
<xs:element name="hbox" type="boxLayout"/>
<xs:element name="flowbox" type="boxLayout"/>
<xs:element name="flowBox" type="boxLayout"/>
<xs:element name="htmlbox" type="htmlBoxLayout"/>
<xs:element name="htmlBox" type="htmlBoxLayout"/>
<xs:element name="scrollBox" type="scrollBoxLayout"/>
<xs:element name="grid" type="gridLayout"/>
<xs:element name="groupBox" type="groupBoxLayout"/>
<xs:element name="split" type="splitContainer"/>
<xs:element name="tabsheet" type="tabsheetContainer"/>
<xs:element name="tabSheet" type="tabsheetContainer"/>
<xs:element name="iframe" type="iframeContainer"/>
<xs:element name="runtimeProperties" type="runtimePropertiesContainer"/>
@ -1292,7 +1292,7 @@
<xs:element name="progressBar" type="progressBarComponent"/>
<xs:element name="upload" type="uploadComponent"/>
<xs:element name="multiupload" type="multiuploadComponent"/>
<xs:element name="multiUpload" type="multiuploadComponent"/>
<xs:element name="tree" type="treeComponent"/>
<xs:element name="table" type="tableComponent"/>

View File

@ -6,8 +6,7 @@
package com.haulmont.cuba.gui.xml.layout;
import com.haulmont.cuba.gui.ComponentPalette;
import com.haulmont.cuba.gui.components.ProgressBar;
import com.haulmont.cuba.gui.components.SearchField;
import com.haulmont.cuba.gui.components.*;
import com.haulmont.cuba.gui.xml.layout.loaders.*;
import java.util.HashMap;
@ -45,55 +44,57 @@ public class LayoutLoaderConfig {
}
private static void registerComponents(LayoutLoaderConfig config) {
config.register("hbox", HBoxLoader.class);
config.register("vbox", VBoxLoader.class);
config.register("grid", GridLayoutLoader.class);
config.register("scrollBox", ScrollBoxLayoutLoader.class);
config.register(BoxLayout.HBOX, HBoxLoader.class);
config.register(BoxLayout.VBOX, VBoxLoader.class);
config.register(GridLayout.NAME, GridLayoutLoader.class);
config.register(ScrollBoxLayout.NAME, ScrollBoxLayoutLoader.class);
config.register("scrollbox", ScrollBoxLayoutLoader.class); // for backward compatibility
config.register("togglebox", ToggleBoxLoader.class);
config.register("htmlbox", HtmlBoxLoader.class);
config.register("flowbox", FlowBoxLoader.class);
config.register(GroupBoxLayout.NAME, GroupBoxLayoutLoader.class);
config.register(ToggleBoxLayout.NAME, ToggleBoxLayoutLoader.class);
config.register("togglebox", ToggleBoxLayoutLoader.class); // for backward compatibility
config.register(HtmlBoxLayout.NAME, HtmlBoxLayoutLoader.class);
config.register("htmlbox", HtmlBoxLayoutLoader.class); // for backward compatibility
config.register(FlowBoxLayout.NAME, FlowBoxLayoutLoader.class);
config.register("flowbox", FlowBoxLayoutLoader.class); // for backward compatibility
config.register("button", ButtonLoader.class);
config.register("linkButton", ButtonLoader.class); // the same loader as for button
config.register("groupBox", GroupBoxLayoutLoader.class);
config.register("checkBox", AbstractFieldLoader.class);
config.register("label", LabelLoader.class);
config.register("textField", ResizableTextFieldLoader.class);
config.register("autoCompleteTextField", AutoCompleteTextFieldLoader.class);
config.register("textArea", TextAreaLoader.class);
config.register("dateField", DateFieldLoader.class);
config.register("timeField", TimeFieldLoader.class);
config.register("lookupField", LookupFieldLoader.class);
config.register("pickerField", PickerFieldLoader.class);
config.register("lookupPickerField", LookupPickerFieldLoader.class);
config.register("searchPickerField", SearchPickerFieldLoader.class);
config.register("optionsGroup", OptionsGroupLoader.class);
config.register("upload", FileUploadFieldLoader.class);
config.register("multiupload", FileUploadFieldLoader.class);
config.register("table", TableLoader.class);
config.register("treeTable", TreeTableLoader.class);
config.register("groupTable", GroupTableLoader.class);
config.register("iframe", IFrameLoader.class);
config.register("runtimeProperties", RuntimePropertiesFrameLoader.class);
config.register("split", SplitPanelLoader.class);
config.register("tree", TreeLoader.class);
config.register("tabsheet", TabsheetLoader.class);
config.register("embedded", EmbeddedLoader.class);
config.register("filter", FilterLoader.class);
config.register("accessControl", AccessControlLoader.class);
config.register("buttonsPanel", ButtonsPanelLoader.class);
config.register("actionsField", ActionsFieldLoader.class);
config.register("popupButton", PopupButtonLoader.class);
config.register("fieldGroup", FieldGroupLoader.class);
config.register("runtimeFieldGroup", FieldGroupRuntimeLoader.class);
config.register("tokenList", TokenListLoader.class);
config.register("widgetsTree", WidgetsTreeLoader.class);
config.register("twinColumn", TwinColumnLoader.class);
config.register(Button.NAME, ButtonLoader.class);
config.register(LinkButton.NAME, ButtonLoader.class);
config.register(CheckBox.NAME, AbstractFieldLoader.class);
config.register(Label.NAME, LabelLoader.class);
config.register(TextField.NAME, ResizableTextFieldLoader.class);
config.register(AutoCompleteTextField.NAME, AutoCompleteTextFieldLoader.class);
config.register(TextArea.NAME, TextAreaLoader.class);
config.register(DateField.NAME, DateFieldLoader.class);
config.register(TimeField.NAME, TimeFieldLoader.class);
config.register(LookupField.NAME, LookupFieldLoader.class);
config.register(PickerField.NAME, PickerFieldLoader.class);
config.register(LookupPickerField.NAME, LookupPickerFieldLoader.class);
config.register(SearchPickerField.NAME, SearchPickerFieldLoader.class);
config.register(OptionsGroup.NAME, OptionsGroupLoader.class);
config.register(FileUploadField.NAME, FileUploadFieldLoader.class);
config.register(FileMultiUploadField.NAME, FileUploadFieldLoader.class);
config.register("multiupload", FileUploadFieldLoader.class); // for backward compatibility
config.register(Table.NAME, TableLoader.class);
config.register(TreeTable.NAME, TreeTableLoader.class);
config.register(GroupTable.NAME, GroupTableLoader.class);
config.register(IFrame.NAME, IFrameLoader.class);
config.register(RuntimePropertiesFrame.NAME, RuntimePropertiesFrameLoader.class);
config.register(SplitPanel.NAME, SplitPanelLoader.class);
config.register(Tree.NAME, TreeLoader.class);
config.register(TabSheet.NAME, TabSheetLoader.class);
config.register("tabsheet", TabSheetLoader.class); // for backward compatibility
config.register(Embedded.NAME, EmbeddedLoader.class);
config.register(Filter.NAME, FilterLoader.class);
config.register(AccessControl.NAME, AccessControlLoader.class);
config.register(ButtonsPanel.NAME, ButtonsPanelLoader.class);
config.register(ActionsField.NAME, ActionsFieldLoader.class);
config.register(PopupButton.NAME, PopupButtonLoader.class);
config.register(FieldGroup.NAME, FieldGroupLoader.class);
config.register(TokenList.NAME, TokenListLoader.class);
config.register(WidgetsTree.NAME, WidgetsTreeLoader.class);
config.register(TwinColumn.NAME, TwinColumnLoader.class);
config.register(ProgressBar.NAME, ProgressBarLoader.class);
config.register(SearchField.NAME, SearchFieldLoader.class);
config.register("scriptHost", ScriptHostLoader.class);
}
public static void registerLoader(String tagName, Class<? extends com.haulmont.cuba.gui.xml.layout.ComponentLoader> aClass) {

View File

@ -1,66 +0,0 @@
/*
* Copyright (c) 2011 Haulmont Technology Ltd. All Rights Reserved.
* Haulmont Technology proprietary and confidential.
* Use is subject to license terms.
*/
package com.haulmont.cuba.gui.xml.layout.loaders;
import com.haulmont.chile.core.model.MetaClass;
import com.haulmont.chile.core.model.MetaProperty;
import com.haulmont.cuba.gui.components.Component;
import com.haulmont.cuba.gui.components.FieldGroup;
import com.haulmont.cuba.gui.components.IFrame;
import com.haulmont.cuba.gui.data.CollectionDatasource;
import com.haulmont.cuba.gui.data.Datasource;
import com.haulmont.cuba.gui.data.impl.DsListenerAdapter;
import com.haulmont.cuba.gui.xml.layout.*;
import com.haulmont.cuba.gui.xml.layout.ComponentLoader;
import org.apache.commons.lang.BooleanUtils;
import org.apache.commons.lang.StringUtils;
import org.dom4j.Element;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
/**
* <p>$Id$</p>
*
* @author devyatkin
*/
public class FieldGroupRuntimeLoader extends FieldGroupLoader {
public FieldGroupRuntimeLoader(Context context, LayoutLoaderConfig config, ComponentsFactory factory) {
super(context, config, factory);
}
@Override
public Component loadComponent(ComponentsFactory factory, Element element, Component parent) throws InstantiationException, IllegalAccessException {
final FieldGroup component = factory.createComponent("fieldGroup");
assignXmlDescriptor(component, element);
loadId(component, element);
loadVisible(component, element);
assignFrame(component);
return component;
}
protected List<FieldGroup.Field> loadFields(FieldGroup component, Datasource ds){
MetaClass meta = ds.getMetaClass();
Collection<MetaProperty> metaProperties = meta.getProperties();
List<FieldGroup.Field> fields = new ArrayList<FieldGroup.Field>();
for(MetaProperty property : metaProperties){
FieldGroup.Field field = new FieldGroup.Field(property.getName());
field.setCaption(property.getName());
fields.add(field);
}
return fields;
}
}

View File

@ -1,11 +1,7 @@
/*
* Copyright (c) 2008 Haulmont Technology Ltd. All Rights Reserved.
* Copyright (c) 2012 Haulmont Technology Ltd. All Rights Reserved.
* Haulmont Technology proprietary and confidential.
* Use is subject to license terms.
* Author: Dmitry Abramov
* Created: 11.03.2009 18:14:23
* $Id$
*/
package com.haulmont.cuba.gui.xml.layout.loaders;
@ -13,8 +9,11 @@ import com.haulmont.cuba.gui.components.Component;
import com.haulmont.cuba.gui.xml.layout.ComponentsFactory;
import org.dom4j.Element;
public class FileUploadFieldLoader extends ComponentLoader{
private static final long serialVersionUID = 5698387638929530175L;
/**
* @author abramov
* @version $Id$
*/
public class FileUploadFieldLoader extends ComponentLoader {
public FileUploadFieldLoader(Context context) {
super(context);

View File

@ -1,27 +1,29 @@
/*
* Copyright (c) 2008 Haulmont Technology Ltd. All Rights Reserved.
* Copyright (c) 2012 Haulmont Technology Ltd. All Rights Reserved.
* Haulmont Technology proprietary and confidential.
* Use is subject to license terms.
* Author: Nikolay Gorodnov
* Created: 17.08.2010 14:24:26
*
* $Id$
*/
package com.haulmont.cuba.gui.xml.layout.loaders;
import com.haulmont.cuba.gui.components.BoxLayout;
import com.haulmont.cuba.gui.components.Component;
import com.haulmont.cuba.gui.xml.layout.*;
import com.haulmont.cuba.gui.components.FlowBoxLayout;
import com.haulmont.cuba.gui.xml.layout.ComponentsFactory;
import com.haulmont.cuba.gui.xml.layout.LayoutLoaderConfig;
import org.dom4j.Element;
public class FlowBoxLoader extends ContainerLoader {
public FlowBoxLoader(Context context, LayoutLoaderConfig config, ComponentsFactory factory) {
/**
* @author gorodnov
* @version $Id$
*/
public class FlowBoxLayoutLoader extends ContainerLoader {
public FlowBoxLayoutLoader(Context context, LayoutLoaderConfig config, ComponentsFactory factory) {
super(context, config, factory);
}
public Component loadComponent(ComponentsFactory factory, Element element, Component parent) throws InstantiationException, IllegalAccessException {
final BoxLayout component = factory.createComponent("flowbox");
final BoxLayout component = factory.createComponent(FlowBoxLayout.NAME);
assignXmlDescriptor(component, element);
loadId(component, element);

View File

@ -1,12 +1,7 @@
/*
* Copyright (c) 2008 Haulmont Technology Ltd. All Rights Reserved.
* Copyright (c) 2012 Haulmont Technology Ltd. All Rights Reserved.
* Haulmont Technology proprietary and confidential.
* Use is subject to license terms.
* Author: Nikolay Gorodnov
* Created: 17.08.2009 17:18:59
*
* $Id$
*/
package com.haulmont.cuba.gui.xml.layout.loaders;
@ -18,15 +13,20 @@ import com.haulmont.cuba.gui.xml.layout.LayoutLoaderConfig;
import org.apache.commons.lang.StringUtils;
import org.dom4j.Element;
public class HtmlBoxLoader extends ContainerLoader implements ComponentLoader {
public HtmlBoxLoader(Context context, LayoutLoaderConfig config, ComponentsFactory factory) {
/**
* @author gorodnov
* @version $Id$
*/
public class HtmlBoxLayoutLoader extends ContainerLoader implements ComponentLoader {
public HtmlBoxLayoutLoader(Context context, LayoutLoaderConfig config, ComponentsFactory factory) {
super(context, config, factory);
}
public Component loadComponent(
ComponentsFactory factory, Element element, Component parent
) throws InstantiationException, IllegalAccessException {
final HtmlBoxLayout component = factory.createComponent("htmlbox");
final HtmlBoxLayout component = factory.createComponent(HtmlBoxLayout.NAME);
assignXmlDescriptor(component, element);
loadId(component, element);

View File

@ -15,12 +15,10 @@ import org.apache.commons.lang.StringUtils;
import org.dom4j.Element;
/**
* <p>$Id$</p>
*
* @author Alexander Budarov
* @version $Id$
*/
public class ProgressBarLoader extends AbstractFieldLoader {
private static final long serialVersionUID = 4465232545027614638L;
public ProgressBarLoader(Context context, LayoutLoaderConfig config, ComponentsFactory factory) {
super(context, config, factory);

View File

@ -1,34 +0,0 @@
/*
* Copyright (c) 2011 Haulmont Technology Ltd. All Rights Reserved.
* Haulmont Technology proprietary and confidential.
* Use is subject to license terms.
*/
package com.haulmont.cuba.gui.xml.layout.loaders;
import com.haulmont.cuba.gui.components.Component;
import com.haulmont.cuba.gui.xml.layout.ComponentsFactory;
import org.dom4j.Element;
/**
* <p>$Id$</p>
*
* @author artamonov
*/
public class ScriptHostLoader extends ComponentLoader {
private static final long serialVersionUID = -5747403317360243260L;
public ScriptHostLoader(Context context) {
super(context);
}
public Component loadComponent(ComponentsFactory factory, Element element, Component parent) throws InstantiationException, IllegalAccessException {
Component component = factory.createComponent(element.getName());
loadId(component, element);
assignFrame((Component.BelongToFrame) component);
return component;
}
}

View File

@ -6,7 +6,7 @@
package com.haulmont.cuba.gui.xml.layout.loaders;
import com.haulmont.cuba.gui.components.Component;
import com.haulmont.cuba.gui.components.Tabsheet;
import com.haulmont.cuba.gui.components.TabSheet;
import com.haulmont.cuba.gui.xml.layout.ComponentLoader;
import com.haulmont.cuba.gui.xml.layout.ComponentsFactory;
import com.haulmont.cuba.gui.xml.layout.LayoutLoaderConfig;
@ -19,8 +19,9 @@ import java.util.List;
* @author abramov
* @version $Id$
*/
public class TabsheetLoader extends ContainerLoader {
public TabsheetLoader(Context context, LayoutLoaderConfig config, ComponentsFactory factory) {
public class TabSheetLoader extends ContainerLoader {
public TabSheetLoader(Context context, LayoutLoaderConfig config, ComponentsFactory factory) {
super(context, config, factory);
}
@ -28,7 +29,7 @@ public class TabsheetLoader extends ContainerLoader {
public Component loadComponent(ComponentsFactory factory, Element element, Component parent)
throws InstantiationException, IllegalAccessException {
final Tabsheet component = factory.createComponent("tabsheet");
final TabSheet component = factory.createComponent(TabSheet.NAME);
assignXmlDescriptor(component, element);
loadId(component, element);
@ -46,7 +47,7 @@ public class TabsheetLoader extends ContainerLoader {
boolean lazy = Boolean.valueOf(tabElement.attributeValue("lazy"));
final ComponentLoader loader = getLoader("vbox");
final Tabsheet.Tab tab;
final TabSheet.Tab tab;
if (lazy) {
tab = component.addLazyTab(name, tabElement, loader);

View File

@ -1,24 +1,24 @@
/*
* Copyright (c) 2008 Haulmont Technology Ltd. All Rights Reserved.
* Copyright (c) 2012 Haulmont Technology Ltd. All Rights Reserved.
* Haulmont Technology proprietary and confidential.
* Use is subject to license terms.
* Author: Nikolay Gorodnov
* Created: 12.08.2009 15:14:59
*
* $Id$
*/
package com.haulmont.cuba.gui.xml.layout.loaders;
import com.haulmont.cuba.gui.components.Component;
import com.haulmont.cuba.gui.components.ToggleBoxLayout;
import com.haulmont.cuba.gui.xml.layout.*;
import com.haulmont.cuba.gui.xml.layout.ComponentsFactory;
import com.haulmont.cuba.gui.xml.layout.LayoutLoaderConfig;
import org.dom4j.Element;
public class ToggleBoxLoader extends ContainerLoader
/**
* @author gorodnov
* @version $Id$
*/
public class ToggleBoxLayoutLoader extends ContainerLoader
implements com.haulmont.cuba.gui.xml.layout.ComponentLoader {
public ToggleBoxLoader(Context context, LayoutLoaderConfig config, ComponentsFactory factory) {
public ToggleBoxLayoutLoader(Context context, LayoutLoaderConfig config, ComponentsFactory factory) {
super(context, config, factory);
}
@ -27,7 +27,7 @@ public class ToggleBoxLoader extends ContainerLoader
Element element,
Component parent
) throws InstantiationException, IllegalAccessException {
final ToggleBoxLayout component = factory.createComponent("togglebox");
final ToggleBoxLayout component = factory.createComponent(ToggleBoxLayout.NAME);
assignXmlDescriptor(component, element);
loadId(component, element);

View File

@ -1,12 +1,7 @@
/*
* Copyright (c) 2008 Haulmont Technology Ltd. All Rights Reserved.
* Copyright (c) 2012 Haulmont Technology Ltd. All Rights Reserved.
* Haulmont Technology proprietary and confidential.
* Use is subject to license terms.
* Author: Konstantin Krivopustov
* Created: 11.12.2008 17:33:12
*
* $Id$
*/
package com.haulmont.cuba.web;
@ -15,8 +10,13 @@ import com.haulmont.cuba.core.global.Configuration;
import com.haulmont.cuba.core.global.Messages;
import com.haulmont.cuba.core.global.SilentException;
import com.haulmont.cuba.gui.*;
import com.haulmont.cuba.gui.components.*;
import com.haulmont.cuba.gui.components.AbstractAction;
import com.haulmont.cuba.gui.components.Action;
import com.haulmont.cuba.gui.components.DialogAction;
import com.haulmont.cuba.gui.components.IFrame;
import com.haulmont.cuba.gui.components.ShortcutAction;
import com.haulmont.cuba.gui.components.Window;
import com.haulmont.cuba.gui.components.WrappedWindow;
import com.haulmont.cuba.gui.config.WindowInfo;
import com.haulmont.cuba.web.gui.WebWindow;
import com.haulmont.cuba.web.gui.components.WebButton;
@ -30,6 +30,7 @@ import com.vaadin.ui.Button;
import com.vaadin.ui.Component;
import com.vaadin.ui.*;
import com.vaadin.ui.Label;
import com.vaadin.ui.TabSheet;
import org.apache.commons.lang.BooleanUtils;
import org.apache.commons.lang.ObjectUtils;
import org.apache.commons.lang.StringUtils;
@ -40,6 +41,10 @@ import org.apache.commons.logging.LogFactory;
import javax.annotation.Nullable;
import java.util.*;
/**
* @author krivopustov
* @version $Id$
*/
public class WebWindowManager extends WindowManager {
protected static class WindowData {

View File

@ -16,7 +16,7 @@
</timers>
<layout expand="logsBox" spacing="true">
<tabsheet width="100%">
<tabSheet width="100%">
<tab id="viewTab" caption="msg://viewTab" margin="true">
<hbox id="logSelectBox" spacing="true" expandable="false">
<label id="labelLogFile" value="msg://logFile"/>
@ -37,7 +37,7 @@
<button id="controlLoggerButton" invoke="callControlLogger" caption="msg://control"/>
</hbox>
</tab>
</tabsheet>
</tabSheet>
<groupBox id="logsBox" width="100%" caption="msg://logs">
<hbox id="logFieldBox" height="100%" width="100%">

View File

@ -14,6 +14,10 @@ import javax.annotation.ManagedBean;
import java.util.HashMap;
import java.util.Map;
/**
* @author krivopustov
* @version $Id$
*/
@ManagedBean(ComponentsFactory.NAME)
public class WebComponentsFactory implements ComponentsFactory {
@ -30,7 +34,7 @@ public class WebComponentsFactory implements ComponentsFactory {
classes.put(ScrollBoxLayout.NAME, WebScrollBoxLayout.class);
classes.put(ToggleBoxLayout.NAME, WebToggleBoxLayout.class);
classes.put(HtmlBoxLayout.NAME, WebHtmlBoxLayout.class);
classes.put("flowbox", WebFlowBoxLayout.class);
classes.put(FlowBoxLayout.NAME, WebFlowBoxLayout.class);
classes.put(Button.NAME, WebButton.class);
classes.put(LinkButton.NAME, WebLinkButton.class);
@ -57,7 +61,7 @@ public class WebComponentsFactory implements ComponentsFactory {
classes.put(FileMultiUploadField.NAME, WebFileMultiUploadField.class);
classes.put(SplitPanel.NAME, WebSplitPanel.class);
classes.put(Tree.NAME, WebTree.class);
classes.put(Tabsheet.NAME, WebTabsheet.class);
classes.put(TabSheet.NAME, WebTabSheet.class);
classes.put(Embedded.NAME, WebEmbedded.class);
classes.put(Filter.NAME, WebFilter.class);
classes.put(AccessControl.NAME, WebAccessControl.class);

View File

@ -27,8 +27,13 @@ import com.haulmont.cuba.web.toolkit.ui.VerticalActionsLayout;
import com.vaadin.event.ItemClickEvent;
import com.vaadin.terminal.Sizeable;
import com.vaadin.terminal.ThemeResource;
import com.vaadin.ui.*;
import com.vaadin.ui.AbstractOrderedLayout;
import com.vaadin.ui.Button;
import com.vaadin.ui.ComponentContainer;
import com.vaadin.ui.HorizontalLayout;
import com.vaadin.ui.Layout;
import com.vaadin.ui.TabSheet;
import com.vaadin.ui.VerticalLayout;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.dom4j.Element;

View File

@ -10,13 +10,14 @@
*/
package com.haulmont.cuba.web.gui.components;
import com.haulmont.cuba.gui.components.Component;
import com.haulmont.cuba.gui.components.FlowBoxLayout;
import com.haulmont.cuba.toolkit.gwt.client.ui.VFlowLayout;
import com.vaadin.ui.ClientWidget;
@SuppressWarnings("serial")
@ClientWidget(VFlowLayout.class)
public class WebFlowBoxLayout extends WebVBoxLayout {
public class WebFlowBoxLayout extends WebVBoxLayout implements FlowBoxLayout {
public WebFlowBoxLayout() {
setHeight("100%");
}

View File

@ -6,7 +6,6 @@
package com.haulmont.cuba.web.gui.components;
import com.haulmont.cuba.gui.components.ClientScriptHost;
import com.haulmont.cuba.gui.components.ValueProvider;
import com.haulmont.cuba.toolkit.gwt.client.utils.VScriptHost;
import com.haulmont.cuba.web.toolkit.ui.JavaScriptHost;
@ -19,7 +18,7 @@ import com.vaadin.ui.ClientWidget;
*/
@ClientWidget(VScriptHost.class)
@SuppressWarnings({"unused"})
public class WebScriptHost extends WebAbstractComponent<JavaScriptHost> implements ClientScriptHost {
public class WebScriptHost extends WebAbstractComponent<JavaScriptHost> {
public WebScriptHost() {
this.component = new JavaScriptHost();

View File

@ -14,28 +14,27 @@ import com.haulmont.cuba.gui.ComponentVisitor;
import com.haulmont.cuba.gui.ComponentsHelper;
import com.haulmont.cuba.gui.components.Component;
import com.haulmont.cuba.gui.components.IFrame;
import com.haulmont.cuba.gui.components.Tabsheet;
import com.haulmont.cuba.gui.components.TabSheet;
import com.haulmont.cuba.gui.components.Window;
import com.haulmont.cuba.gui.data.impl.DsContextImplementation;
import com.haulmont.cuba.gui.settings.Settings;
import com.haulmont.cuba.gui.xml.layout.ComponentLoader;
import com.vaadin.ui.TabSheet;
import org.dom4j.Element;
import java.util.*;
public class WebTabsheet
public class WebTabSheet
extends
WebAbstractComponent<TabSheet>
WebAbstractComponent<com.vaadin.ui.TabSheet>
implements
Tabsheet, Component.Wrapper, Component.Container
TabSheet, Component.Wrapper, Component.Container
{
private boolean postInitTaskAdded;
private boolean componentTabChangeListenerInitialized;
private ComponentLoader.Context context;
public WebTabsheet() {
public WebTabSheet() {
component = new TabSheetEx(this);
component.setCloseHandler(new MyCloseHandler());
}
@ -85,7 +84,7 @@ public class WebTabsheet
return ComponentsHelper.getComponents(this);
}
protected class Tab implements com.haulmont.cuba.gui.components.Tabsheet.Tab {
protected class Tab implements TabSheet.Tab {
private String name;
private Component component;
@ -108,43 +107,43 @@ public class WebTabsheet
@Override
public String getCaption() {
return WebTabsheet.this.component.getTab(WebComponentsHelper.unwrap(component)).getCaption();
return WebTabSheet.this.component.getTab(WebComponentsHelper.unwrap(component)).getCaption();
}
@Override
public void setCaption(String caption) {
WebTabsheet.this.component.getTab(WebComponentsHelper.unwrap(component)).setCaption(caption);
WebTabSheet.this.component.getTab(WebComponentsHelper.unwrap(component)).setCaption(caption);
}
@Override
public boolean isEnabled() {
return WebTabsheet.this.component.getTab(WebComponentsHelper.unwrap(component)).isEnabled();
return WebTabSheet.this.component.getTab(WebComponentsHelper.unwrap(component)).isEnabled();
}
@Override
public void setEnabled(boolean enabled) {
WebTabsheet.this.component.getTab(WebComponentsHelper.unwrap(component)).setEnabled(enabled);
WebTabSheet.this.component.getTab(WebComponentsHelper.unwrap(component)).setEnabled(enabled);
}
@Override
public boolean isVisible() {
return WebTabsheet.this.component.getTab(WebComponentsHelper.unwrap(component)).isVisible();
return WebTabSheet.this.component.getTab(WebComponentsHelper.unwrap(component)).isVisible();
}
@Override
public void setVisible(boolean visible) {
WebTabsheet.this.component.getTab(WebComponentsHelper.unwrap(component)).setVisible(visible);
WebTabSheet.this.component.getTab(WebComponentsHelper.unwrap(component)).setVisible(visible);
}
@Override
public boolean isClosable() {
TabSheet.Tab tab = WebTabsheet.this.component.getTab(WebComponentsHelper.unwrap(component));
com.vaadin.ui.TabSheet.Tab tab = WebTabSheet.this.component.getTab(WebComponentsHelper.unwrap(component));
return tab.isClosable();
}
@Override
public void setClosable(boolean closable) {
TabSheet.Tab tab = WebTabsheet.this.component.getTab(WebComponentsHelper.unwrap(component));
com.vaadin.ui.TabSheet.Tab tab = WebTabSheet.this.component.getTab(WebComponentsHelper.unwrap(component));
tab.setClosable(closable);
}
@ -172,13 +171,13 @@ public class WebTabsheet
@Override
public void setCaptionStyleName(String styleName) {
TabSheet.Tab vaadinTab = WebTabsheet.this.component.getTab(WebComponentsHelper.unwrap(component));
com.vaadin.ui.TabSheet.Tab vaadinTab = WebTabSheet.this.component.getTab(WebComponentsHelper.unwrap(component));
vaadinTab.setCaptionStyle(styleName);
}
}
@Override
public com.haulmont.cuba.gui.components.Tabsheet.Tab addTab(String name, Component component) {
public TabSheet.Tab addTab(String name, Component component) {
final Tab tab = new Tab(name, component);
this.tabs.put(name, tab);
@ -193,7 +192,7 @@ public class WebTabsheet
}
@Override
public com.haulmont.cuba.gui.components.Tabsheet.Tab addLazyTab(String name,
public TabSheet.Tab addLazyTab(String name,
Element descriptor,
ComponentLoader loader)
{
@ -244,7 +243,7 @@ public class WebTabsheet
}
@Override
public void setTab(com.haulmont.cuba.gui.components.Tabsheet.Tab tab) {
public void setTab(TabSheet.Tab tab) {
this.component.setSelectedTab(WebComponentsHelper.unwrap(((Tab) tab).getComponent()));
}
@ -257,12 +256,12 @@ public class WebTabsheet
}
@Override
public Tabsheet.Tab getTab(String name) {
public TabSheet.Tab getTab(String name) {
return tabs.get(name);
}
@Override
public Collection<com.haulmont.cuba.gui.components.Tabsheet.Tab> getTabs() {
public Collection<TabSheet.Tab> getTabs() {
return (Collection)tabs.values();
}
@ -276,9 +275,9 @@ public class WebTabsheet
// init component SelectedTabChangeListener only when needed, making sure it is
// after all lazy tabs listeners
if (!componentTabChangeListenerInitialized) {
component.addListener(new TabSheet.SelectedTabChangeListener() {
component.addListener(new com.vaadin.ui.TabSheet.SelectedTabChangeListener() {
@Override
public void selectedTabChange(TabSheet.SelectedTabChangeEvent event) {
public void selectedTabChange(com.vaadin.ui.TabSheet.SelectedTabChangeEvent event) {
// Fire GUI listener
fireTabChanged();
// Execute outstanding post init tasks after GUI listener.
@ -302,7 +301,7 @@ public class WebTabsheet
}
}
private static class TabSheetEx extends TabSheet implements WebComponentEx {
private static class TabSheetEx extends com.vaadin.ui.TabSheet implements WebComponentEx {
private Component component;
private TabSheetEx(Component component) {
@ -315,7 +314,7 @@ public class WebTabsheet
}
}
private class LazyTabChangeListener implements TabSheet.SelectedTabChangeListener {
private class LazyTabChangeListener implements com.vaadin.ui.TabSheet.SelectedTabChangeListener {
private WebAbstractBox tabContent;
private Element descriptor;
@ -328,8 +327,8 @@ public class WebTabsheet
}
@Override
public void selectedTabChange(TabSheet.SelectedTabChangeEvent event) {
com.vaadin.ui.Component selectedTab = WebTabsheet.this.component.getSelectedTab();
public void selectedTabChange(com.vaadin.ui.TabSheet.SelectedTabChangeEvent event) {
com.vaadin.ui.Component selectedTab = WebTabSheet.this.component.getSelectedTab();
if (selectedTab == tabContent && lazyTabs.remove(tabContent)) {
Component comp;
try {
@ -344,7 +343,7 @@ public class WebTabsheet
com.vaadin.ui.Component impl = WebComponentsHelper.getComposition(comp);
impl.setSizeFull();
final Window window = com.haulmont.cuba.gui.ComponentsHelper.getWindow(WebTabsheet.this);
final Window window = com.haulmont.cuba.gui.ComponentsHelper.getWindow(WebTabSheet.this);
if (window != null) {
com.haulmont.cuba.gui.ComponentsHelper.walkComponents(
tabContent,
@ -368,11 +367,11 @@ public class WebTabsheet
}
}
private class MyCloseHandler implements TabSheet.CloseHandler {
private class MyCloseHandler implements com.vaadin.ui.TabSheet.CloseHandler {
private static final long serialVersionUID = -6766617382191585632L;
@Override
public void onTabClose(TabSheet tabsheet, com.vaadin.ui.Component tabContent) {
public void onTabClose(com.vaadin.ui.TabSheet tabsheet, com.vaadin.ui.Component tabContent) {
// have no other way to get tab from tab content
for (Tab tab: tabs.values()) {
com.vaadin.ui.Component tabComponent = WebComponentsHelper.unwrap(tab.getComponent());