01: /*
02: * ChainBuilder ESB
03: * Visual Enterprise Integration
04: *
05: * Copyright (C) 2008 Bostech Corporation
06: *
07: * This program is free software; you can redistribute it and/or modify
08: * it under the terms of the GNU General Public License as published by
09: * the Free Software Foundation; either version 2 of the License, or
10: * (at your option) any later version.
11: *
12: * This program is distributed in the hope that it will be useful,
13: * but WITHOUT ANY WARRANTY; without even the implied warranty of
14: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15: * General Public License for more details.
16: *
17: * You should have received a copy of the GNU General Public License
18: * along with this program; if not, write to the Free Software
19: * Foundation, Inc.,59 Temple Place, Suite 330, Boston, MA 02111-1307
20: * USA
21: *
22: *
23: * $Id$
24: */
25:
26: package com.bostechcorp.cbesb.console.client.dialogs;
27:
28: import com.bostechcorp.cbesb.console.client.Admin;
29: import com.bostechcorp.cbesb.console.client.FileUploadPanel;
30: import com.bostechcorp.cbesb.console.i18n.ConsoleMessages;
31: import com.google.gwt.core.client.GWT;
32: import com.google.gwt.user.client.ui.ClickListener;
33: import com.google.gwt.user.client.ui.DialogBox;
34: import com.google.gwt.user.client.ui.HasHorizontalAlignment;
35: import com.google.gwt.user.client.ui.HorizontalPanel;
36: import com.google.gwt.user.client.ui.PushButton;
37: import com.google.gwt.user.client.ui.VerticalPanel;
38: import com.google.gwt.user.client.ui.Widget;
39:
40: /**
41: * @author rui.hou
42: *
43: */
44: public class FileUploadDialog extends DialogBox {
45:
46: /**
47: *
48: */
49: String fileName = "";
50: private VerticalPanel verticalPanel = new VerticalPanel();
51: private HorizontalPanel buttonPanel = new HorizontalPanel();
52: private PushButton cancelButton = new PushButton(
53: ((ConsoleMessages) GWT.create(ConsoleMessages.class))
54: .Cancel());
55:
56: public FileUploadDialog(final Admin admin, String actionType) {
57: verticalPanel.add(new FileUploadPanel(admin, actionType, this ));
58: buttonPanel.add(cancelButton);
59: verticalPanel.add(buttonPanel);
60: buttonPanel.setCellHorizontalAlignment(cancelButton,
61: HasHorizontalAlignment.ALIGN_RIGHT);
62: verticalPanel.setCellHorizontalAlignment(buttonPanel,
63: HasHorizontalAlignment.ALIGN_RIGHT);
64: cancelButton.addClickListener(new ClickListener() {
65: public void onClick(Widget sender) {
66: hide();
67: }
68: });
69: setWidget(verticalPanel);
70: setText(((ConsoleMessages) GWT.create(ConsoleMessages.class))
71: .selectLicense());
72: center();
73: show();
74: }
75:
76: /**
77: * @param autoHide
78: * @param modal
79: */
80: public FileUploadDialog(boolean autoHide, boolean modal) {
81: super (autoHide, modal);
82: // TODO Auto-generated constructor stub
83: }
84:
85: public void setFileName(String fileName) {
86: this .fileName = fileName;
87: }
88:
89: public String getFileName() {
90: return this.fileName;
91: }
92:
93: }
|