Author: dongxu
Date: Thu Sep 12 03:52:07 2013
New Revision: 1522263

URL: http://svn.apache.org/r1522263
Log:
add enable tool bar buttons toggling event, with being related to issue #31

Modified:
    
james/hupa/trunk/client/src/main/java/org/apache/hupa/client/activity/ToolBarActivity.java
    
james/hupa/trunk/client/src/main/java/org/apache/hupa/client/ui/ToolBarView.java
    
james/hupa/trunk/client/src/main/java/org/apache/hupa/client/ui/ToolBarView.ui.xml

Modified: 
james/hupa/trunk/client/src/main/java/org/apache/hupa/client/activity/ToolBarActivity.java
URL: 
http://svn.apache.org/viewvc/james/hupa/trunk/client/src/main/java/org/apache/hupa/client/activity/ToolBarActivity.java?rev=1522263&r1=1522262&r2=1522263&view=diff
==============================================================================
--- 
james/hupa/trunk/client/src/main/java/org/apache/hupa/client/activity/ToolBarActivity.java
 (original)
+++ 
james/hupa/trunk/client/src/main/java/org/apache/hupa/client/activity/ToolBarActivity.java
 Thu Sep 12 03:52:07 2013
@@ -149,6 +149,10 @@ public class ToolBarActivity extends App
        }
 =======
 import org.apache.hupa.client.ui.WidgetDisplayable;
+import org.apache.hupa.shared.events.ExpandMessageEvent;
+import org.apache.hupa.shared.events.ExpandMessageEventHandler;
+import org.apache.hupa.shared.events.LoadMessagesEvent;
+import org.apache.hupa.shared.events.LoadMessagesEventHandler;
 
 import com.google.gwt.event.shared.EventBus;
 import com.google.gwt.user.client.ui.AcceptsOneWidget;
@@ -156,13 +160,40 @@ import com.google.inject.Inject;
 
 public class ToolBarActivity extends AppBaseActivity {
 
+       @Inject private Displayable display;
+
        @Override
        public void start(AcceptsOneWidget container, EventBus eventBus) {
                container.setWidget(display.asWidget());
+               bindTo(eventBus);
        }
 
+<<<<<<< HEAD
        @Inject private Displayable display;
        
        public interface Displayable extends WidgetDisplayable {}
 >>>>>>> integrate all of the views to their corresponding activities and 
 >>>>>>> mappers
+=======
+       private void bindTo(EventBus eventBus) {
+               eventBus.addHandler(LoadMessagesEvent.TYPE,
+                               new LoadMessagesEventHandler() {
+                                       public void onLoadMessagesEvent(
+                                                       LoadMessagesEvent 
loadMessagesEvent) {
+                                               display.disableMessageTools();
+                                       }
+                               });
+               eventBus.addHandler(ExpandMessageEvent.TYPE,
+                               new ExpandMessageEventHandler() {
+                                       public void 
onExpandMessage(ExpandMessageEvent event) {
+                                               display.enableMessageTools();
+                                       }
+                               });
+       }
+
+       public interface Displayable extends WidgetDisplayable {
+               void disableMessageTools();
+
+               void enableMessageTools();
+       }
+>>>>>>> add enable tool bar buttons toggling event, with being related to 
issue #31
 }

Modified: 
james/hupa/trunk/client/src/main/java/org/apache/hupa/client/ui/ToolBarView.java
URL: 
http://svn.apache.org/viewvc/james/hupa/trunk/client/src/main/java/org/apache/hupa/client/ui/ToolBarView.java?rev=1522263&r1=1522262&r2=1522263&view=diff
==============================================================================
--- 
james/hupa/trunk/client/src/main/java/org/apache/hupa/client/ui/ToolBarView.java
 (original)
+++ 
james/hupa/trunk/client/src/main/java/org/apache/hupa/client/ui/ToolBarView.java
 Thu Sep 12 03:52:07 2013
@@ -331,20 +331,54 @@ import com.google.gwt.uibinder.client.Ui
 import com.google.gwt.user.client.ui.Anchor;
 import com.google.gwt.user.client.ui.Composite;
 import com.google.gwt.user.client.ui.FlowPanel;
+import com.google.gwt.user.client.ui.HTMLPanel;
 
 public class ToolBarView extends Composite implements
                ToolBarActivity.Displayable {
 
-       @UiField Anchor reply;
        @UiField Style style;
 
+       @UiField Anchor refresh;
+       @UiField Anchor compose;
+       @UiField Anchor reply;
+       @UiField HTMLPanel replyAllGroup;
+       @UiField Anchor replyAll;
+       @UiField HTMLPanel forwardGroup;
+       @UiField Anchor forward;
+       @UiField Anchor delete;
+       @UiField Anchor mark;
+       @UiField Anchor more;
+
        public ToolBarView() {
                initWidget(binder.createAndBindUi(this));
 <<<<<<< HEAD
+<<<<<<< HEAD
 >>>>>>> make login page as one part of the overall layout & splite layout to 
 >>>>>>> little one
 =======
                reply.addStyleName(style.disabledButton());
 >>>>>>> dynamical style tool bar
+=======
+       }
+
+       interface Style extends CssResource {
+               String disabledButton();
+       }
+
+       @Override
+       public void disableMessageTools() {
+               reply.addStyleName(style.disabledButton());
+               replyAllGroup.addStyleName(style.disabledButton());
+               forwardGroup.addStyleName(style.disabledButton());
+               delete.addStyleName(style.disabledButton());
+       }
+
+       @Override
+       public void enableMessageTools() {
+               reply.removeStyleName(style.disabledButton());
+               replyAllGroup.removeStyleName(style.disabledButton());
+               forwardGroup.removeStyleName(style.disabledButton());
+               delete.removeStyleName(style.disabledButton());
+>>>>>>> add enable tool bar buttons toggling event, with being related to 
issue #31
        }
 
        interface ToolBarUiBinder extends UiBinder<FlowPanel, ToolBarView> {
@@ -354,6 +388,7 @@ public class ToolBarView extends Composi
 
 <<<<<<< HEAD
 <<<<<<< HEAD
+<<<<<<< HEAD
        @Override
        public HasClickHandlers getRefresh() {
                return refresh;
@@ -366,4 +401,6 @@ public class ToolBarView extends Composi
        }
 
 >>>>>>> dynamical style tool bar
+=======
+>>>>>>> add enable tool bar buttons toggling event, with being related to 
issue #31
 }

Modified: 
james/hupa/trunk/client/src/main/java/org/apache/hupa/client/ui/ToolBarView.ui.xml
URL: 
http://svn.apache.org/viewvc/james/hupa/trunk/client/src/main/java/org/apache/hupa/client/ui/ToolBarView.ui.xml?rev=1522263&r1=1522262&r2=1522263&view=diff
==============================================================================
--- 
james/hupa/trunk/client/src/main/java/org/apache/hupa/client/ui/ToolBarView.ui.xml
 (original)
+++ 
james/hupa/trunk/client/src/main/java/org/apache/hupa/client/ui/ToolBarView.ui.xml
 Thu Sep 12 03:52:07 2013
@@ -276,6 +276,7 @@
 
        <g:FlowPanel addStyleNames="{style.bar}" ui:field="ToolBar">
 <<<<<<< HEAD
+<<<<<<< HEAD
                <g:Anchor ui:field="refresh" addStyleNames="{style.button} 
{style.checkMail} {style.handCursor}">Refresh</g:Anchor>
                <g:Anchor ui:field="compose" addStyleNames="{style.button} 
{style.compose} {style.handCursor}">Compose</g:Anchor>
                <g:HTMLPanel tag="span" 
addStyleNames="{style.spacer}"></g:HTMLPanel>
@@ -302,17 +303,22 @@
 =======
                <g:Anchor addStyleNames="{style.button} 
{style.checkMail}">Refresh</g:Anchor>
                <g:Anchor addStyleNames="{style.button} 
{style.compose}">Compose</g:Anchor>
+=======
+               <g:Anchor ui:field="refresh" addStyleNames="{style.button} 
{style.checkMail}">Refresh</g:Anchor>
+               <g:Anchor ui:field="compose" addStyleNames="{style.button} 
{style.compose}">Compose</g:Anchor>
+>>>>>>> add enable tool bar buttons toggling event, with being related to 
issue #31
                <g:HTMLPanel tag="span" 
addStyleNames="{style.spacer}"></g:HTMLPanel>
                <g:Anchor ui:field="reply" addStyleNames="{style.button} 
{style.reply} {style.disabledButton}">Reply</g:Anchor>
-               <g:HTMLPanel tag="span" addStyleNames="{style.dropButton} 
{style.disabledButton}">
-                       <g:Anchor addStyleNames="{style.button} 
{style.replyAll}">Reply all</g:Anchor>
+               <g:HTMLPanel ui:field="replyAllGroup" tag="span" 
addStyleNames="{style.dropButton} {style.disabledButton}">
+                       <g:Anchor ui:field="replyAll" 
addStyleNames="{style.button} {style.replyAll}">Reply all</g:Anchor>
                        <g:HTMLPanel tag="span" 
addStyleNames="{style.dropButtonTip}"></g:HTMLPanel>
                </g:HTMLPanel>
-               <g:HTMLPanel tag="span" addStyleNames="{style.dropButton} 
{style.disabledButton}">
-                       <g:Anchor addStyleNames="{style.button} 
{style.forward}">Forward</g:Anchor>
+               <g:HTMLPanel ui:field="forwardGroup" tag="span" 
addStyleNames="{style.dropButton} {style.disabledButton}">
+                       <g:Anchor ui:field="forward" 
addStyleNames="{style.button} {style.forward}">Forward</g:Anchor>
                        <g:HTMLPanel tag="span" 
addStyleNames="{style.dropButtonTip}"></g:HTMLPanel>
                </g:HTMLPanel>
 <<<<<<< HEAD
+<<<<<<< HEAD
                <g:Anchor addStyleNames="{style.button} 
{style.delete}">Delete</g:Anchor>
                <g:Anchor addStyleNames="{style.button} 
{style.mark}">Mark</g:Anchor>
                <g:Anchor addStyleNames="{style.button} 
{style.more}">More</g:Anchor>
@@ -322,5 +328,10 @@
                <g:Anchor addStyleNames="{style.button} {style.mark} 
{style.disabledButton}">Mark</g:Anchor>
                <g:Anchor addStyleNames="{style.button} {style.more} 
{style.disabledButton}">More</g:Anchor>
 >>>>>>> dynamical style tool bar
+=======
+               <g:Anchor ui:field="delete" addStyleNames="{style.button} 
{style.delete} {style.disabledButton}">Delete</g:Anchor>
+               <g:Anchor ui:field="mark" addStyleNames="{style.button} 
{style.mark} {style.disabledButton}">Mark</g:Anchor>
+               <g:Anchor ui:field="more" addStyleNames="{style.button} 
{style.more} {style.disabledButton}">More</g:Anchor>
+>>>>>>> add enable tool bar buttons toggling event, with being related to 
issue #31
        </g:FlowPanel>
 </ui:UiBinder>
\ No newline at end of file



---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org
For additional commands, e-mail: server-dev-h...@james.apache.org

Reply via email to