|
From: <jbo...@li...> - 2006-06-08 18:29:07
|
Author: szimano Date: 2006-06-08 14:28:54 -0400 (Thu, 08 Jun 2006) New Revision: 4677 Added: labs/jbosslabs/trunk/portal-extensions/forge-tagme/src/java/org/jboss/labs/tagme/gwt/client/DeleteTagClickListener.java labs/jbosslabs/trunk/portal-extensions/forge-tagme/src/web/images/ labs/jbosslabs/trunk/portal-extensions/forge-tagme/src/web/images/delete.gif Log: delete + images JBLAB-674 Added: labs/jbosslabs/trunk/portal-extensions/forge-tagme/src/java/org/jboss/labs/tagme/gwt/client/DeleteTagClickListener.java =================================================================== --- labs/jbosslabs/trunk/portal-extensions/forge-tagme/src/java/org/jboss/labs/tagme/gwt/client/DeleteTagClickListener.java 2006-06-08 18:25:16 UTC (rev 4676) +++ labs/jbosslabs/trunk/portal-extensions/forge-tagme/src/java/org/jboss/labs/tagme/gwt/client/DeleteTagClickListener.java 2006-06-08 18:28:54 UTC (rev 4677) @@ -0,0 +1,79 @@ +/* + * JBoss, Home of Professional Open Source + * Copyright 2005, JBoss Inc., and individual contributors as indicated + * by the @authors tag. See the copyright.txt in the distribution for a + * full listing of individual contributors. + * + * This is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation; either version 2.1 of + * the License, or (at your option) any later version. + * + * This software is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this software; if not, write to the Free + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. + */ +package org.jboss.labs.tagme.gwt.client; + +import com.google.gwt.core.client.GWT; +import com.google.gwt.user.client.Window; +import com.google.gwt.user.client.rpc.AsyncCallback; +import com.google.gwt.user.client.rpc.ServiceDefTarget; +import com.google.gwt.user.client.ui.ClickListener; +import com.google.gwt.user.client.ui.Widget; + +public class DeleteTagClickListener implements ClickListener { + + private String user; + + private String tag; + + private String path; + + private TagMeShowPopupListener parent; + + private String clas; + + public DeleteTagClickListener(String currentUser, String tag, String path, + TagMeShowPopupListener parent, String clas) { + this.path = path; + this.tag = tag; + this.user = currentUser; + this.parent = parent; + this.clas = clas; + } + + public void onClick(Widget sender) { + if (Window.confirm("Are you sure to delete tag '" + tag + "' ?")) { + TaggingServiceAsync tagging = (TaggingServiceAsync) GWT + .create(TaggingService.class); + + ServiceDefTarget endpoint = (ServiceDefTarget) tagging; + endpoint.setServiceEntryPoint("/tagme-servlet/tag/"); + + AsyncCallback callback = new AsyncCallback() { + + public void onSuccess(Object result) { + parent.refreshTags(); + parent.stopProgressAnim("Tag deleted"); + } + + public void onFailure(Throwable caught) { + Window.alert("Error: " + caught.getMessage()); + parent.stopProgressAnim("Error while deleting tag"); + } + + }; + + tagging.deleteTag(user, path, clas, tag, callback); + parent.startProgressAnim("Deleting tag"); + } + } + +} Added: labs/jbosslabs/trunk/portal-extensions/forge-tagme/src/web/images/delete.gif =================================================================== (Binary files differ) Property changes on: labs/jbosslabs/trunk/portal-extensions/forge-tagme/src/web/images/delete.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream |