001: /*
002: * ChainBuilder ESB
003: * Visual Enterprise Integration
004: *
005: * Copyright (C) 2006 Bostech Corporation
006: *
007: * This program is free software; you can redistribute it and/or modify it
008: * under the terms of the GNU General Public License as published by the
009: * Free Software Foundation; either version 2 of the License, or (at your option)
010: * any later version.
011: *
012: * This program is distributed in the hope that it will be useful,
013: * but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
014: * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
015: * for more details.
016: *
017: * You should have received a copy of the GNU General Public License along with
018: * this program; if not, write to the Free Software Foundation, Inc.,
019: * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
020: *
021: *
022: * $Id: DatabaseConnectDialog.java 4144 2007-01-04 03:46:20Z lzheng $
023: */
024: package com.bostechcorp.cbesb.console.client.dialogs;
025:
026: import com.bostechcorp.cbesb.console.i18n.ConsoleMessages;
027: import com.google.gwt.core.client.GWT;
028: import com.google.gwt.user.client.DOM;
029: import com.google.gwt.user.client.Element;
030: import com.google.gwt.user.client.ui.DialogBox;
031: import com.google.gwt.user.client.ui.Label;
032: import com.google.gwt.user.client.ui.RootPanel;
033: import com.google.gwt.user.client.ui.VerticalPanel;
034: import com.google.gwt.user.client.ui.Widget;
035:
036: public class WaitingDialog extends DialogBox {
037:
038: VerticalPanel mainPanel = new VerticalPanel();
039: //VerticalPanel mainPanel2 = new VerticalPanel();
040: Label contentLabel = new Label("");
041: Label waitLabel = new Label("");
042: Label spaceLabel = new Label("");
043: String content;
044:
045: /*private boolean timerState=false;*/
046:
047: /*Timer timer = new Timer() {
048: public void run() {
049: dynamic();
050: }
051: };*/
052: /*private void dynamic(){
053: // info=waitLabel.getText();
054: // if(buf.length()<30)
055: // buf.append(">");
056: // else
057: // buf=new StringBuffer("");
058: // info=" "+buf.toString()+" ";
059: // waitLabel.setText(info);
060: // spaceLabel.setText(" ");
061: //
062: if(timerState){
063: // timer.cancel();
064: closeSelf();
065: timerState=false;
066: }
067: }*/
068: /*private void startTimer(){
069: timer.scheduleRepeating(200);//duleRepeating(200);
070: }*/
071: public void close() {
072: /*timerState=true;*/
073: hide();
074: cancelWaitStatus();
075: }
076:
077: public WaitingDialog() {
078: //parent = listener;h
079: //setTitle(title);
080: setText(((ConsoleMessages) GWT.create(ConsoleMessages.class))
081: .waiting());
082: content = " \r\n";
083: content += " "
084: + ((ConsoleMessages) GWT.create(ConsoleMessages.class))
085: .operation_is_in_progress() + " ";
086: content += "\r\n ";
087: contentLabel.setText(content);
088:
089: mainPanel.add(contentLabel);
090: // mainPanel.add(waitLabel);
091: // mainPanel.add(spaceLabel);
092: setWidget(mainPanel);
093: // this.setPopupPosition(200*2, 300);
094: /*initContent();*/
095:
096: }
097:
098: public void show() {
099: /*startTimer();*/
100: super .show();
101: this .center();
102: showWaitStatus();
103: }
104:
105: /*private void initContent(){
106:
107: final HorizontalPanel horizontalPanel = new HorizontalPanel();
108: //verticalPanel.add(horizontalPanel);
109: horizontalPanel.setHorizontalAlignment(HasAlignment.ALIGN_CENTER);
110: horizontalPanel.setWidth("100%");
111: final Button okButton = new Button(" "+((ConsoleMessages)GWT.create(ConsoleMessages.class)).OK()+" ");
112: okButton.addClickListener(new ClickListener(){
113: public void onClick(Widget w) {
114: closeSelf();
115: }
116: });
117: horizontalPanel.add(okButton);
118: okButton.setVisible(false);
119:
120: mainPanel.add(horizontalPanel);
121: }*/
122:
123: /*public void closeSelf(){
124: hide();
125: // contentLabel.removeFromParent();
126: // mainPanel.removeFromParent();
127: // this.removeFromParent();
128: timer.cancel();
129: }*/
130: private void cancelWaitStatus() {
131: DOM.releaseCapture(RootPanel.get().getElement());
132: DOM.setStyleAttribute(RootPanel.get().getElement(), "cursor",
133: "default");
134: }
135:
136: private void showWaitStatus() {
137: DOM.setStyleAttribute(RootPanel.get().getElement(), "cursor",
138: "wait");
139: DOM.setCapture(RootPanel.get().getElement());
140:
141: }
142:
143: }
|