256: Workspace explorer

Task-Url: https://support.d4science.org/issues/256

Several refactor

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/widgets/workspace-explorer@115509 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Francesco Mangiacrapa 2015-06-24 13:18:42 +00:00
parent 45dfe0dd75
commit 5f13fb67ee
7 changed files with 19 additions and 19 deletions

View File

@ -1,6 +1,6 @@
package org.gcube.portlets.widgets.wsexplorer.client;
public class WorkspaceNavigatorConstants {
public class WorkspaceExplorerConstants {
public static final String SPECIAL_FOLDERS_LABEL = "MySpecialFolders";
public static final String VRE_FOLDERS_LABEL = "My VRE Folders";

View File

@ -19,25 +19,25 @@ import com.google.gwt.user.client.ui.HorizontalPanel;
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
* Jun 24, 2015
*/
public class WorkspaceNavigatorDialog extends DialogBox implements ClickHandler {
public class WorkspaceExplorerDialog extends DialogBox implements ClickHandler {
/**
*
*/
private Button cancel;
private WorkspaceNavigatorDialog INSTANCE = this;
private WorkspaceExplorerDialog INSTANCE = this;
private boolean isValidHide;
private String captionTxt;
private WorkspaceNavigatorPanel wsp = new WorkspaceNavigatorPanel(5);
private WorkspaceExplorerPanel wsp = new WorkspaceExplorerPanel(5);
/**
* Instantiates a new worspace navigator dialog.
*
* @param captionTxt sets the text inside the caption, if null sets "Workspace Explorer"
*/
public WorkspaceNavigatorDialog(String captionTxt) {
this.captionTxt = (captionTxt==null || captionTxt.isEmpty())?WorkspaceNavigatorConstants.WORKSPACE_EXPLORER_CAPTION:captionTxt;
public WorkspaceExplorerDialog(String captionTxt) {
this.captionTxt = (captionTxt==null || captionTxt.isEmpty())?WorkspaceExplorerConstants.WORKSPACE_EXPLORER_CAPTION:captionTxt;
setText(this.captionTxt);
isValidHide = false;
cancel = new Button("Close");

View File

@ -5,7 +5,7 @@ package org.gcube.portlets.widgets.wsexplorer.client;
import org.gcube.portlets.widgets.wsexplorer.client.view.Breadcrumbs;
import org.gcube.portlets.widgets.wsexplorer.client.view.Navigation;
import org.gcube.portlets.widgets.wsexplorer.client.view.WorkspaceNavigator;
import org.gcube.portlets.widgets.wsexplorer.client.view.WorkspaceExplorer;
import com.google.gwt.user.client.ui.DockPanel;
import com.google.gwt.user.client.ui.ScrollPanel;
@ -17,7 +17,7 @@ import com.google.gwt.user.client.ui.ScrollPanel;
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
* Jun 23, 2015
*/
public class WorkspaceNavigatorPanel extends DockPanel{
public class WorkspaceExplorerPanel extends DockPanel{
public int width = 550;
public int height = 400;
@ -27,11 +27,11 @@ public class WorkspaceNavigatorPanel extends DockPanel{
private ScrollPanel centerScrollable = new ScrollPanel();
private Breadcrumbs breadcrumbs = new Breadcrumbs();
private Navigation navigation = new Navigation();
private WorkspaceNavigator wsExplorer = new WorkspaceNavigator();
private WorkspaceExplorer wsExplorer = new WorkspaceExplorer();
/**
* Instantiates a new split panel.
*/
public WorkspaceNavigatorPanel(int splitterSize) {
public WorkspaceExplorerPanel(int splitterSize) {
// setStyleName("cw-DockPanel");
ensureDebugId("WorkspaceNavigatorPanel");
setSpacing(4);

View File

@ -3,7 +3,7 @@
*/
package org.gcube.portlets.widgets.wsexplorer.client.view;
import org.gcube.portlets.widgets.wsexplorer.client.WorkspaceNavigatorConstants;
import org.gcube.portlets.widgets.wsexplorer.client.WorkspaceExplorerConstants;
import com.github.gwtbootstrap.client.ui.NavWidget;
import com.github.gwtbootstrap.client.ui.constants.IconType;
@ -45,11 +45,11 @@ public class Navigation extends Composite{
initWidget(uiBinder.createAndBindUi(this));
getElement().getStyle().setMarginLeft(5.0, Unit.PX);
home.setActive(true);
home.setText(WorkspaceNavigatorConstants.HOME_LABEL);
home.setText(WorkspaceExplorerConstants.HOME_LABEL);
home.setIcon(IconType.HOME);
vre_folder.setActive(true);
vre_folder.setText(WorkspaceNavigatorConstants.VRE_FOLDERS_LABEL);
vre_folder.setText(WorkspaceExplorerConstants.VRE_FOLDERS_LABEL);
vre_folder.setIcon(IconType.FOLDER_OPEN_ALT);
}
}

View File

@ -22,7 +22,7 @@ import com.google.gwt.user.client.ui.ScrollPanel;
/**
* Entry point classes define <code>onModuleLoad()</code>.
*/
public class WorkspaceNavigator {
public class WorkspaceExplorer {
private final WorkspaceExplorerServiceAsync workspaceNavigatorService = GWT.create(WorkspaceExplorerService.class);
protected static final HorizontalPanel LOADING_PANEL = new HorizontalPanel();
@ -44,7 +44,7 @@ public class WorkspaceNavigator {
protected ScrollPanel explorerPanel;
public WorkspaceNavigator() {
public WorkspaceExplorer() {
// as default all items are showable and selectable
for (ItemType type : ItemType.values()) {
showableTypes.add(type);

View File

@ -15,7 +15,7 @@ import org.gcube.common.homelibrary.home.workspace.WorkspaceItem;
import org.gcube.common.homelibrary.home.workspace.folder.FolderItem;
import org.gcube.common.homelibrary.home.workspace.folder.items.ExternalFile;
import org.gcube.portlets.widgets.wsexplorer.client.Util;
import org.gcube.portlets.widgets.wsexplorer.client.WorkspaceNavigatorConstants;
import org.gcube.portlets.widgets.wsexplorer.client.WorkspaceExplorerConstants;
import org.gcube.portlets.widgets.wsexplorer.shared.FilterCriteria;
import org.gcube.portlets.widgets.wsexplorer.shared.Item;
import org.gcube.portlets.widgets.wsexplorer.shared.ItemType;
@ -69,7 +69,7 @@ public class ItemBuilder {
// Item item = new Item(parent, workspaceItem.getId(), workspaceItem.getName(), type, workspaceItem.getPath());
String itemName = workspaceItem.getName();
if ( workspaceItem.getName().equals(WorkspaceNavigatorConstants.SPECIAL_FOLDERS_LABEL)) {
if ( workspaceItem.getName().equals(WorkspaceExplorerConstants.SPECIAL_FOLDERS_LABEL)) {
itemName = "My VRE Folders";
}

View File

@ -6,7 +6,7 @@ package org.gcube.portlets.widgets.wsexplorer.server;
import java.util.Comparator;
import org.gcube.portlets.widgets.wsexplorer.client.Util;
import org.gcube.portlets.widgets.wsexplorer.client.WorkspaceNavigatorConstants;
import org.gcube.portlets.widgets.wsexplorer.client.WorkspaceExplorerConstants;
import org.gcube.portlets.widgets.wsexplorer.shared.Item;
@ -35,6 +35,6 @@ public class ItemComparator implements Comparator<Item> {
}
private boolean isSpecialFolder(Item item) {
return item.getName().equals(WorkspaceNavigatorConstants.VRE_FOLDERS_LABEL);
return item.getName().equals(WorkspaceExplorerConstants.VRE_FOLDERS_LABEL);
}
}