From fb773be82454d1890bcd91acbd38769273614fba Mon Sep 17 00:00:00 2001 From: Giancarlo Panichi Date: Fri, 30 Jan 2015 11:12:22 +0000 Subject: [PATCH] Fixed Label lenght git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-extractcodelist-widget@111556 82a268e6-3cf1-43bd-a215-b396298e98cf --- .../client/ExtractCodelistDetailsCard.java | 20 +++++------ .../client/TargetColumnsSelectionPanel.java | 35 ++++++++++--------- 2 files changed, 27 insertions(+), 28 deletions(-) diff --git a/src/main/java/org/gcube/portlets/user/td/extractcodelistwidget/client/ExtractCodelistDetailsCard.java b/src/main/java/org/gcube/portlets/user/td/extractcodelistwidget/client/ExtractCodelistDetailsCard.java index ffd4b84..977bff2 100644 --- a/src/main/java/org/gcube/portlets/user/td/extractcodelistwidget/client/ExtractCodelistDetailsCard.java +++ b/src/main/java/org/gcube/portlets/user/td/extractcodelistwidget/client/ExtractCodelistDetailsCard.java @@ -8,6 +8,7 @@ import com.allen_sauer.gwt.log.client.Log; import com.google.gwt.user.client.Command; import com.google.gwt.user.client.ui.HorizontalPanel; import com.google.gwt.user.client.ui.VerticalPanel; +import com.sencha.gxt.core.client.util.Margins; import com.sencha.gxt.core.client.util.ToggleGroup; import com.sencha.gxt.widget.core.client.FramedPanel; import com.sencha.gxt.widget.core.client.box.AlertMessageBox; @@ -35,12 +36,9 @@ public class ExtractCodelistDetailsCard extends WizardCard { private static final String TABLEDETAILPANELWIDTH = "100%"; private static final String TABLEDETAILPANELHEIGHT = "100%"; private static final String FORMWIDTH = "538px"; - - - private static final int LABEL_WIDTH = 0; - - - private static final int LABEL_PAD_WIDTH = 0; + + private static final int LABEL_WIDTH = 128; + private static final int LABEL_PAD_WIDTH = 2; private ExtractCodelistSession extractCodelistSession; private ExtractCodelistDetailsCard thisCard; @@ -82,7 +80,7 @@ public class ExtractCodelistDetailsCard extends WizardCard { name.setAllowBlank(false); name.setEmptyText("Enter a name..."); name.setAllowBlank(false); - p.add(new FieldLabel(name, "Name"), new VerticalLayoutData(1, -1)); + p.add(new FieldLabel(name, "Name"), new VerticalLayoutData(1, -1,new Margins(0))); /// @@ -103,10 +101,10 @@ public class ExtractCodelistDetailsCard extends WizardCard { new ToolTip(automaticallyAttachPanel, new ToolTipConfig( "Automatically attach the generated codelist")); - FieldLabel fieldViewColumns=new FieldLabel(automaticallyAttachPanel, "Automatically Attach"); - fieldViewColumns.setLabelWidth(LABEL_WIDTH); - fieldViewColumns.setLabelPad(LABEL_PAD_WIDTH); - p.add(fieldViewColumns, new VerticalLayoutData(1, -1)); + FieldLabel fieldAttach=new FieldLabel(automaticallyAttachPanel, "Attach"); + fieldAttach.setLabelWidth(LABEL_WIDTH); + fieldAttach.setLabelPad(LABEL_PAD_WIDTH); + p.add(fieldAttach, new VerticalLayoutData(1, -1, new Margins(0))); tableDetailPanel.add(form); diff --git a/src/main/java/org/gcube/portlets/user/td/extractcodelistwidget/client/TargetColumnsSelectionPanel.java b/src/main/java/org/gcube/portlets/user/td/extractcodelistwidget/client/TargetColumnsSelectionPanel.java index 0079b00..a78933a 100644 --- a/src/main/java/org/gcube/portlets/user/td/extractcodelistwidget/client/TargetColumnsSelectionPanel.java +++ b/src/main/java/org/gcube/portlets/user/td/extractcodelistwidget/client/TargetColumnsSelectionPanel.java @@ -59,21 +59,22 @@ import com.sencha.gxt.widget.core.client.toolbar.ToolBar; public class TargetColumnsSelectionPanel extends FramedPanel implements CodelistSelectionListener { - protected static final String COMBO_COLUMN = "comboColumn"; - protected static final String COMBO_DEF_COLUMN = "comboDefColumn"; - protected static final String CHECK_NEW = "checkNew"; - protected static final String WIDTH = "526px"; - protected static final String HEIGHT = "378px"; - protected static final String FIELDWIDTH = "526px"; - protected static final String FIELDSHEIGHT = "336px"; - protected static final int LABELSIZE = 120; - protected static final int COMBOWIDTH = 270; + private static final String COMBO_COLUMN = "comboColumn"; + private static final String COMBO_DEF_COLUMN = "comboDefColumn"; + private static final String CHECK_NEW = "checkNew"; + private static final String WIDTH = "526px"; + private static final String HEIGHT = "378px"; + private static final String FIELDWIDTH = "526px"; + private static final String FIELDSHEIGHT = "336px"; + private static final int LABELSIZE = 120; + private static final int LABEL_SIZE_IN_CHAR = 17; + private static final int COMBOWIDTH = 270; - protected TargetColumnsSelectionCard parent; - protected TabResource connection; - protected ArrayList connectionColumns; + private TargetColumnsSelectionCard parent; + private TabResource connection; + private ArrayList connectionColumns; - protected ArrayList targetColumns; + private ArrayList targetColumns; private ToolBar toolBarHead; @@ -182,10 +183,10 @@ public class TargetColumnsSelectionPanel extends FramedPanel implements String label = new String(); if (sourceCol != null && sourceCol.getLabel() != null) { label = SafeHtmlUtils.htmlEscape(sourceCol.getLabel()); - if (label.length() > LABELSIZE - 1) { - label = label.substring(0, LABELSIZE - 3); - label += ".."; - } + if (label.length() > LABEL_SIZE_IN_CHAR + 2) { + label = label.substring(0, LABEL_SIZE_IN_CHAR); + label += "..."; + } } if (connection == null) {