Author: norman
Date: Wed Aug 12 13:40:22 2009
New Revision: 803506
URL: http://svn.apache.org/viewvc?rev=803506&view=rev
Log:
Start to add dialogbox
Added:
labs/hupa/src/main/java/org/apache/hupa/client/widgets/HasDialog.java
labs/hupa/src/main/java/org/apache/hupa/client/widgets/QuestionDialogBox.java
Modified:
labs/hupa/src/main/java/org/apache/hupa/client/HupaConstants.java
labs/hupa/src/main/java/org/apache/hupa/client/HupaConstants.properties
Modified: labs/hupa/src/main/java/org/apache/hupa/client/HupaConstants.java
URL:
http://svn.apache.org/viewvc/labs/hupa/src/main/java/org/apache/hupa/client/HupaConstants.java?rev=803506&r1=803505&r2=803506&view=diff
==============================================================================
--- labs/hupa/src/main/java/org/apache/hupa/client/HupaConstants.java (original)
+++ labs/hupa/src/main/java/org/apache/hupa/client/HupaConstants.java Wed Aug
12 13:40:22 2009
@@ -73,4 +73,8 @@
public String forwardMailButton();
public String loading();
+
+ public String okButton();
+
+ public String cancelButton();
}
Modified:
labs/hupa/src/main/java/org/apache/hupa/client/HupaConstants.properties
URL:
http://svn.apache.org/viewvc/labs/hupa/src/main/java/org/apache/hupa/client/HupaConstants.properties?rev=803506&r1=803505&r2=803506&view=diff
==============================================================================
--- labs/hupa/src/main/java/org/apache/hupa/client/HupaConstants.properties
(original)
+++ labs/hupa/src/main/java/org/apache/hupa/client/HupaConstants.properties Wed
Aug 12 13:40:22 2009
@@ -24,4 +24,6 @@
attachments=Attachments
sendButton=Send
forwardMailButton=Forward
-loading=Loading
\ No newline at end of file
+loading=Loading
+okButton=Ok
+cancelButton=Cancel
\ No newline at end of file
Added: labs/hupa/src/main/java/org/apache/hupa/client/widgets/HasDialog.java
URL:
http://svn.apache.org/viewvc/labs/hupa/src/main/java/org/apache/hupa/client/widgets/HasDialog.java?rev=803506&view=auto
==============================================================================
--- labs/hupa/src/main/java/org/apache/hupa/client/widgets/HasDialog.java
(added)
+++ labs/hupa/src/main/java/org/apache/hupa/client/widgets/HasDialog.java Wed
Aug 12 13:40:22 2009
@@ -0,0 +1,26 @@
+/****************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one *
+ * or more contributor license agreements. See the NOTICE file *
+ * distributed with this work for additional information *
+ * regarding copyright ownership. The ASF licenses this file *
+ * to you under the Apache License, Version 2.0 (the *
+ * "License"); you may not use this file except in compliance *
+ * with the License. You may obtain a copy of the License at *
+ * *
+ * http://www.apache.org/licenses/LICENSE-2.0 *
+ * *
+ * Unless required by applicable law or agreed to in writing, *
+ * software distributed under the License is distributed on an *
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY *
+ * KIND, either express or implied. See the License for the *
+ * specific language governing permissions and limitations *
+ * under the License. *
+ ****************************************************************/
+
+package org.apache.hupa.client.widgets;
+
+public interface HasDialog {
+ public void show();
+ public void hide();
+
+}
Added:
labs/hupa/src/main/java/org/apache/hupa/client/widgets/QuestionDialogBox.java
URL:
http://svn.apache.org/viewvc/labs/hupa/src/main/java/org/apache/hupa/client/widgets/QuestionDialogBox.java?rev=803506&view=auto
==============================================================================
---
labs/hupa/src/main/java/org/apache/hupa/client/widgets/QuestionDialogBox.java
(added)
+++
labs/hupa/src/main/java/org/apache/hupa/client/widgets/QuestionDialogBox.java
Wed Aug 12 13:40:22 2009
@@ -0,0 +1,71 @@
+/****************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one *
+ * or more contributor license agreements. See the NOTICE file *
+ * distributed with this work for additional information *
+ * regarding copyright ownership. The ASF licenses this file *
+ * to you under the Apache License, Version 2.0 (the *
+ * "License"); you may not use this file except in compliance *
+ * with the License. You may obtain a copy of the License at *
+ * *
+ * http://www.apache.org/licenses/LICENSE-2.0 *
+ * *
+ * Unless required by applicable law or agreed to in writing, *
+ * software distributed under the License is distributed on an *
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY *
+ * KIND, either express or implied. See the License for the *
+ * specific language governing permissions and limitations *
+ * under the License. *
+ ****************************************************************/
+
+package org.apache.hupa.client.widgets;
+
+import org.apache.hupa.client.HupaConstants;
+import org.cobogw.gwt.user.client.ui.Button;
+import org.cobogw.gwt.user.client.ui.ButtonBar;
+
+import com.google.gwt.core.client.GWT;
+import com.google.gwt.event.dom.client.ClickEvent;
+import com.google.gwt.event.dom.client.ClickHandler;
+import com.google.gwt.event.dom.client.HasClickHandlers;
+import com.google.gwt.event.shared.HandlerRegistration;
+import com.google.gwt.user.client.ui.DialogBox;
+import com.google.gwt.user.client.ui.Label;
+import com.google.gwt.user.client.ui.VerticalPanel;
+
+public class QuestionDialogBox extends DialogBox implements
HasClickHandlers,HasDialog{
+ private HupaConstants constants = GWT.create(HupaConstants.class);
+ private Label text = new Label();
+ private ButtonBar bar = new ButtonBar();
+ private VerticalPanel panel = new VerticalPanel();
+ private Button okButton = new Button(constants.okButton());
+ private Button cancelButton = new Button(constants.cancelButton());
+
+ public QuestionDialogBox() {
+ super();
+ setModal(true);
+ panel.add(text);
+ bar.add(okButton);
+ bar.add(cancelButton);
+ panel.add(bar);
+
+ cancelButton.addClickHandler(new ClickHandler() {
+
+ public void onClick(ClickEvent event) {
+ hide();
+ }
+
+ });
+ add(panel);
+
+ }
+
+ public void setText(String value) {
+ text.setText(value);
+ }
+
+ public HandlerRegistration addClickHandler(ClickHandler handler) {
+ return okButton.addClickHandler(handler);
+ }
+
+
+}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]