From 01bd6099a7a9e2b870b73fc5ddce31e60f9ffd35 Mon Sep 17 00:00:00 2001 From: Christos Stathis Date: Wed, 9 May 2012 16:07:39 +0300 Subject: [PATCH] Remove permission button replaced by a link (issue #2373) --- .../grnet/pithos/web/client/PermissionsList.java | 6 ++- src/gr/grnet/pithos/web/client/Pithos.css | 39 ++++++++++++++++++++ src/gr/grnet/pithos/web/client/Pithos.java | 16 ++++++++ 3 files changed, 59 insertions(+), 2 deletions(-) create mode 100644 src/gr/grnet/pithos/web/client/Pithos.css diff --git a/src/gr/grnet/pithos/web/client/PermissionsList.java b/src/gr/grnet/pithos/web/client/PermissionsList.java index c7e58d2..7d89e5c 100644 --- a/src/gr/grnet/pithos/web/client/PermissionsList.java +++ b/src/gr/grnet/pithos/web/client/PermissionsList.java @@ -45,6 +45,7 @@ import com.google.gwt.event.logical.shared.ValueChangeEvent; import com.google.gwt.event.logical.shared.ValueChangeHandler; import com.google.gwt.user.client.Command; import com.google.gwt.user.client.ui.AbstractImagePrototype; +import com.google.gwt.user.client.ui.Anchor; import com.google.gwt.user.client.ui.CheckBox; import com.google.gwt.user.client.ui.Composite; import com.google.gwt.user.client.ui.FlexTable; @@ -164,7 +165,9 @@ public class PermissionsList extends Composite { changePermissionsCallback.execute(); } }); - PushButton removeButton = new PushButton(AbstractImagePrototype.create(images.delete()).createImage(), new ClickHandler() { + Anchor removeButton = new Anchor("remove"); + removeButton.addStyleName(Pithos.resources.pithosCss().commandAnchor()); + removeButton.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { permissions.remove(user); @@ -174,7 +177,6 @@ public class PermissionsList extends Composite { changePermissionsCallback.execute(); } }); - removeButton.setTitle("Remove"); permTable.setWidget(i, 3, removeButton); permTable.getFlexCellFormatter().setHorizontalAlignment(i, 3, HasHorizontalAlignment.ALIGN_CENTER); } diff --git a/src/gr/grnet/pithos/web/client/Pithos.css b/src/gr/grnet/pithos/web/client/Pithos.css new file mode 100644 index 0000000..5270b2a --- /dev/null +++ b/src/gr/grnet/pithos/web/client/Pithos.css @@ -0,0 +1,39 @@ +/* + * Copyright 2011-2012 GRNET S.A. All rights reserved. + * + * Redistribution and use in source and binary forms, with or + * without modification, are permitted provided that the following + * conditions are met: + * + * 1. Redistributions of source code must retain the above + * copyright notice, this list of conditions and the following + * disclaimer. + * + * 2. Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY GRNET S.A. ``AS IS'' AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GRNET S.A OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and + * documentation are those of the authors and should not be + * interpreted as representing official policies, either expressed + * or implied, of GRNET S.A. + */ + +.commandAnchor { + color: #4085A5; + text-decoration: underline; +} diff --git a/src/gr/grnet/pithos/web/client/Pithos.java b/src/gr/grnet/pithos/web/client/Pithos.java index 7ab8f91..382169a 100644 --- a/src/gr/grnet/pithos/web/client/Pithos.java +++ b/src/gr/grnet/pithos/web/client/Pithos.java @@ -34,6 +34,7 @@ */ package gr.grnet.pithos.web.client; +import gr.grnet.pithos.web.client.PithosDisclosurePanel.Style; import gr.grnet.pithos.web.client.commands.UploadFileCommand; import gr.grnet.pithos.web.client.foldertree.AccountResource; import gr.grnet.pithos.web.client.foldertree.File; @@ -82,7 +83,10 @@ import com.google.gwt.json.client.JSONObject; import com.google.gwt.json.client.JSONParser; import com.google.gwt.json.client.JSONString; import com.google.gwt.json.client.JSONValue; +import com.google.gwt.resources.client.ClientBundle; +import com.google.gwt.resources.client.CssResource; import com.google.gwt.resources.client.ImageResource; +import com.google.gwt.resources.client.ClientBundle.Source; import com.google.gwt.resources.client.ImageResource.ImageOptions; import com.google.gwt.user.client.Command; import com.google.gwt.user.client.Cookies; @@ -114,6 +118,17 @@ public class Pithos implements EntryPoint, ResizeHandler { public static final Configuration config = GWT.create(Configuration.class); + public interface Style extends CssResource { + String commandAnchor(); + } + + public interface Resources extends ClientBundle { + @Source("Pithos.css") + Style pithosCss(); + } + + public static Resources resources = GWT.create(Resources.class); + /** * Instantiate an application-level image bundle. This object will provide * programmatic access to all the images needed by widgets. @@ -264,6 +279,7 @@ public class Pithos implements EntryPoint, ResizeHandler { } private void initialize() { + resources.pithosCss().ensureInjected(); boolean bareContent = Window.Location.getParameter("noframe") != null; String contentWidth = bareContent ? "100%" : "75%"; -- 1.7.10.4