示例#1
0
 private void initAddFilesButton() {
   // Add files button produces a dialog
   addFileButton =
       new PushButton(
           "",
           new ClickHandler() {
             @Override
             public void onClick(final ClickEvent event) {
               final int clientWidth = Window.getClientWidth();
               final int clientHeight = Window.getClientHeight();
               final int popupWidth = clientWidth * 3 / 4;
               final int popupHeight = clientHeight * 3 / 4;
               final int posX = (clientWidth - popupWidth) / 2;
               final int posY = (clientHeight - popupHeight) / 2;
               final FileTreeDialog dialog = new FileTreeDialog(popupWidth, popupHeight);
               dialog.setPopupPosition(posX, posY);
               dialog.setSelectedFilesListener(
                   new SelectedFilesListener() {
                     @Override
                     public void selectedFiles(final FileInfo[] info) {
                       files.addFiles(info);
                     }
                   });
               dialog.show();
             }
           });
   addFileButton.setEnabled(false);
   RootPanel.get("addFileButton").add(addFileButton);
 }
示例#2
0
 private void initRunButton() {
   // Run Button ////////////////////////////////////////////
   runButton = new PushButton();
   RootPanel.get("runButton").add(runButton);
   runButton.setEnabled(false);
   runButton.addClickHandler(new RunClickHandler());
 }
示例#3
0
 private void loadCompleted() {
   // The load completed, enable buttons
   runButton.setEnabled(true);
   addFileButton.setEnabled(true);
 }