diff --git a/modules/gui/src/com/haulmont/cuba/gui/components/actions/EditAction.java b/modules/gui/src/com/haulmont/cuba/gui/components/actions/EditAction.java index d0142fb3b7..42c64c5607 100644 --- a/modules/gui/src/com/haulmont/cuba/gui/components/actions/EditAction.java +++ b/modules/gui/src/com/haulmont/cuba/gui/components/actions/EditAction.java @@ -111,19 +111,19 @@ public class EditAction extends ItemTrackingAction { Map params = getWindowParams(); if (params == null) - params = new HashMap(); + params = new HashMap<>(); final Window window = owner.getFrame().openEditor(windowID, datasource.getItem(), openType, params, parentDs); window.addListener(new Window.CloseListener() { public void windowClosed(String actionId) { if (Window.COMMIT_ACTION_ID.equals(actionId) && window instanceof Window.Editor) { - Object item = ((Window.Editor) window).getItem(); - if (item instanceof Entity) { + Entity item = ((Window.Editor) window).getItem(); + if (item != null) { if (pDs == null) { - datasource.updateItem((Entity) item); + datasource.updateItem(item); } - afterCommit((Entity) item); + afterCommit(item); } } afterWindowClosed(window); diff --git a/modules/web/src/com/haulmont/cuba/web/gui/components/WebAbstractTable.java b/modules/web/src/com/haulmont/cuba/web/gui/components/WebAbstractTable.java index d93e039926..8fa6571887 100644 --- a/modules/web/src/com/haulmont/cuba/web/gui/components/WebAbstractTable.java +++ b/modules/web/src/com/haulmont/cuba/web/gui/components/WebAbstractTable.java @@ -49,6 +49,7 @@ import com.vaadin.server.Sizeable; import com.vaadin.ui.*; import com.vaadin.ui.Button; import com.vaadin.ui.Label; +import com.vaadin.ui.themes.BaseTheme; import org.apache.commons.lang.BooleanUtils; import org.apache.commons.lang.StringUtils; import org.dom4j.DocumentHelper; @@ -511,7 +512,7 @@ public abstract class WebAbstractTable extends We null : column.getXmlDescriptor().attributeValue("clickAction"); if (propertyPath.getRange().isClass()) { - if (!isLookup && !StringUtils.isEmpty(clickAction)) { + if (!isLookup && StringUtils.isNotEmpty(clickAction)) { addGeneratedColumn(propertyPath, new ReadOnlyAssociationGenerator(column)); } } else if (propertyPath.getRange().isDatatype()) { @@ -525,9 +526,9 @@ public abstract class WebAbstractTable extends We addGeneratedColumn(propertyPath, new ReadOnlyBooleanDatatypeGenerator()); } } - } else if (propertyPath.getRange().isEnum()) { + } /*else if (propertyPath.getRange().isEnum()) { // TODO (abramov) - } else { + }*/ else { throw new UnsupportedOperationException(); } } @@ -1134,7 +1135,7 @@ public abstract class WebAbstractTable extends We final com.vaadin.ui.Button component = new com.vaadin.ui.Button(); component.setData(value); component.setCaption(value == null ? "" : property.toString()); - component.setStyleName("link"); + component.setStyleName(BaseTheme.BUTTON_LINK); component.addClickListener(new com.vaadin.ui.Button.ClickListener() { @Override @@ -1150,7 +1151,6 @@ public abstract class WebAbstractTable extends We String screenName = clickAction.substring("open:".length()).trim(); final Window window = frame.openEditor(screenName, getItem(item, property), WindowManager.OpenType.THIS_TAB); - // todo use EditAction instead of this window.addListener(new Window.CloseListener() { @Override public void windowClosed(String actionId) { diff --git a/modules/web/themes/havana/components/button/button.scss b/modules/web/themes/havana/components/button/button.scss index b682b38128..4a59128af0 100644 --- a/modules/web/themes/havana/components/button/button.scss +++ b/modules/web/themes/havana/components/button/button.scss @@ -42,7 +42,7 @@ font-family: $theme_fonts; vertical-align: middle; white-space: nowrap; - color: #1E3146; + color: $theme_buttonCaptionColor; line-height: normal; } } diff --git a/modules/web/themes/havana/components/table/table.scss b/modules/web/themes/havana/components/table/table.scss index d58bcc8b8b..7ab12f2933 100644 --- a/modules/web/themes/havana/components/table/table.scss +++ b/modules/web/themes/havana/components/table/table.scss @@ -83,6 +83,12 @@ .#{$primaryStyleName}-cell-content { border-right-color: $theme_tableCellSeparatorColor; + + .v-button-caption, + .v-button-link .v-button-caption { + font-size: 11px; + color: $theme_buttonCaptionColor; + } } .#{$primaryStyleName}-cell-wrapper.widget-container { diff --git a/modules/web/themes/havana/havana-defaults.scss b/modules/web/themes/havana/havana-defaults.scss index 7273dabaeb..6c336f25a0 100644 --- a/modules/web/themes/havana/havana-defaults.scss +++ b/modules/web/themes/havana/havana-defaults.scss @@ -23,6 +23,7 @@ $theme_windowBorderColor: #8aa9d1; $theme_foldersPaneCaptionColor: #2B4766; $theme_buttonBorderColor: #9bb3d3; +$theme_buttonCaptionColor: #1e3146; $theme_fieldBorderColor: #a5c4e0; $theme_fieldFocusedBorderColor: #4d7ab2;