|
From: <vh...@us...> - 2013-03-27 23:30:41
|
Revision: 16172
http://unicore.svn.sourceforge.net/unicore/?rev=16172&view=rev
Author: vhuber
Date: 2013-03-27 23:30:31 +0000 (Wed, 27 Mar 2013)
Log Message:
-----------
Adjusted the resizing of the table column widths in the DataEndpoint Viewer.
Modified Paths:
--------------
unicore-portal/trunk/ui/src/main/java/eu/unicore/portal/ui/actions/VFSActionHandler.java
unicore-portal/trunk/ui/src/main/java/eu/unicore/portal/ui/viewers/DataEndpointViewer.java
Modified: unicore-portal/trunk/ui/src/main/java/eu/unicore/portal/ui/actions/VFSActionHandler.java
===================================================================
--- unicore-portal/trunk/ui/src/main/java/eu/unicore/portal/ui/actions/VFSActionHandler.java 2013-03-27 22:36:05 UTC (rev 16171)
+++ unicore-portal/trunk/ui/src/main/java/eu/unicore/portal/ui/actions/VFSActionHandler.java 2013-03-27 23:30:31 UTC (rev 16172)
@@ -55,19 +55,14 @@
{
return getFolderActions();
}
- else
- {
- return new Action[]{
- VFSAction.ACTION_NEW_FOLDER,
- VFSAction.ACTION_NEW_FILE,
- VFSAction.ACTION_REFRESH
- };
- }
} catch (FileSystemException e) {
e.printStackTrace();
- }
-
+ }
}
+ else
+ {
+ return getNullSelectionActions();
+ }
return null;
}
@@ -119,8 +114,14 @@
VFSAction.ACTION_DELETE };
}
+ public Action[] getNullSelectionActions() {
+ return new Action[]{
+ VFSAction.ACTION_NEW_FOLDER,
+ VFSAction.ACTION_NEW_FILE,
+ VFSAction.ACTION_REFRESH
+ };
+ }
-
public void rename(final FileObject file)
{
InputDialog input = new InputDialog(GlobalState.getMessage(UII18N.ID, "VFSAction.question"), //$NON-NLS-1$
Modified: unicore-portal/trunk/ui/src/main/java/eu/unicore/portal/ui/viewers/DataEndpointViewer.java
===================================================================
--- unicore-portal/trunk/ui/src/main/java/eu/unicore/portal/ui/viewers/DataEndpointViewer.java 2013-03-27 22:36:05 UTC (rev 16171)
+++ unicore-portal/trunk/ui/src/main/java/eu/unicore/portal/ui/viewers/DataEndpointViewer.java 2013-03-27 23:30:31 UTC (rev 16172)
@@ -73,8 +73,16 @@
public static final String PROP_SIZE = "Size"; //$NON-NLS-1$
public static final String PROP_MODIFIED = "Modified"; //$NON-NLS-1$
public static final String PROP_ACTIONS = "Actions"; //$NON-NLS-1$
- private Panel panel;
+ private static final int PROP_ACTIONS_WIDTH_PIXELS = 100;
+ private static final int PROP_MODIFIED_WIDTH_PIXELS = 110;
+ private static final int PROP_EXT_WIDTH_PIXELS = 15;
+ private static final int PROP_SIZE_WIDTH_PIXELS = 50;
+ private static final int PROP_NAME_MIN_WIDTH_PIXELS = 50;
+
+ private static final int TABLE_WIDTH_PIXELS = 550;
+ private static final int PAGE_LENGTH = 10;
+
public static final String[] cols = new String[]{
PROP_NAME, PROP_EXT, PROP_SIZE, PROP_MODIFIED, PROP_ACTIONS
};
@@ -87,6 +95,7 @@
private DataEndpoint endpoint;
private Table table;
private Hierarchical container;
+ private Panel tablePanel;
private FileName workingDir = null;
private VFSActionHandler actionHandler;
private HorizontalLayout menuBar;
@@ -100,12 +109,13 @@
table.setRowHeaderMode(RowHeaderMode.HIDDEN);
table.setImmediate(true);
- table.setColumnWidth(PROP_NAME, 150);
- table.setColumnWidth(PROP_EXT, 20);
- table.setColumnWidth(PROP_SIZE, 55);
- table.setColumnWidth(PROP_MODIFIED, 115);
-// table.setColumnWidth(PROP_ACTIONS, 100);
- table.setPageLength(10);
+ //table.setColumnWidth(PROP_NAME, 150);
+ table.setColumnWidth(PROP_EXT, PROP_EXT_WIDTH_PIXELS);
+ table.setColumnWidth(PROP_SIZE, PROP_SIZE_WIDTH_PIXELS);
+ table.setColumnWidth(PROP_MODIFIED, PROP_MODIFIED_WIDTH_PIXELS);
+ table.setColumnWidth(PROP_ACTIONS, PROP_ACTIONS_WIDTH_PIXELS);
+ table.setColumnExpandRatio(PROP_NAME, 1f);
+ table.setPageLength(PAGE_LENGTH);
table.setVisibleColumns(cols);
table.setSelectable(true);
table.setMultiSelect(true);
@@ -121,7 +131,7 @@
workingDirTextField = new TextField();
workingDirTextField.setImmediate(true);
- workingDirTextField.setWidth(550f, Unit.PIXELS);
+ workingDirTextField.setWidth(TABLE_WIDTH_PIXELS, Unit.PIXELS);
addComponent(workingDirTextField);
// TODO implement deserializeFrom() in the U6DataEndpoint
@@ -149,10 +159,10 @@
}
});
- panel = new Panel();
- panel.setContent(table);
- panel.setWidth(550f, Unit.PIXELS);
- addComponent(panel);
+ tablePanel = new Panel();
+ tablePanel.setContent(table);
+ tablePanel.setWidth(TABLE_WIDTH_PIXELS, Unit.PIXELS);
+ addComponent(tablePanel);
setImmediate(true);
@@ -178,7 +188,7 @@
public Component getComponent()
{
- return panel;
+ return tablePanel;
}
@@ -628,7 +638,8 @@
public void setSize(int width, int height) {
workingDirTextField.setWidth(width, Unit.PIXELS);
- getComponent().setWidth(width, Unit.PIXELS);
- getComponent().setHeight(height, Unit.PIXELS);
+ table.setWidth(width, Unit.PIXELS);
+ tablePanel.setWidth(width, Unit.PIXELS);
+ tablePanel.setHeight(height, Unit.PIXELS);
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|