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); }
private void initRunButton() { // Run Button //////////////////////////////////////////// runButton = new PushButton(); RootPanel.get("runButton").add(runButton); runButton.setEnabled(false); runButton.addClickHandler(new RunClickHandler()); }
private void loadCompleted() { // The load completed, enable buttons runButton.setEnabled(true); addFileButton.setEnabled(true); }