Cuba styles usage

This commit is contained in:
Yuriy Artamonov 2013-02-21 11:02:54 +00:00
parent eb416d0ad7
commit 788a7eb0c4
24 changed files with 66 additions and 65 deletions

View File

@ -62,7 +62,7 @@ def desktopModule = project(':cuba-desktop')
def uiTestModule = project(':cuba-test-ui')
def portalModule = project(':cuba-portal')
def vaadinVersion = '7.0.0.h.M5'
def vaadinVersion = '7.0.1.h.M0'
def servletApi = [group: 'org.apache.tomcat', name: 'servlet-api', version: '6.0.20']
def groovyArtifact = [group: 'org.codehaus.groovy', name: 'groovy', version: '1.7.10']

View File

@ -9,7 +9,7 @@ package com.haulmont.cuba.web.toolkit.ui.client.tabsheet;
import com.google.gwt.core.client.GWT;
import com.google.gwt.event.dom.client.ContextMenuEvent;
import com.google.gwt.user.client.ui.Widget;
import com.haulmont.cuba.web.toolkit.ui.ActionsTabSheet;
import com.haulmont.cuba.web.toolkit.ui.CubaTabSheet;
import com.vaadin.client.Util;
import com.vaadin.client.communication.RpcProxy;
import com.vaadin.client.ui.Action;
@ -20,16 +20,16 @@ import com.vaadin.shared.ui.Connect;
* @author artamonov
* @version $Id$
*/
@Connect(value = ActionsTabSheet.class)
public class ActionsTabSheetConnector extends TabsheetConnector {
@Connect(value = CubaTabSheet.class)
public class CubaTabSheetConnector extends TabsheetConnector {
protected ActionsTabSheetServerRpc rpc = RpcProxy.create(ActionsTabSheetServerRpc.class, this);
protected CubaTabSheetServerRpc rpc = RpcProxy.create(CubaTabSheetServerRpc.class, this);
protected int lastContextMenuX = -1;
protected int lastContextMenuY = -1;
public ActionsTabSheetConnector() {
registerRpc(ActionsTabSheetClientRpc.class, new ActionsTabSheetClientRpc() {
public CubaTabSheetConnector() {
registerRpc(CubaTabSheetClientRpc.class, new CubaTabSheetClientRpc() {
@Override
public void showTabContextMenu(final int tabIndex, ClientAction[] actions) {
StaticActionOwner actionOwner = new StaticActionOwner(getConnection(), getWidget().id);
@ -60,14 +60,14 @@ public class ActionsTabSheetConnector extends TabsheetConnector {
}
@Override
public ActionsTabSheetWidget getWidget() {
return (ActionsTabSheetWidget) super.getWidget();
public CubaTabSheetWidget getWidget() {
return (CubaTabSheetWidget) super.getWidget();
}
@Override
protected Widget createWidget() {
ActionsTabSheetWidget widget = GWT.create(ActionsTabSheetWidget.class);
widget.tabContextMenuHandler = new ActionsTabSheetWidget.TabContextMenuHandler() {
CubaTabSheetWidget widget = GWT.create(CubaTabSheetWidget.class);
widget.tabContextMenuHandler = new CubaTabSheetWidget.TabContextMenuHandler() {
@Override
public void onContextMenu(int tabIndex, ContextMenuEvent event) {
lastContextMenuX = Util.getTouchOrMouseClientX(event.getNativeEvent());
@ -84,7 +84,7 @@ public class ActionsTabSheetConnector extends TabsheetConnector {
}
@Override
public ActionsTabSheetState getState() {
return (ActionsTabSheetState) super.getState();
public CubaTabSheetState getState() {
return (CubaTabSheetState) super.getState();
}
}

View File

@ -13,13 +13,13 @@ import com.vaadin.client.ui.VTabsheet;
* @author artamonov
* @version $Id$
*/
public class ActionsTabSheetWidget extends VTabsheet {
public class CubaTabSheetWidget extends VTabsheet {
public static final String CLASSNAME = "v-actions-tabsheet";
protected TabContextMenuHandler tabContextMenuHandler;
public ActionsTabSheetWidget() {
public CubaTabSheetWidget() {
setStyleName(CLASSNAME);
}

View File

@ -6,7 +6,6 @@
package com.haulmont.cuba.web.toolkit.ui.client.tabsheet;
import com.haulmont.cuba.web.toolkit.ui.client.tabsheet.ClientAction;
import com.vaadin.client.ui.Action;
import com.vaadin.client.ui.ActionOwner;

View File

@ -27,7 +27,7 @@ import com.haulmont.cuba.web.actions.DoNotChangeSubstUserAction;
import com.haulmont.cuba.web.app.UserSettingsTools;
import com.haulmont.cuba.web.app.folders.FoldersPane;
import com.haulmont.cuba.web.toolkit.MenuShortcutAction;
import com.haulmont.cuba.web.toolkit.ui.ActionsTabSheet;
import com.haulmont.cuba.web.toolkit.ui.CubaTabSheet;
import com.haulmont.cuba.web.toolkit.ui.JavaScriptHost;
import com.vaadin.data.Property;
import com.vaadin.event.ShortcutListener;
@ -401,7 +401,7 @@ public class AppWindow extends UIView implements UserSubstitutionListener {
HorizontalLayout layout = new HorizontalLayout();
layout.setSpacing(false);
layout.setMargin(false);
layout.setStyleName("menubar");
layout.setStyleName("cuba-app-menubar");
layout.setWidth(100, Unit.PERCENTAGE);
if (webConfig.getUseLightHeader()){
layout.setHeight(40, Unit.PIXELS);
@ -557,7 +557,7 @@ public class AppWindow extends UIView implements UserSubstitutionListener {
*/
protected Layout createTitleLayout() {
HorizontalLayout titleLayout = new HorizontalLayout();
titleLayout.setStyleName("titlebar");
titleLayout.setStyleName("cuba-app-titlebar");
titleLayout.setWidth(100, Unit.PERCENTAGE);
titleLayout.setHeight(41, Unit.PIXELS);
@ -572,7 +572,7 @@ public class AppWindow extends UIView implements UserSubstitutionListener {
}
Label logoLabel = new Label(getLogoLabelCaption());
logoLabel.setStyleName("appname");
logoLabel.setStyleName("cuba-app-appname-label");
titleLayout.addComponent(logoLabel);
titleLayout.setExpandRatio(logoLabel, 1);
@ -591,7 +591,7 @@ public class AppWindow extends UIView implements UserSubstitutionListener {
protected void addUserLabel(HorizontalLayout layout) {
Label userLabel = new Label(messages.getMessage(getMessagesPack(), "loggedInLabel"));
userLabel.setStyleName("select-label");
userLabel.setStyleName("cuba-user-select-label");
userLabel.setSizeUndefined();
layout.addComponent(userLabel);
@ -657,7 +657,7 @@ public class AppWindow extends UIView implements UserSubstitutionListener {
if (substitutions.isEmpty()) {
Label userNameLabel = new Label(getSubstitutedUserCaption(session.getUser()));
userNameLabel.setStyleName("select-label");
userNameLabel.setStyleName("cuba-user-select-label");
userNameLabel.setSizeUndefined();
parentLayout.addComponent(userNameLabel);
parentLayout.setComponentAlignment(userNameLabel, Alignment.MIDDLE_RIGHT);
@ -670,7 +670,7 @@ public class AppWindow extends UIView implements UserSubstitutionListener {
substUserSelect.setNullSelectionAllowed(false);
substUserSelect.setImmediate(true);
substUserSelect.setStyleName("select-label");
substUserSelect.setStyleName("cuba-user-select-combobox");
substUserSelect.addItem(session.getUser());
substUserSelect.setItemCaption(session.getUser(), getSubstitutedUserCaption(session.getUser()));
@ -714,7 +714,7 @@ public class AppWindow extends UIView implements UserSubstitutionListener {
new LogoutBtnClickListener()
);
logoutBtn.setDescription(messages.getMessage(getMessagesPack(), "logoutBtnDescription"));
logoutBtn.setStyleName("white-border");
logoutBtn.setStyleName("cuba-buttons-white-border");
logoutBtn.setIcon(new ThemeResource("app/exit.png"));
// AppUI.getInstance().getWindowManager().setDebugId(logoutBtn, "logoutBtn");
return logoutBtn;
@ -730,7 +730,7 @@ public class AppWindow extends UIView implements UserSubstitutionListener {
opener.extend(newWindowBtn);
newWindowBtn.setDescription(messages.getMessage(getMessagesPack(), "newWindowBtnDescription"));
newWindowBtn.setStyleName("white-border");
newWindowBtn.setStyleName("cuba-buttons-white-border");
newWindowBtn.setIcon(new ThemeResource("app/new-window.png"));
return newWindowBtn;
}
@ -863,7 +863,7 @@ public class AppWindow extends UIView implements UserSubstitutionListener {
}
}
public static class AppTabSheet extends ActionsTabSheet implements com.vaadin.event.Action.Handler {
public static class AppTabSheet extends CubaTabSheet implements com.vaadin.event.Action.Handler {
private static final long serialVersionUID = 623307791240239175L;

View File

@ -150,6 +150,8 @@ public class LoginWindow extends UIView implements Action.Handler {
centerLayout.setWidth(formWidth + "px");
centerLayout.setHeight(formHeight + "px");
centerLayout.setHeight(formHeight + "px");
HorizontalLayout titleLayout = new HorizontalLayout();
titleLayout.setStyleName(getStyle("title"));
titleLayout.setSpacing(true);

View File

@ -21,7 +21,7 @@ import com.haulmont.cuba.gui.config.WindowInfo;
import com.haulmont.cuba.web.gui.WebWindow;
import com.haulmont.cuba.web.gui.components.WebButton;
import com.haulmont.cuba.web.gui.components.WebComponentsHelper;
import com.haulmont.cuba.web.toolkit.ui.ActionsTabSheet;
import com.haulmont.cuba.web.toolkit.ui.CubaTabSheet;
import com.vaadin.event.ShortcutListener;
import com.vaadin.server.Page;
import com.vaadin.server.Sizeable;
@ -779,7 +779,7 @@ public class WebWindowManager extends WindowManager {
final Layout layout = (Layout) openMode.getData();
layout.removeComponent(WebComponentsHelper.getComposition(window));
ActionsTabSheet webTabsheet = (ActionsTabSheet) appWindow.getTabSheet();
CubaTabSheet webTabsheet = (CubaTabSheet) appWindow.getTabSheet();
if (AppWindow.Mode.TABBED.equals(appWindow.getMode())) {
webTabsheet.silentCloseTabAndSelectPrevious(layout);

View File

@ -44,7 +44,7 @@ public class WindowBreadCrumbs extends HorizontalLayout {
setMargin(true);
setWidth(100, Unit.PERCENTAGE);
setHeight(-1, Unit.PIXELS); // TODO (abramov) This is a bit tricky
setStyleName("headline-container");
setStyleName("cuba-headline-container");
// tabbedMode = AppWindow.Mode.TABBED.equals(AppUI.getInstance().getAppWindow().getMode());
tabbedMode = true;
@ -57,7 +57,7 @@ public class WindowBreadCrumbs extends HorizontalLayout {
logoLayout.setSpacing(true);
linksLayout = new HorizontalLayout();
linksLayout.setStyleName("breadcrumbs");
linksLayout.setStyleName("cuba-breadcrumbs");
if (!tabbedMode) {
closeBtn = new Button("", new Button.ClickListener() {
@ -68,7 +68,7 @@ public class WindowBreadCrumbs extends HorizontalLayout {
}
});
closeBtn.setIcon(new ThemeResource("images/close.png"));
closeBtn.setStyleName("closetab-button");
closeBtn.setStyleName("cuba-closetab-button");
// AppUI.getInstance().getWindowManager()
// .setDebugId(closeBtn, "closeBtn");
}

View File

@ -97,7 +97,7 @@ public class FoldersPane extends VerticalLayout {
parentAppWindow = appWindow;
setHeight(100, Unit.PERCENTAGE);
setStyleName("folderspane");
setStyleName("cuba-folderspane");
}
public void init(Component parent) {
@ -127,7 +127,7 @@ public class FoldersPane extends VerticalLayout {
createMenuBarCommand(),
firstItem);
menuBar.setStyleName("folders-pane");
menuBar.setStyleName("cuba-folders-pane");
}
}
@ -167,7 +167,7 @@ public class FoldersPane extends VerticalLayout {
appFoldersPane.setWidth("96%");
if (isNeedFoldersTitle()) {
appFoldersLabel = new Label(messages.getMainMessage("folders.appFoldersRoot"));
appFoldersLabel.setStyleName("folderspane-caption");
appFoldersLabel.setStyleName("cuba-folderspane-caption");
} else {
appFoldersLabel = null;
}
@ -194,7 +194,7 @@ public class FoldersPane extends VerticalLayout {
searchFoldersPane.setWidth("96%");
if (isNeedFoldersTitle()) {
searchFoldersLabel = new Label(messages.getMainMessage("folders.searchFoldersRoot"));
searchFoldersLabel.setStyleName("folderspane-caption");
searchFoldersLabel.setStyleName("cuba-folderspane-caption");
} else {
searchFoldersLabel = null;
}

View File

@ -121,7 +121,7 @@ public class MbeanInspectWindow extends AbstractEditor {
BoxLayout vl = new WebVBoxLayout();
vl.setMargin(false, false, true, false);
vl.setSpacing(true);
vl.setStyleName("operationContainer");
vl.setStyleName("cuba-mbeans-operationContainer");
Label nameLbl = new WebLabel();
nameLbl.setValue(op.getReturnType() + " " + op.getName() + "()");

View File

@ -1017,7 +1017,7 @@ public class WebWindow implements Window, Component.Wrapper, Component.HasXmlDes
HorizontalLayout okbar = new HorizontalLayout();
okbar.setHeight(-1, Sizeable.Unit.PIXELS);
okbar.setStyleName("Window-actionsPane");
okbar.setStyleName("cuba-window-actions-pane");
okbar.setMargin(new MarginInfo(true, false, false, false));
okbar.setSpacing(true);
@ -1029,7 +1029,7 @@ public class WebWindow implements Window, Component.Wrapper, Component.HasXmlDes
selectButton.setCaption(messages.getMessage(messagesPackage, "actions.Select"));
selectButton.setIcon(new ThemeResource("icons/ok.png"));
selectButton.addClickListener(selectAction);
selectButton.setStyleName("Window-actionButton");
selectButton.setStyleName("cuba-window-action-button");
cancelButton = WebComponentsHelper.createButton();
cancelButton.setCaption(messages.getMessage(messagesPackage, "actions.Cancel"));
@ -1039,7 +1039,7 @@ public class WebWindow implements Window, Component.Wrapper, Component.HasXmlDes
close("cancel");
}
});
cancelButton.setStyleName("Window-actionButton");
cancelButton.setStyleName("cuba-window-action-button");
cancelButton.setIcon(new ThemeResource("icons/cancel.png"));
okbar.addComponent(selectButton);

View File

@ -420,7 +420,7 @@ public abstract class WebAbstractTable<T extends com.vaadin.ui.Table>
}
});
component.addListener(new ItemClickEvent.ItemClickListener() {
component.addItemClickListener(new ItemClickEvent.ItemClickListener() {
@Override
public void itemClick(ItemClickEvent event) {
if (event.isDoubleClick() && event.getItem() != null) {
@ -457,7 +457,7 @@ public abstract class WebAbstractTable<T extends com.vaadin.ui.Table>
// vaadin7
// component.setEnableCancelSorting(ConfigProvider.getConfig(WebConfig.class).getEnableCancelTableSorting());
ClientConfig clientConfig = ConfigProvider.getConfig(ClientConfig.class);
ClientConfig clientConfig = AppBeans.get(Configuration.class).getConfig(ClientConfig.class);
addShortcutActionBridge(INSERT_SHORTCUT_ID, clientConfig.getTableInsertShortcut(), ListActionType.CREATE);
addShortcutActionBridge(REMOVE_SHORTCUT_ID, clientConfig.getTableRemoveShortcut(), ListActionType.REMOVE);

View File

@ -1115,7 +1115,7 @@ public class WebFieldGroup extends WebAbstractComponent<FieldGroup> implements c
}
}
});
setStyleName("linkfield");
setStyleName("cuba-linkfield");
setCompositionRoot(component);
}

View File

@ -159,7 +159,7 @@ public class WebFilter extends WebAbstractComponent<VerticalActionsLayout> imple
// don't add margin because filter is usually placed inside a groupbox that adds margins to its content
component.setMargin(false);
component.setStyleName("generic-filter");
component.setStyleName("cuba-generic-filter");
foldersPane = App.getInstance().getAppWindow().getFoldersPane();
@ -176,7 +176,7 @@ public class WebFilter extends WebAbstractComponent<VerticalActionsLayout> imple
select = new FilterSelect();
select.setWidth(300, Sizeable.Unit.PIXELS);
select.setStyleName("generic-filter-select");
select.setStyleName("cuba-generic-filter-select");
select.setNullSelectionAllowed(true);
select.setNullSelectionItemId(noFilter);
select.setImmediate(true);
@ -305,7 +305,7 @@ public class WebFilter extends WebAbstractComponent<VerticalActionsLayout> imple
}
});
maxResultsCb.setStyleName("filter-maxresults");
maxResultsCb.setStyleName("cuba-filter-maxresults");
maxResultsLayout.addComponent(maxResultsCb);
maxResultsField = new TextField();
@ -333,7 +333,7 @@ public class WebFilter extends WebAbstractComponent<VerticalActionsLayout> imple
maxResultsLayout.addComponent(maxResultsLabel2);
maxResultsLayout.setComponentAlignment(maxResultsLabel2, com.vaadin.ui.Alignment.MIDDLE_LEFT);
maxResultsLayout.setStyleName("filter-maxresults");
maxResultsLayout.setStyleName("cuba-filter-maxresults");
}
private void fillActions() {

View File

@ -40,7 +40,7 @@ public class WebPopupButton
private List<Action> actionOrder = new LinkedList<>();
public WebPopupButton() {
component = new PopupButton("");
component = new PopupButton();
component.setImmediate(true);
vPopupComponent = new VerticalLayout();

View File

@ -31,7 +31,7 @@ public class WebRowsCount
public WebRowsCount() {
component = new com.haulmont.cuba.web.toolkit.ui.RowsCount();
component.setStyleName("table-rows-count");
component.setStyleName("cuba-table-rows-count");
}
@Override

View File

@ -296,7 +296,7 @@ public class FilterEditor extends AbstractFilterEditor {
table.setPageLength(0);
table.setWidth(TABLE_WIDTH);
table.setHeight("200px");
table.setStyleName("table filter-conditions");
table.setStyleName("cuba-filter-conditions");
table.setColumnReorderingAllowed(false);
table.setSortEnabled(false);

View File

@ -115,7 +115,7 @@ public class ListEditComponent extends CustomComponent implements com.vaadin.ui.
container.setExpandRatio(field, 1);
setCompositionRoot(container);
setStyleName("pickerfield");
setStyleName("cuba-pickerfield");
setWidth(DEFAULT_WIDTH + "px");
}

View File

@ -5,10 +5,10 @@
*/
package com.haulmont.cuba.web.toolkit.ui;
import com.haulmont.cuba.web.toolkit.ui.client.tabsheet.ActionsTabSheetClientRpc;
import com.haulmont.cuba.web.toolkit.ui.client.tabsheet.ActionsTabSheetServerRpc;
import com.haulmont.cuba.web.toolkit.ui.client.tabsheet.ActionsTabSheetState;
import com.haulmont.cuba.web.toolkit.ui.client.tabsheet.ClientAction;
import com.haulmont.cuba.web.toolkit.ui.client.tabsheet.CubaTabSheetClientRpc;
import com.haulmont.cuba.web.toolkit.ui.client.tabsheet.CubaTabSheetServerRpc;
import com.haulmont.cuba.web.toolkit.ui.client.tabsheet.CubaTabSheetState;
import com.vaadin.event.Action;
import com.vaadin.server.KeyMapper;
import com.vaadin.ui.Component;
@ -19,7 +19,7 @@ import java.util.*;
* @author gorodnov
* @version $Id$
*/
public class ActionsTabSheet extends com.vaadin.ui.TabSheet implements Action.Container {
public class CubaTabSheet extends com.vaadin.ui.TabSheet implements Action.Container {
private Stack<Component> openedComponents = new Stack<>();
@ -29,7 +29,7 @@ public class ActionsTabSheet extends com.vaadin.ui.TabSheet implements Action.Co
protected KeyMapper<Action> actionMapper = null;
protected ActionsTabSheetServerRpc rpc = new ActionsTabSheetServerRpc() {
protected CubaTabSheetServerRpc rpc = new CubaTabSheetServerRpc() {
@Override
public void onTabContextMenu(int tabIndex) {
Tab tab = getTab(tabIndex);
@ -49,7 +49,7 @@ public class ActionsTabSheet extends com.vaadin.ui.TabSheet implements Action.Co
ClientAction[] clientActions = actionsList.toArray(new ClientAction[actions.size()]);
getRpcProxy(ActionsTabSheetClientRpc.class).showTabContextMenu(tabIndex, clientActions);
getRpcProxy(CubaTabSheetClientRpc.class).showTabContextMenu(tabIndex, clientActions);
}
}
}
@ -72,7 +72,7 @@ public class ActionsTabSheet extends com.vaadin.ui.TabSheet implements Action.Co
}
};
public ActionsTabSheet() {
public CubaTabSheet() {
registerRpc(rpc);
}
@ -90,8 +90,8 @@ public class ActionsTabSheet extends com.vaadin.ui.TabSheet implements Action.Co
}
@Override
protected ActionsTabSheetState getState() {
return (ActionsTabSheetState) super.getState();
protected CubaTabSheetState getState() {
return (CubaTabSheetState) super.getState();
}
@Override

View File

@ -55,7 +55,7 @@ public class PickerField extends CustomField {
container.setExpandRatio(field, 1);
setCompositionRoot(container);
setStyleName("pickerfield");
setStyleName("cuba-pickerfield");
setWidth(DEFAULT_WIDTH + "px");
}

View File

@ -33,7 +33,7 @@ public class RowsCount extends CustomComponent {
setCompositionRoot(layout);
prevButton = new Button("<");
prevButton.setStyleName("change-page");
prevButton.setStyleName("cuba-paging-change-page");
layout.addComponent(prevButton);
label = new Label();
@ -44,7 +44,7 @@ public class RowsCount extends CustomComponent {
layout.addComponent(countButton);
nextButton = new Button(">");
nextButton.setStyleName("change-page");
nextButton.setStyleName("cuba-paging-change-page");
layout.addComponent(nextButton);
layout.setWidth("-1px");

View File

@ -12,7 +12,7 @@ import com.vaadin.shared.communication.ClientRpc;
* @author artamonov
* @version $Id$
*/
public interface ActionsTabSheetClientRpc extends ClientRpc {
public interface CubaTabSheetClientRpc extends ClientRpc {
public void showTabContextMenu(int tabIndex, ClientAction[] actions);
}

View File

@ -12,7 +12,7 @@ import com.vaadin.shared.communication.ServerRpc;
* @author artamonov
* @version $Id$
*/
public interface ActionsTabSheetServerRpc extends ServerRpc {
public interface CubaTabSheetServerRpc extends ServerRpc {
public void onTabContextMenu(int tabIndex);

View File

@ -12,7 +12,7 @@ import com.vaadin.shared.ui.tabsheet.TabsheetState;
* @author artamonov
* @version $Id$
*/
public class ActionsTabSheetState extends TabsheetState {
public class CubaTabSheetState extends TabsheetState {
private static final long serialVersionUID = 4132538424243246049L;