Example usage for com.google.gwt.user.client.ui HTMLPanel HTMLPanel

List of usage examples for com.google.gwt.user.client.ui HTMLPanel HTMLPanel

Introduction

In this page you can find the example usage for com.google.gwt.user.client.ui HTMLPanel HTMLPanel.

Prototype

private HTMLPanel(Element elem) 

Source Link

Document

Construct a new HTMLPanel with the specified element.

Usage

From source file:com.edgenius.wiki.gwt.client.widgets.UploadDialog.java

License:Open Source License

public UploadDialog(AttachmentPanel attachmentPanel, final String spaceUname, String pageUuid,
        final PageType draft) {
    this.setText(Msg.consts.upload());
    this.setIcon(new Image(IconBundle.I.get().upload()));

    this.attachmentPanel = attachmentPanel;
    this.spaceUname = spaceUname;
    this.pageUuid = pageUuid;
    this.draft = draft;

    FlowPanel busyPanel = new FlowPanel();
    String id = HTMLPanel.createUniqueId();
    HTMLPanel busyPanelDiv = new HTMLPanel("<span></span><div id='" + id + "'></div>");
    busyPanelDiv.add(IconBundle.I.loading(), id);
    busyPanel.add(busyPanelDiv);/*from  w ww.jav a 2  s . c o  m*/
    busyPanelDiv.setStyleName(Css.BUSY_PANEL);
    busyPanelDiv.addStyleName("upload");

    deck.add(busyPanel);

    //If editing, always save auto draft - 2 scenarios: first if  pageUuid is null, means new page, must be save draft.
    //otherwise, an existing page, however, user needs a draft to reload these draft attachments - I set it always save draft that is 100% perfect because here 
    //does not check if this editing already has a draft saved. 
    if (attachmentPanel.getPageMain().getVisiblePanelIndex() == PageMain.EDIT_PANEL) {
        //           if(StringUtil.isBlank(pageUuid)){
        //could a unsaved new page - save a auto draft then turn page again
        attachmentPanel.getPageMain().editPanel.saveDraft(PageSaveMethod.SAVE_AUTO_DRAFT_STAY_IN_EDIT,
                new Callback<String>() {
                    @Override
                    public void callback(String pageUuid) {
                        UploadDialog.this.pageUuid = pageUuid;
                        Frame upload = new Frame(GwtClientUtils.getBaseUrl() + "pages/upload?uname="
                                + URL.encodeQueryString(spaceUname) + "&puuid=" + pageUuid + "&draft="
                                + draft.value());
                        upload.setSize("100%", "100%");
                        deck.add(upload);
                    }
                });
        //          }
    } else {
        Frame upload = new Frame(GwtClientUtils.getBaseUrl() + "pages/upload?uname="
                + URL.encodeQueryString(spaceUname) + "&puuid=" + pageUuid + "&draft=" + draft.value());
        upload.setSize("100%", "100%");
        deck.add(upload);
    }

    deck.showWidget(0);
    this.setWidget(deck);
    deck.setSize("100%", "100%");
    this.addStyleName(Css.UPLOAD_DIALOG_BOX);
    this.addDialogListener(this);

    this.bindJSMethod(this);

}

From source file:com.ephesoft.dcma.gwt.foldermanager.client.view.widget.FolderUploadWidget.java

License:Open Source License

public FolderUploadWidget(final HandlerManager eventBus) {
    super();// www . ja v  a2s .  com
    initWidget(BINDER.createAndBindUi(this));
    this.eventBus = eventBus;
    this.eventBus.addHandler(PathRefreshEvent.type, new PathRefreshEventHandler() {

        @Override
        public void onFolderPathChange(PathRefreshEvent pathRefreshEvent) {
            folderPath = pathRefreshEvent.getFolderPath();
        }
    });

    this.eventBus.addHandler(RemoveAttachmentEvent.type, new RemoveAttachmentEventHandler() {

        @Override
        public void onRemoveAttachment(RemoveAttachmentEvent removeAttachedFolderEvent) {
            int fileIndex = removeAttachedFolderEvent.getFileIndex();
            fileIndexVsToUploadMap.put(fileIndex, false);
        }
    });

    uploadBuilder.requeueOnError(false);
    labelPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
    buttonPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
    buttonPanel.setSpacing(2);
    HTMLPanel panel = new HTMLPanel(FolderManagementConstants.DIV_ID_SWFUPLOAD_DIV);
    uploadFilePlaceholder.getElement().appendChild(panel.getElement());
    uploadFilePlaceholder.setHeight(FolderManagementConstants._25PX);
    RootPanel.get().add(this);
    viewAttachedFiles
            .setText(LocaleDictionary.get().getConstantValue(FolderManagementConstants.VIEW_ATTACHED_FILES));
    viewAttachedFiles
            .setTitle(LocaleDictionary.get().getMessageValue(FolderManagementMessages.VIEW_ATTACHED_FILES));

    upload.setText(LocaleDictionary.get().getConstantValue(FolderManagementConstants.UPLOAD));
    uploadHere.setText(LocaleDictionary.get().getConstantValue(FolderManagementConstants.UPLOAD_HERE));

    uploadBuilder.setButtonAction(ButtonAction.SELECT_FILES);
    uploadBuilder.setButtonCursor(ButtonCursor.HAND);
    uploadBuilder.setButtonImageURL(FolderManagementConstants.IMAGES_BROWSE_PNG);
    uploadBuilder.setButtonHeight(25);
    uploadBuilder.setButtonWidth(68);

    uploadBuilder.setButtonPlaceholderID(FolderManagementConstants.SWFUPLOAD);
    uploadBuilder.setFileTypes(FolderManagementConstants.FILE_TYPES);
    uploadBuilder.setFileTypesDescription(FolderManagementConstants.ALL_FILES);

    uploadBuilder.setUploadStartHandler(new UploadStartHandler() {

        @Override
        public void onUploadStart(UploadStartEvent event) {
            File file = event.getFile();
            fileIndexVsToUploadMap.put(file.getIndex(), false);
        }
    });

    uploadBuilder.setFileQueuedHandler(new FileQueuedHandler() {

        @Override
        public void onFileQueued(FileQueuedEvent event) {
            File file = event.getFile();
            fileIndexVsToUploadMap.put(file.getIndex(), true);
        }
    });

    uploadBuilder.setUploadCompleteHandler(new UploadCompleteHandler() {

        @Override
        public void onUploadComplete(UploadCompleteEvent event) {
            int fileLength = swfUpload.getStats().getFilesQueued();
            if (fileLength > 0) {
                eventBus.fireEvent(new FolderTreeRefreshEvent());
                swfUpload.startUpload();
            } else {
                ScreenMaskUtility.unmaskScreen();
                eventBus.fireEvent(new FolderTreeRefreshEvent());
            }
        }
    });
    uploadBuilder.requeueOnError(true);
    uploadBuilder.preventSWFCaching(true);
    swfUpload = uploadBuilder.build();
}

From source file:com.ephesoft.dcma.gwt.uploadbatch.client.presenter.UploadBatchPresenter.java

License:Open Source License

public void repaintFileList() {
    view.getAllFilesBox().clear();/* www  .  j ava  2 s  . com*/
    view.getEditTable().removeAllRows();
    view.getDeleteCaptionPanel().setVisible(Boolean.FALSE);
    view.getSelectAllCell().clear();

    if (!view.getAllFileList().isEmpty()) {
        // view.formatRow(0);

        CheckBox deleteAllBox = new CheckBox();
        view.setDeleteAllBox(deleteAllBox);
        deleteAllBox.setStyleName("paddingSelectAll");
        deleteAllBox.addClickHandler(new ClickHandler() {

            @Override
            public void onClick(ClickEvent event) {
                boolean checked = ((CheckBox) event.getSource()).getValue();
                if (checked) {
                    // toggle all the checkboxes to select
                    view.toggleAllCheckBoxes(Boolean.TRUE);
                    view.getDeleteSelectedFileList().addAll(view.getAllFileList());
                } else {
                    // toggle all the checkboxes to deselect
                    view.toggleAllCheckBoxes(Boolean.FALSE);

                    view.getDeleteSelectedFileList().clear();
                }

            }
        });

        view.getSelectAllCell().add(deleteAllBox);
        deleteAllBox.setStyleName("paddingSelectAllLabel");
        Label label = new Label(LocaleDictionary.get().getConstantValue(UploadBatchConstants.SELECT_ALL));
        label.setWidth("25em");
        label.addStyleName("bold_text");
        view.getSelectAllCell().add(label);

        int row = 0;
        for (Iterator<String> fileListIterator = view.getAllFileList().iterator(); fileListIterator
                .hasNext();) {
            final String fileName = (String) fileListIterator.next();
            view.formatRow(row);

            CheckBox deleteBox = new CheckBox();
            view.getAllFilesBox().add(deleteBox);
            deleteBox.addClickHandler(new ClickHandler() {

                @Override
                public void onClick(ClickEvent event) {
                    boolean checked = ((CheckBox) event.getSource()).getValue();
                    if (checked) {
                        view.getDeleteSelectedFileList().add(fileName);
                    } else {
                        // uncheck the select all check box
                        view.getDeleteAllBox().setValue(Boolean.FALSE);

                        view.getDeleteSelectedFileList().remove(fileName);
                    }
                }
            });

            view.addWidget(row, 0, deleteBox);
            view.addWidget(row, 1, new Label(fileName));
            HTMLPanel progressPanel = new HTMLPanel("<span id=\"progressBar_" + row + "\"></span>");
            view.addWidget(row, 2, progressPanel);

            if (row != 0 || row < view.getAllFileList().size()) {
                String innerHTML = LocaleDictionary.get().getConstantValue(UploadBatchConstants.UPLOAD_PROGRESS)
                        + "100" + "%";
                DOM.getElementById("progressBar_" + row).setInnerHTML(innerHTML);
            }
            row++;
        }

        view.getDeleteCaptionPanel().setVisible(Boolean.TRUE);
    }
}

From source file:com.ephesoft.dcma.gwt.uploadbatch.client.view.UploadBatchView.java

License:Open Source License

public UploadBatchView() {
    super();/*from   w  w  w .  j  av  a2 s.com*/
    initWidget(BINDER.createAndBindUi(this));

    buttonPanel1.addStyleName("paddingTop");
    uploadBatchViewPanel.addStyleName("padding");
    mainDockPanel.addStyleName("deleteTable");

    batchClassPanel.addStyleName("paddingTop");

    fileUploadCaptionPanel
            .setCaptionHTML(LocaleDictionary.get().getConstantValue(UploadBatchConstants.UPLOAD_LABEL));
    fileUploadCaptionPanel.addStyleName(PANEL_BG);
    fileUploadCaptionPanel.addStyleName(BOLD_TEXT);
    fileUploadCaptionPanel.addStyleName(MARGIN_LOCAL);

    batchClassCaptionPanel
            .setCaptionHTML(LocaleDictionary.get().getConstantValue(UploadBatchConstants.BATCH_DETAIL));
    batchClassCaptionPanel.addStyleName(PANEL_BG);
    batchClassCaptionPanel.addStyleName(BOLD_TEXT);
    batchClassCaptionPanel.addStyleName(MARGIN_LOCAL);

    actionCaptionPanel.setCaptionHTML(LocaleDictionary.get().getConstantValue(UploadBatchConstants.ACTION));
    actionCaptionPanel.addStyleName(PANEL_BG);
    actionCaptionPanel.addStyleName(BOLD_TEXT);
    actionCaptionPanel.addStyleName(MARGIN_LOCAL);

    deleteCaptionPanel.setCaptionHTML(LocaleDictionary.get().getConstantValue(UploadBatchConstants.FILE_LIST));
    deleteCaptionPanel.addStyleName(PANEL_BG);
    deleteCaptionPanel.addStyleName(BOLD_TEXT);
    deleteCaptionPanel.addStyleName(MARGIN_LOCAL);

    editTable = new FlexTable();
    editTable.setWidth("100%");

    fileListTable.setWidget(0, 0, editTable);
    fileListTable.getCellFormatter().setVerticalAlignment(0, 0, HasVerticalAlignment.ALIGN_TOP);

    associateBCFView = new AssociateBCFView();
    allFileList = new LinkedList<String>();
    deleteSelectedFileList = new LinkedList<String>();
    allFilesBox = new ArrayList<CheckBox>();

    finishButton.setText(LocaleDictionary.get().getConstantValue(UploadBatchConstants.FINISH_BUTTON));
    // disable Finish button by default
    finishButton.setEnabled(Boolean.FALSE);
    // disable Field(s) button by default
    addBCFButton.setEnabled(Boolean.FALSE);
    // disable Delete button by default
    deleteButton.setEnabled(Boolean.FALSE);
    deleteButton.setVisible(Boolean.FALSE);
    deleteCaptionPanel.setVisible(Boolean.FALSE);

    uploadLabel.setText(LocaleDictionary.get().getConstantValue(UploadBatchConstants.UPLOAD_TEXT));
    uploadStar.setText(UploadBatchConstants.STAR);
    uploadStar.setStyleName("font_red");
    uploadButton.setText(LocaleDictionary.get().getConstantValue(UploadBatchConstants.UPLOAD_BUTTON));

    resetButton.setText(LocaleDictionary.get().getConstantValue(UploadBatchConstants.RESET_BUTTON));
    addBCFButton.setText(LocaleDictionary.get().getConstantValue(UploadBatchConstants.ASSOCIATE_BCF_BUTTON));
    deleteButton.setText(LocaleDictionary.get().getConstantValue(UploadBatchConstants.DELETE_BUTTON));

    HTMLPanel panel = new HTMLPanel("<div id=\"swfupload\"></div>");
    uploadFilePlaceholder.getElement().appendChild(panel.getElement());
    RootPanel.get().clear();
    RootPanel.get().add(this);

    uploadBuilder.setButtonAction(ButtonAction.SELECT_FILES);
    uploadBuilder.setButtonCursor(ButtonCursor.HAND);
    uploadBuilder.setButtonImageURL("images/browse.png");
    //uploadBuilder.setButtonText(LocaleDictionary.get().getMessageValue(UploadBatchMessages.BROWSE));
    uploadBuilder.setButtonHeight(25);
    uploadBuilder.setButtonWidth(68);

    uploadBuilder.setButtonPlaceholderID("swfupload");
    uploadBuilder.setFileTypes("*.tif;*.tiff;*.pdf");
    uploadBuilder
            .setFileTypesDescription(LocaleDictionary.get().getConstantValue(UploadBatchConstants.FILE_TYPES));

    fileIndexList = new ArrayList<Integer>();

    /*uploadBuilder.setFileDialogCompleteHandler(new FileDialogCompleteHandler() {
            
       @Override
       public void onFileDialogComplete(FileDialogCompleteEvent e) {
    presenter.onSubmit(UPLOAD_FORM_ACTION);
    uploadButton.setEnabled(true);
       }
    });
     */

    // To maintain index of file queued for upload.
    uploadBuilder.setFileQueuedHandler(new FileQueuedHandler() {

        @Override
        public void onFileQueued(FileQueuedEvent event) {
            File file = event.getFile();
            fileIndexList.add(file.getIndex());
        }
    });

    uploadBuilder.setUploadProgressHandler(new UploadProgressHandler() {

        @Override
        public void onUploadProgress(UploadProgressHandler.UploadProgressEvent event) {
            String fileName = event.getFile().getName();
            double percent = Math
                    .ceil(((event.getBytesComplete() * 1000.0 / event.getBytesTotal()) * 100.0) / 1000.0);
            int indexInList = allFileList.indexOf(fileName);
            if (indexInList != -1) {
                String innerHTML = LocaleDictionary.get().getConstantValue(UploadBatchConstants.UPLOAD_PROGRESS)
                        + percent;
                innerHTML = innerHTML.split("\\.")[0] + "%";
                DOM.getElementById("progressBar_" + indexInList).setInnerHTML(innerHTML);
            }
        }
    });

    uploadBuilder.setUploadErrorHandler(new UploadErrorHandler() {

        @Override
        public void onUploadError(UploadErrorEvent event) {
            ConfirmationDialogUtil.showConfirmationDialogError(
                    LocaleDictionary.get().getMessageValue(UploadBatchMessages.UPLOAD_UNSUCCESSFUL)
                            + event.getFile());
        }
    });
    uploadBuilder.setUploadStartHandler(new UploadStartHandler() {

        @Override
        public void onUploadStart(UploadStartEvent event) {
            String currentFileName = event.getFile().getName();
            // update the file list
            if (!allFileList.contains(currentFileName)) {
                allFileList.add(currentFileName);
            }
            presenter.repaintFileList();
        }
    });

    uploadBuilder.setUploadCompleteHandler(new UploadCompleteHandler() {

        @Override
        public void onUploadComplete(UploadCompleteEvent event) {
            String currentFileName = event.getFile().getName();
            // update the file list
            if (!allFileList.contains(currentFileName)) {
                allFileList.add(currentFileName);
            }
            int fileLength = swfUpload.getStats().getFilesQueued();
            if (fileLength > 0) {
                swfUpload.startUpload();
            } else {
                ScreenMaskUtility.unmaskScreen();

                if (!getAllFileList().isEmpty()) {
                    // enable finish button
                    finishButton.setEnabled(Boolean.TRUE);
                    // enable field(s) button
                    addBCFButton.setEnabled(Boolean.TRUE);
                    // enable delete button
                    deleteButton.setVisible(Boolean.TRUE);
                    deleteButton.setEnabled(Boolean.TRUE);
                    deleteCaptionPanel.setVisible(Boolean.TRUE);
                    fileListPanel.addStyleName("deleteTable");

                    // If user browser is IE
                    if (ScreenMaskUtility.getUserAgent().contains(UploadBatchConstants.IE_BROWSER)) {
                        fileListPanel.setWidth(UploadBatchConstants.WIDTH_26_EM);
                    }

                }
                if (oversizedFileCount > 0) {
                    String fileSizeMessage = oversizedFileCount
                            + LocaleDictionary.get()
                                    .getMessageValue(UploadBatchMessages.FILE_SIZE_EXCEED_MESSAGE)
                            + UploadBatchConstants.SPACE + (presenter.getFileSizeLimit() / SIZE_MULTIPLIER)
                            + UploadBatchConstants.SPACE + UploadBatchConstants.MEGA_BYTE;
                    String title = LocaleDictionary.get().getMessageValue(UploadBatchMessages.LIMIT_REACHED);
                    ConfirmationDialogUtil.showConfirmationDialog(fileSizeMessage, title, true);
                } else {
                    ConfirmationDialogUtil.showConfirmationDialogSuccess(LocaleDictionary.get()
                            .getMessageValue(UploadBatchMessages.FILE_UPLOAD_COMPLETE_ALERT));
                }
            }
        }
    });

    uploadBuilder.preventSWFCaching(true);
    setSwfUpload(uploadBuilder.build());
}

From source file:com.fountainhead.client.view.ErrorPageView.java

License:Open Source License

public ErrorPageView() {

    panel = new HTMLPanel(html);

    okButton = new Button("OK");

    panel.add(okButton, "okButtonContainer");

    bindCustomUiHandlers();// w  w w  . jav a2s  .  c o m
}

From source file:com.fountainhead.client.view.SignInPageView.java

License:Open Source License

public SignInPageView() {

    panel = new HTMLPanel(html);
    errorLabel = new Label();
    userNameField = new TextBox();
    passwordField = new PasswordTextBox();
    signInButton = new Button("Sign in");

    userNameField.setText(DEFAULT_USER_NAME);

    // See FieldVerifier
    // Passwords must contain at least 8 characters with at least one digit,
    // one upper case letter, one lower case letter and one special symbol (@#$%).
    passwordField.setText(DEFAULT_PASSWORD);

    panel.add(userNameField, "userNameFieldContainer");
    panel.add(passwordField, "passwordFieldContainer");
    panel.add(signInButton, "signInButtonContainer");
    panel.add(errorLabel, "errorLabelContainer");

    bindCustomUiHandlers();/*from  w w  w  .  j  a  va 2  s . c  om*/
}

From source file:com.fullmetalgalaxy.client.game.tabmenu.WgtGameInfo.java

License:Open Source License

private void initGeneralPanel() {
    Game game = GameEngine.model().getGame();

    // set general informations
    // ------------------------
    m_generalPanel.clear();//w  w w. ja v  a 2 s.c o m

    m_generalPanel.add(new HTML(game.getGameType().getIconAsHtml() + game.getStatus().getIconAsHtml() + " "
            + Messages.getGameStatusString(0, game.getStatus())));

    m_generalPanel.add(new Label(game.getDescription()));

    // Display tides
    String htmlTide = MAppBoard.s_messages.tide() + " " + BoardIcons.iconTide(game.getCurrentTide()).getHTML()
            + " ";
    // + Messages.getTideString( game.getCurrentTide() ) + "'> ";
    if ((GameEngine.model().getMyRegistration() != null)
            && (GameEngine.model().getMyRegistration().getTeam(game).getTideForeCast(game.getPreview()) > 0)) {
        htmlTide += BoardIcons.iconTide(game.getNextTide()).getHTML() + " ";
        // + Messages.getTideString( game.getNextTide() ) + "'>";
    } else {
        htmlTide += AbstractImagePrototype.create(Icons.s_instance.tide_unknown()).getHTML();
        // + MAppBoard.s_messages.noForecast() + "'> ";
    }
    if (game.isParallel()) {
        htmlTide += " at " + ClientUtil.s_dateTimeFormat.format(game.estimateNextTideChange());
    }

    HTMLPanel tidePanel = new HTMLPanel(htmlTide);
    tidePanel.setWidth("100%");
    m_generalPanel.add(tidePanel);

    // display start game date
    if ((game.getGameType() == GameType.MultiPlayer || game.getGameType() == GameType.Initiation)) {
        m_generalPanel.add(new HTML(
                MAppBoard.s_messages.gameCreation(ClientUtil.s_dateTimeFormat.format(game.getCreationDate()))
                        + " par <a href='/profile.jsp?id="
                        + (game.getAccountCreator() == null ? "0" : game.getAccountCreator().getId())
                        + "' target='_blank'>"
                        + (game.getAccountCreator() == null ? "???" : game.getAccountCreator().getPseudo())
                        + "</a>"));
        m_generalPanel.add(new HTML(MAppBoard.s_messages.reportAnIssueToAdmin()));
    }

    if (GameEngine.model().isJoined()) {
        EbRegistration registration = GameEngine.model().getMyRegistration();
        if (game.isParallel()) {
            // Display next action point increments
            Date nextActionIncrement = game.estimateTimeStepDate(game.getCurrentTimeStep() + 1);
            m_generalPanel.add(new Label(MAppBoard.s_messages.nextActionPt(registration.getActionInc(game),
                    ClientUtil.s_dateTimeFormat.format(nextActionIncrement))));
        } else if (registration.getTeam(game).getEndTurnDate() != null) {
            if (game.getCurrentPlayerIds().contains(registration.getId())) {
                m_generalPanel.add(new Label("Fin du tour: "
                        + ClientUtil.s_dateTimeFormat.format(registration.getTeam(game).getEndTurnDate())));
            } else {
                m_generalPanel.add(new Label("Prochain tour avant: "
                        + ClientUtil.s_dateTimeFormat.format(registration.getTeam(game).getEndTurnDate())));
            }
        }
    }

    // grid button
    m_generalPanel.add(m_btnGrid);
    m_btnGrid.setDown(GameEngine.model().isGridDisplayed());
    // atmosphere button
    m_generalPanel.add(m_btnAtmosphere);
    m_btnAtmosphere.setDown(GameEngine.model().isAtmosphereDisplayed());
    // standard display button
    if (game.getMapUri() != null) {
        m_generalPanel.add(m_btnCustomMap);
        m_btnCustomMap.setDown(GameEngine.model().isCustomMapDisplayed());
    }

    // display end game date
    if (!game.isParallel()) {
        m_generalPanel.add(new Label(MAppBoard.s_messages.turn() + " " + game.getCurrentTimeStep() + "/"
                + game.getEbConfigGameTime().getTotalTimeStep()));
    }
    if (game.estimateEndingDate().after(new Date())) {
        m_generalPanel.add(new Label(MAppBoard.s_messages
                .gameFinishAt(ClientUtil.s_dateTimeFormat.format(game.estimateEndingDate()))));
    }

    if ((game.getAccountCreator() != null
            && AppMain.instance().getMyAccount().getId() == game.getAccountCreator().getId()
            && game.getStatus() != GameStatus.History) || AppMain.instance().iAmAdmin()) {
        // display password if present
        if (game.isPasswordProtected()) {
            m_generalPanel.add(new Label("Mot de passe: " + game.getPassword()));
        }

        // play / pause button
        if ((game.getGameType() == GameType.MultiPlayer || game.getGameType() == GameType.Initiation)) {
            if (game.getStatus() == GameStatus.Running) {
                m_generalPanel.add(m_btnPause);
            } else if (game.getStatus() == GameStatus.Open || game.getStatus() == GameStatus.Pause) {
                m_generalPanel.add(m_btnPlay);
            }
        }
        // edit button
        m_generalPanel.add(m_btnEdit);
        m_generalPanel.add(m_btnAbort);
    }

    if (AppMain.instance().iAmAdmin()) {
        // download button
        m_generalPanel.add(new HTML("<a href='/admin/Servlet?downloadgame=" + game.getId() + "'>download</a>"));
        // record events
        m_generalPanel.add(m_btnRecordEvent);
    }

    m_generalPanel.add(new HTML("<br/>"));
    WgtGameTime wgtGameTime = new WgtGameTime();
    wgtGameTime.setReadOnly(true);
    m_generalPanel.add(wgtGameTime);
}

From source file:com.github.gwtbootstrap.showcase.client.overview.OverviewActivity.java

License:Apache License

@Override
public void start(AcceptsOneWidget panel, EventBus eventBus) {

    Subnav subnav = clientFactory.getSubnav();
    subnav.clear();/*  www.j  a  v  a  2 s. c  om*/
    subnav.setVisible(false);
    panel.setWidget(new HTMLPanel(""));

}

From source file:com.github.gwtcannonjs.demo.client.DemoLauncher.java

License:Open Source License

public void setup(Panel container) {
    final FlowPanel demoContainer = new FlowPanel();
    demoContainer.addStyleName("demo-container");

    Label selectDemoLabel = new Label("? Select a demo");
    selectDemoLabel.addStyleName("select-demo");
    demoContainer.add(selectDemoLabel);// ww  w .j  a va  2s. c  om

    FlowPanel menu = new FlowPanel();
    menu.addStyleName("menu");

    Label title = new Label("GWT CannonJS");
    title.addStyleName("page-title");

    for (final DemoInstance instance : DemoInstanceFactory.get().getAllInstances()) {
        Label item = new Label(instance.getName());
        item.addStyleName("menu-item");
        item.addClickHandler(new ClickHandler() {
            @Override
            public void onClick(ClickEvent event) {
                demoContainer.clear();

                final Frame demoFrame = new Frame(
                        "index.html?demo=" + URL.encodeQueryString(instance.getName()));
                HTMLPanel sourceCodeWidget = new HTMLPanel(highlightJava(instance.getSourceCode()));
                sourceCodeWidget.addStyleName("source-code");

                TabPanel tabPanel = new TabPanel();
                tabPanel.add(demoFrame, "Demo");
                tabPanel.add(sourceCodeWidget, "Source code");

                demoContainer.add(tabPanel);

                Scheduler.get().scheduleDeferred(new ScheduledCommand() {
                    @Override
                    public void execute() {
                        focus(demoFrame.getElement());
                    }

                    private native void focus(Element iframeElement) /*-{
                                                                     iframeElement.contentWindow.focus();
                                                                     }-*/;
                });
            }
        });
        menu.add(item);
    }

    container.add(title);
    container.add(menu);
    container.add(demoContainer);
}

From source file:com.gmail.cjbooms.thesis.pythonappengine.client.PythonAppEngine.java

License:Open Source License

/**
 * This is the entry point method.//w w w .jav  a  2 s  .c  o  m
 */
public void onModuleLoad() {

    VerticalPanel menuAndToolBarPanel = new VerticalPanel();
    menuAndToolBarPanel.setWidth("100%");

    // Panel to house the Main Menu
    FlowPanel menuBarPanel = new FlowPanel();
    DOM.setElementAttribute(menuBarPanel.getElement(), "id", "main_menu_panel");
    menuBarPanel.add(new MainMenuWidget());
    menuBarPanel.setHeight("1");

    HTMLPanel titleBar = new HTMLPanel(TITLE);
    DOM.setElementAttribute(titleBar.getElement(), "id", "pa-header");

    menuAndToolBarPanel.add(titleBar);
    menuAndToolBarPanel.add(menuBarPanel);
    menuAndToolBarPanel.add(new Toolbar());

    rootPanel.addNorth(menuAndToolBarPanel, 7);

    // Panel to house a footer containing File Context
    HTML footer = new HTML();
    DOM.setElementAttribute(footer.getElement(), "id", "pa-footer");
    rootPanel.addSouth(footer, 2);

    //Build the Main Work Area Panel and Add to Root
    SplitLayoutPanel mainWorkAreaPanel = new SplitLayoutPanel();
    rootPanel.add(mainWorkAreaPanel);

    FileSystemTreeWidget fileSystemTreeWidget = new FileSystemTreeWidget("Available Projects", editor, footer);
    treeScrollPanel.add(fileSystemTreeWidget);
    mainWorkAreaPanel.addWest(treeScrollPanel, 200);

    //contentScrollPanel.setHeight("100%");

    editor.setWidth("100%");
    editor.setHeight("100%");

    //contentScrollPanel.setWidget(editor);
    mainWorkAreaPanel.add(editor);
    mainWorkAreaPanel.setHeight("100%");

    RootLayoutPanel.get().add(rootPanel);

}