Example usage for com.google.gwt.user.client Window getClientHeight

List of usage examples for com.google.gwt.user.client Window getClientHeight

Introduction

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

Prototype

public static int getClientHeight() 

Source Link

Usage

From source file:com.dimdim.conference.ui.user.client.ActivePresenterAVWindow.java

License:Open Source License

public void setPositionToCenter() {
    int h = LayoutGlobals.getAVPlayerFloatPanelHeight(sizeFactor);
    int left = (Window.getClientWidth() / 2) - (h / 2);
    int top = (Window.getClientHeight() / 2) - (h / 2);
    if (top < 0) {
        top = 0;//from   ww  w .  j av a  2s .  co  m
    } else {
        if (top < 101) {
            top = 101;
        }
    }
    this.setPopupPosition(left, top);
}

From source file:com.dimdim.conference.ui.user.client.AttendeeAudioBroadcasterFloat.java

License:Open Source License

public void setPositionToCenter() {
    int h = this.movieHeight;//LayoutGlobals.getAudioBroadcasterFloatPanelHeight();
    int left = (Window.getClientWidth() / 2) - (h / 2);
    int top = (Window.getClientHeight() / 2) - (h / 2);
    this.setPopupPosition(left, top);
}

From source file:com.dimdim.conference.ui.workspacepopout.client.WorkspacePopout.java

License:Open Source License

public void onModuleLoad() {
    ConferenceGlobals.setContentWidth(Window.getClientWidth());
    ConferenceGlobals.setContentHeight(Window.getClientHeight());
    ConferenceGlobals.conferenceKey = getConfKey();

    UIDataDictionaryManager.initManager(getWebAppName(), getConfKey(), getUserType(),
            //            new String[]{"dictionary","dictionary","dictionary","dictionary","dictionary"},
            //            new String[]{"console","console","console","global_string","session_string"},
            //            new String[]{"ui_strings","tooltips","default_layout","emoticons","user_info"+getDataCacheId()});
            new String[] { "combined" }, new String[] { "session_string" },
            new String[] { "user_info" + getDataCacheId() });
    UIDataDictionaryManager.getManager().readDataDictionaries(this);
}

From source file:com.edgenius.wiki.gwt.client.page.PageTreePanel.java

License:Open Source License

public PageTreePanel(PageMain main) {
    super(main);//from w  w w.  j  a  v a2  s .c  o  m
    //page tree
    TreeItem root = new TreeItem();
    root.setUserObject("-1");
    //XXX:hardcode
    root.setText(Msg.consts.dashboard());

    tree = new PageTreeWidget(root);
    tree.addSelectionHandler(this);

    //I don't use scroll panel as it always display the vertical scrollbar
    FlowPanel panel = new FlowPanel();
    panel.add(tree);
    panel.setWidth(ClientConstants.LEFT_SIDE_MENU_WIDTH + "px");
    DOM.setStyleAttribute(panel.getElement(), "overflowY", "hidden");
    DOM.setStyleAttribute(panel.getElement(), "overflowX", "auto");
    //this style is important for IE, otherwise, overflow X text will be displayed outside.
    DOM.setStyleAttribute(panel.getElement(), "position", "relative");
    content.add(panel);

    header.add(tree.getFunctionButtons(), DockPanel.EAST);
    DOM.setStyleAttribute(this.getElement(), "minHeight",
            (Window.getClientHeight() - ClientConstants.DEFAULT_MENU_TOP) + "px");

}

From source file:com.emitrom.flash4j.starling.client.core.runtime.StarlingPlatform.java

License:Apache License

public static Widget initAsWidget(StartHandler handler) {
    StarlingLoader loader = StarlingLoaderFactory.getLoader();
    return loader.load(Window.getClientWidth(), Window.getClientHeight(), handler);
}

From source file:com.emitrom.flash4j.swf.client.loader.SwfWidgetLoader.java

License:Apache License

/**
 * Initialize the SwfWidgetLoader framework as a widget filling the entire
 * browser window. This method should be use when trying to embed the
 * SwfWidgetLoader application into an existing GWT container.
 * /*from   www  .  j  a v  a 2 s .  c o  m*/
 * @param handler
 *            ,the handler to be called once the SwfWidgetLoader framework
 *            was successfully loaded
 * @return, the SwfWidgetLoader widget to be added
 */
public static Widget initAsWidget(String path, StartHandler handler) {
    SwfLoader loader = SwfLoaderFactory.getLoader(path);
    return loader.load(Window.getClientWidth(), Window.getClientHeight(), handler);
}

From source file:com.emitrom.flash4j.swf.client.loader.SwfWidgetLoader.java

License:Apache License

public static Widget initAsWidget(String path, String bridgeName, boolean transparent, StartHandler handler) {
    SwfLoader loader = SwfLoaderFactory.getLoader(path);
    return loader.load(Window.getClientWidth(), Window.getClientHeight(), bridgeName, transparent, handler);
}

From source file:com.ephesoft.dcma.gwt.admin.bm.client.presenter.batch.ExportBatchClassPresenter.java

License:Open Source License

/**
 * To show Batch Class Export View.//  w  w  w .  java  2 s .  co  m
 */
public void showBatchClassExportView() {
    view.getDialogBox().setWidth("100%");
    view.getDialogBox().add(view);
    view.getDialogBox().center();
    view.getDialogBox().setPopupPosition(Window.getClientWidth() / 2 - view.getDialogBox().getOffsetWidth() / 2,
            Window.getClientHeight() / 2 - view.getDialogBox().getOffsetHeight() / 2
                    - BatchClassManagementConstants.HUNDRED);
    view.getDialogBox().show();
    view.getDialogBox().setText(MessageConstants.BATCH_CLASS_EXPORT);
}

From source file:com.ephesoft.dcma.gwt.foldermanager.client.presenter.FolderTablePresenter.java

License:Open Source License

public void openItem(FileWrapper file) {
    if (file != null) {
        String fileName = file.getName();
        String absoluteFilePath = file.getPath();
        if (!file.getKind().equals(FileType.DIR)) {
            String url = baseHttpURL + FolderManagementConstants.URL_SEPARATOR
                    + (absoluteFilePath.substring(
                            absoluteFilePath.lastIndexOf(parentFolderPath) + parentFolderPath.length() + 1))
                                    .replace(FolderManagementConstants.SHARED_PATH_SEPARATOR_STRING,
                                            FolderManagementConstants.URL_SEPARATOR);
            try {
                Window.open(url, "", OPEN_WINDOW_OPTIONS + WIDTH + Window.getClientWidth() + HEIGHT
                        + Window.getClientHeight());
            } catch (Exception e) {
                showErrorInConfirmationDialog(
                        LocaleDictionary.get().getMessageValue(FolderManagementMessages.COULD_NOT_OPEN_THE_FILE)
                                + FolderManagementConstants.QUOTES + fileName
                                + FolderManagementConstants.QUOTES);
            }/*  w w w .  j  a va 2 s . co  m*/
        } else {
            controller.getEventBus().fireEvent(new FolderTreeRefreshEvent(absoluteFilePath, fileName));
        }
    }

}

From source file:com.ephesoft.gxt.admin.client.view.batchclass.BatchClassImportView.java

License:Open Source License

private void initialiseFileUploadContainter() {
    fileQueuedHandler = new FileQueuedHandler() {

        public boolean onFileQueued(final FileQueuedEvent fileQueuedEvent) {
            boolean isFileValid = false;
            final String fileName = fileQueuedEvent.getFile().getName();
            final String fileExtension = fileName.substring(fileName.lastIndexOf(".") + 1);
            if (fileExtension.equalsIgnoreCase("zip")) {
                String lastAttachedZipSourcePath = "lastAttachedZipSourcePath="
                        + fileQueuedEvent.getFile().getName();
                importBatchClassUploader.setUploadURL(BATCH_FORM_ACTION + lastAttachedZipSourcePath);
                isFileValid = true;/* www. j  ava 2 s .com*/
            } else {
                if (isValid()) {
                    DialogUtil.showMessageDialog(
                            LocaleDictionary.getConstantValue(BatchClassConstants.ERROR_TITLE),
                            LocaleDictionary.getMessageValue(
                                    BatchClassMessages.VALID_INPUT_FILE_FORMATS_IS_ZIP_DISCARDING_INVALID_FILES),
                            DialogIcon.ERROR);
                    setValid(false);
                    isFileValid = false;
                }
                importBatchClassUploader.cancelUpload(fileQueuedEvent.getFile().getId(), false);
            }

            return isFileValid;
        }

    };
    fileDialogCompleteHandler = new FileDialogCompleteHandler() {

        @Override
        public boolean onFileDialogComplete(FileDialogCompleteEvent fileDialogCompleteEvent) {
            if (fileDialogCompleteEvent.getNumberOfFilesSelected() > 1 && isValid()) {
                DialogUtil.showMessageDialog(
                        LocaleDictionary.getConstantValue(BatchClassConstants.WARNING_TITLE),
                        LocaleDictionary.getMessageValue(BatchClassMessages.MULTIPLE_FILE_UPLOAD_NOT_SUPPORTED),
                        DialogIcon.WARNING);
            } else if (fileDialogCompleteEvent.getNumberOfFilesSelected() == 1 && isValid()) {
                importBatchClassUploader.startUpload();
                return true;
            }
            setValid(true);
            return false;
        }
    };
    uploadCompleteHandler = new UploadCompleteHandler() {

        @Override
        public boolean onUploadComplete(UploadCompleteEvent uploadCompleteEvent) {
            String fileName = uploadCompleteEvent.getFile().getName();
            final String fileExtension = fileName.substring(fileName.lastIndexOf(".") + 1);
            if (fileExtension.equalsIgnoreCase("zip")) {
                if (importBatchClassUserOptionDTO.getName().isEmpty()
                        || importBatchClassUserOptionDTO.getName() == null) {
                    DialogUtil.showMessageDialog(
                            LocaleDictionary.getConstantValue(BatchClassConstants.ERROR_TITLE),
                            LocaleDictionary.getMessageValue(BatchClassMessages.UNABLE_TO_IMPORT_BATCH_CLASS),
                            DialogIcon.ERROR);
                } else {
                    importBatchClassView.setBatchClassName(importBatchClassUserOptionDTO.getName());
                    importBatchClassView
                            .setBatchClassDescription(importBatchClassUserOptionDTO.getDescription());
                    importBatchClassView.setPriority(importBatchClassUserOptionDTO.getPriority());

                    importBatchClassView.setprioritySliderValue(importBatchClassView.getPrioritySliderString());

                    dialogWindow.setHeadingText(
                            LocaleDictionary.getConstantValue(BatchClassConstants.IMPORT_BATCH_CLASS));
                    dialogWindow.add(importBatchClassView);

                    // Set Focus Widget
                    dialogWindow.setFocusWidget(importBatchClassView.batchClassNameTextField);

                    dialogWindow.setHeight(IMPORT_BATCH_CLASS_VIEW_HEIGHT);
                    dialogWindow.setWidth(IMPORT_BATCH_CLASS_VIEW_WIDTH);
                    dialogWindow.setPosition((Window.getClientWidth() - IMPORT_BATCH_CLASS_VIEW_WIDTH) / 2,
                            (Window.getClientHeight() - IMPORT_BATCH_CLASS_VIEW_HEIGHT) / 2);
                    dialogWindow.setPreferCookieDimension(false);
                    dialogWindow.show();
                }
            }
            return true;
        }
    };
    uploadSuccessHandler = new UploadSuccessHandler() {

        @Override
        public boolean onUploadSuccess(UploadSuccessEvent uploadSuccessEvent) {
            result = uploadSuccessEvent.getServerData();
            String workFlowName = result.substring(
                    result.indexOf(AdminSharedConstants.WORK_FLOW_NAME)
                            + AdminSharedConstants.WORK_FLOW_NAME.length(),
                    result.indexOf('|', result.indexOf(AdminSharedConstants.WORK_FLOW_NAME)));

            String workflowDescription = result.substring(
                    result.indexOf(AdminSharedConstants.WORK_FLOW_DESC)
                            + AdminSharedConstants.WORK_FLOW_DESC.length(),
                    result.indexOf('|', result.indexOf(AdminSharedConstants.WORK_FLOW_DESC)));
            String workflowPriority = result.substring(
                    result.indexOf(AdminSharedConstants.WORK_FLOW_PRIORITY)
                            + AdminSharedConstants.WORK_FLOW_PRIORITY.length(),
                    result.indexOf('|', result.indexOf(AdminSharedConstants.WORK_FLOW_PRIORITY)));

            String zipSourcePath = result.substring(
                    result.indexOf(AdminSharedConstants.FILE_PATH) + AdminSharedConstants.FILE_PATH.length(),
                    result.indexOf('|', result.indexOf(AdminSharedConstants.FILE_PATH)));
            String workflowDeployed = result.substring(
                    result.indexOf(AdminSharedConstants.WORKFLOW_DEPLOYED)
                            + AdminSharedConstants.WORKFLOW_DEPLOYED.length(),
                    result.indexOf('|', result.indexOf(AdminSharedConstants.WORKFLOW_DEPLOYED)));
            String workflowEqual = result.substring(
                    result.indexOf(AdminSharedConstants.WORKFLOW_EQUAL)
                            + AdminSharedConstants.WORKFLOW_EQUAL.length(),
                    result.indexOf('|', result.indexOf(AdminSharedConstants.WORKFLOW_EQUAL)));
            String workflowExistInBatchClass = result.substring(
                    result.indexOf(AdminSharedConstants.WORKFLOW_EXIST_IN_BATCH_CLASS)
                            + AdminSharedConstants.WORKFLOW_EXIST_IN_BATCH_CLASS.length(),
                    result.indexOf('|', result.indexOf(AdminSharedConstants.WORKFLOW_EXIST_IN_BATCH_CLASS)));

            importBatchClassUserOptionDTO.setName(workFlowName);
            importBatchClassUserOptionDTO.setDescription(workflowDescription);
            importBatchClassUserOptionDTO.setPriority(Integer.valueOf(workflowPriority));
            importBatchClassUserOptionDTO.setZipFileName(zipSourcePath);
            importBatchClassUserOptionDTO.setWorkflowDeployed(Boolean.valueOf(workflowDeployed));
            importBatchClassUserOptionDTO.setWorkflowEqual(Boolean.valueOf(workflowEqual));
            importBatchClassUserOptionDTO
                    .setWorkflowExistsInBatchClass(Boolean.valueOf(workflowExistInBatchClass));

            return true;
        }
    };
}