256: Workspace explorer
Task-Url: https://support.d4science.org/issues/256 Fixed css to save panel git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/widgets/workspace-explorer@117618 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
5c37bc3b80
commit
ebbe65055a
|
@ -115,11 +115,10 @@ public class Util {
|
|||
return "";
|
||||
}
|
||||
|
||||
public static void adjustSize(Element el, SimplePanel panel){
|
||||
public static void adjustSize(Element el, SimplePanel panel, int offset){
|
||||
if(el!=null){
|
||||
int heigth = el.getClientHeight();
|
||||
GWT.log("getClientHeight adjustSize el: "+heigth);
|
||||
int offset = 85;
|
||||
heigth = (heigth-offset>100)?heigth-offset:0;
|
||||
if(heigth>0){
|
||||
GWT.log("set new Explorer size: "+heigth);
|
||||
|
|
|
@ -47,9 +47,9 @@ public class WorkspaceExplorerSavePanel extends ScrollPanel implements HasWorskp
|
|||
private boolean isSave = false;
|
||||
private WorkspaceExplorerController controller;
|
||||
private List<WorskpaceExplorerSaveNotificationListener> listeners = new ArrayList<WorskpaceExplorerSaveNotificationListener>();
|
||||
private TextBox fileNameTextBox = new TextBox();
|
||||
private TextBox fileNamePanelTextBox = new TextBox();
|
||||
private VerticalPanel mainVP = new VerticalPanel();
|
||||
private HorizontalPanel footerHP = new HorizontalPanel();
|
||||
private HorizontalPanel footerPanelHP = new HorizontalPanel();
|
||||
|
||||
|
||||
/**
|
||||
|
@ -131,7 +131,7 @@ public class WorkspaceExplorerSavePanel extends ScrollPanel implements HasWorskp
|
|||
|
||||
private void adjustSize(){
|
||||
if(this.getParent()!=null && this.getParent().getElement()!=null)
|
||||
Util.adjustSize(this.getParent().getElement(), controller.getWsExplorer().getPanel());
|
||||
Util.adjustSize(this.getParent().getElement(), controller.getWsExplorer().getPanel(), 120);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -170,7 +170,7 @@ public class WorkspaceExplorerSavePanel extends ScrollPanel implements HasWorskp
|
|||
String fileName = getFileName();
|
||||
if(fileName==null || fileName.isEmpty()){
|
||||
Window.alert("You must insert a valid file name!! It cannot be empty!!");
|
||||
fileNameTextBox.setFocus(true);
|
||||
fileNamePanelTextBox.setFocus(true);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -188,20 +188,20 @@ public class WorkspaceExplorerSavePanel extends ScrollPanel implements HasWorskp
|
|||
}
|
||||
});
|
||||
|
||||
fileNameTextBox.addStyleName("fileNameTextBox");
|
||||
fileNameTextBox.setAlignment(TextAlignment.LEFT);
|
||||
fileNamePanelTextBox.addStyleName("fileNamePanelTextBox");
|
||||
fileNamePanelTextBox.setAlignment(TextAlignment.LEFT);
|
||||
setFileName(fileName);
|
||||
|
||||
HTML name = new HTML("Name:");
|
||||
name.addStyleName("htmlSaveName");
|
||||
name.getElement().getStyle().setPaddingTop(7.0, Unit.PX);
|
||||
footerHP.add(name);
|
||||
footerHP.add(fileNameTextBox);
|
||||
footerHP.add(saveButton);
|
||||
footerHP.addStyleName("footerHP");
|
||||
footerPanelHP.add(name);
|
||||
footerPanelHP.add(fileNamePanelTextBox);
|
||||
footerPanelHP.add(saveButton);
|
||||
footerPanelHP.addStyleName("footerPanelHP");
|
||||
|
||||
mainVP.add(controller.getWorkspaceExplorerPanel());
|
||||
mainVP.add(footerHP);
|
||||
mainVP.add(footerPanelHP);
|
||||
|
||||
add(mainVP);
|
||||
addHandlers();
|
||||
|
@ -225,8 +225,8 @@ public class WorkspaceExplorerSavePanel extends ScrollPanel implements HasWorskp
|
|||
|
||||
Scheduler.get().scheduleDeferred(new Scheduler.ScheduledCommand () {
|
||||
public void execute () {
|
||||
fileNameTextBox.selectAll();
|
||||
fileNameTextBox.setFocus(true);
|
||||
fileNamePanelTextBox.selectAll();
|
||||
fileNamePanelTextBox.setFocus(true);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -240,7 +240,7 @@ public class WorkspaceExplorerSavePanel extends ScrollPanel implements HasWorskp
|
|||
if(txt==null)
|
||||
return;
|
||||
|
||||
fileNameTextBox.setValue(txt);
|
||||
fileNamePanelTextBox.setValue(txt);
|
||||
}
|
||||
|
||||
|
||||
|
@ -250,7 +250,7 @@ public class WorkspaceExplorerSavePanel extends ScrollPanel implements HasWorskp
|
|||
* @return the file name
|
||||
*/
|
||||
private String getFileName(){
|
||||
return fileNameTextBox.getValue();
|
||||
return fileNamePanelTextBox.getValue();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -102,7 +102,7 @@ public class WorkspaceExplorerSelectPanel extends ScrollPanel implements HasWors
|
|||
|
||||
private void adjustSize(){
|
||||
if(this.getParent()!=null && this.getParent().getElement()!=null)
|
||||
Util.adjustSize(this.getParent().getElement(), controller.getWsExplorer().getPanel());
|
||||
Util.adjustSize(this.getParent().getElement(), controller.getWsExplorer().getPanel(), 85);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -1258,6 +1258,20 @@ a:hover, a:focus {
|
|||
float: right;
|
||||
}
|
||||
|
||||
.fileNamePanelTextBox{
|
||||
vertical-align: top !important;
|
||||
margin-right: 10px;
|
||||
margin-left: 5px;
|
||||
width: 570px;
|
||||
font-size: 13px !important;
|
||||
height: 24px;
|
||||
}
|
||||
|
||||
.footerPanelHP{
|
||||
margin-top: 5px !important;
|
||||
float: right;
|
||||
}
|
||||
|
||||
.htmlSaveName {
|
||||
display: inline;
|
||||
font-size: 14px;
|
||||
|
@ -1266,6 +1280,6 @@ a:hover, a:focus {
|
|||
}
|
||||
|
||||
.savePanel{
|
||||
border: 1px solid;
|
||||
/*border: 1px solid;*/
|
||||
padding-left: 25px;
|
||||
}
|
Loading…
Reference in New Issue