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

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

Introduction

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

Prototype

public static int getClientWidth() 

Source Link

Usage

From source file:com.ikon.frontend.client.widget.findfolder.FindFolderSelectPopup.java

License:Open Source License

/**
 * Shows the popup //from www . java 2s  .  c o  m
 */
public void show() {
    initButtons();
    int left = (Window.getClientWidth() - 700) / 2;
    int top = (Window.getClientHeight() - 350) / 2;
    setPopupPosition(left, top);
    setText(Main.i18n("search.folder.filter"));

    // Resets to initial tree value
    removeAllRows();
    keyword.setText("");
    evaluateEnableAction();
    super.show();
    keyword.setFocus(true);
}

From source file:com.ikon.frontend.client.widget.foldertree.FolderSelectPopup.java

License:Open Source License

/**
 * Shows the popup //from w w  w . ja va  2s .com
 */
public void show() {
    initButtons();
    status.setVisible(false);
    int left = (Window.getClientWidth() - 450) / 2;
    int top = (Window.getClientHeight() - 440) / 2;
    setPopupPosition(left, top);
    setText(Main.i18n("trash.directory.select.label"));

    // Resets to initial tree value
    folderSelectTree.reset();
    super.show();
}

From source file:com.ikon.frontend.client.widget.form.FolderSelectPopup.java

License:Open Source License

/**
 * Shows the popup /*from  w  ww  .j  a v  a2s.  co m*/
 */
public void show(TextBox textBox, HasSearch search) {
    this.textBox = textBox;
    this.search = search;
    int left = (Window.getClientWidth() - 300) / 2;
    int top = (Window.getClientHeight() - 200) / 2;
    setPopupPosition(left, top);

    // Resets to initial tree value
    folderSelectTree.reset();

    GWTWorkspace workspace = Main.get().workspaceUserProperties.getWorkspace();
    categoriesVisible = workspace.isStackCategoriesVisible();
    thesaurusVisible = workspace.isStackThesaurusVisible();
    templatesVisible = workspace.isStackTemplatesVisible();
    personalVisible = workspace.isStackPersonalVisible();
    mailVisible = workspace.isStackMailVisible();

    removeAllContextListItems();
    contextListBox.addItem(Main.i18n("leftpanel.label.taxonomy"), "" + UIDesktopConstants.NAVIGATOR_TAXONOMY);
    if (categoriesVisible) {
        contextListBox.addItem(Main.i18n("leftpanel.label.categories"),
                "" + UIDesktopConstants.NAVIGATOR_CATEGORIES);
    }
    if (thesaurusVisible) {
        contextListBox.addItem(Main.i18n("leftpanel.label.thesaurus"),
                "" + UIDesktopConstants.NAVIGATOR_THESAURUS);
    }
    if (templatesVisible) {
        contextListBox.addItem(Main.i18n("leftpanel.label.templates"),
                "" + UIDesktopConstants.NAVIGATOR_TEMPLATES);
    }
    if (personalVisible) {
        contextListBox.addItem(Main.i18n("leftpanel.label.my.documents"),
                "" + UIDesktopConstants.NAVIGATOR_PERSONAL);
    }
    if (mailVisible) {
        contextListBox.addItem(Main.i18n("leftpanel.label.mail"), "" + UIDesktopConstants.NAVIGATOR_MAIL);
    }

    super.show();
}

From source file:com.ikon.frontend.client.widget.LogoutPopup.java

License:Open Source License

/**
 * OKM Logout//w  w w.j av  a 2s . c o m
 */
public void logout() {
    button.setEnabled(false);
    int left = (Window.getClientWidth() - 300) / 2;
    int top = (Window.getClientHeight() - 200) / 2;
    setPopupPosition(left, top);
    setText(Main.i18n("logout.label"));
    show();
    Log.debug("Logout()");

    if (Main.get().mainPanel.bottomPanel.userInfo.isConnectedToChat()) {
        text.setText(Main.i18n("chat.logout"));
        disconnectChat();
    } else {
        text.setText(Main.i18n("logout.logout"));
        authService.logout(callbackLogout);
        Log.debug("Logout: void");
    }
}

From source file:com.ikon.frontend.client.widget.richtext.RichTextPopup.java

License:Open Source License

/**
 * Shows de popup//w  w  w  .j  a  v a2s . c  o m
 */
public void show() {
    url.setText("http://");
    int left = (Window.getClientWidth() - 300) / 2;
    int top = (Window.getClientHeight() - 125) / 2;
    setPopupPosition(left, top);
    super.show();
}

From source file:com.ikon.frontend.client.widget.searchin.FolderSelectPopup.java

License:Open Source License

/**
 * Shows the popup //from www  . j  ava  2 s.  c  om
 */
public void show(boolean categories) {
    this.categories = categories;
    int left = (Window.getClientWidth() - 300) / 2;
    int top = (Window.getClientHeight() - 200) / 2;
    setPopupPosition(left, top);

    if (categories) {
        setText(Main.i18n("search.category.filter"));
    } else {
        setText(Main.i18n("search.folder.filter"));
    }

    // Resets to initial tree value
    folderSelectTree.reset(categories);
    super.show();
}

From source file:com.ikon.frontend.client.widget.searchin.GroupPopup.java

License:Open Source License

/**
 * Show the popup error//from   w  ww.  j a  v  a 2 s .c  o m
 * 
 * @param msg Error message
 */
public void show() {
    int left = (Window.getClientWidth() - 300) / 2;
    int top = (Window.getClientHeight() - 100) / 2;
    setPopupPosition(left, top);
    setText(Main.i18n("group.label"));
    validate = -1;
    groupListBox.clear();
    propertyListBox.clear();
    propertyListBox.setVisible(false);
    propertyLabel.setVisible(false);
    getAllGroups(); // Gets all groups
    addButton.setEnabled(false);
    super.show();
}

From source file:com.ikon.frontend.client.widget.security.SecurityPopup.java

License:Open Source License

/**
 * Show the security popup/*from   www .j av a2s .  c om*/
 */
public void show(String path) {
    this.path = path;
    int left = (Window.getClientWidth() - width) / 2;
    int top = (Window.getClientHeight() - 400) / 2;
    setPopupPosition(left, top);
    setText(Main.i18n("security.label"));
    securityPanel.reset(path);
    change.setEnabled(false);
    super.show();

    // TODO:Solves minor bug with IE
    if (Util.getUserAgent().startsWith("ie")) {
        securityPanel.tabPanel.setWidth(String.valueOf(width));
        securityPanel.tabPanel.setWidth(String.valueOf((width + 1)));
    }

    // Fill width must be done on visible widgets
    securityPanel.fillWidth();
}

From source file:com.ikon.frontend.client.widget.startup.StartUpPopup.java

License:Open Source License

public StartUpPopup() {
    // Establishes auto-close when click outside
    super(false, true);

    vPanel = new VerticalPanel();
    status = new VerticalPanel();
    table = new FlexTable();
    button = new Button(Main.i18n("button.close"), this);
    scrollPanel = new ScrollPanel(status);
    scrollPanel.setAlwaysShowScrollBars(false);
    scrollPanel.setSize("490", "160");
    scrollPanel.setStyleName("okm-Input");

    status.setWidth("" + (490 - IE_SIZE_RECTIFICATION));

    vPanel.add(new HTML(" "));
    vPanel.add(scrollPanel);//from  w  w  w. j a  va  2  s .  c om
    vPanel.add(new HTML(" "));
    vPanel.add(table);
    vPanel.add(button);
    vPanel.add(new HTML(" "));

    button.setVisible(false);
    button.setStyleName("okm-YesButton");

    vPanel.setCellHorizontalAlignment(scrollPanel, HasAlignment.ALIGN_CENTER);
    vPanel.setCellHorizontalAlignment(table, HasAlignment.ALIGN_CENTER);
    vPanel.setCellHorizontalAlignment(button, HasAlignment.ALIGN_CENTER);
    vPanel.setCellVerticalAlignment(scrollPanel, HasAlignment.ALIGN_MIDDLE);

    int left = (Window.getClientWidth() - 510) / 2;
    int top = (Window.getClientHeight() - 220) / 2;
    vPanel.setWidth("510px");
    vPanel.setHeight("220px");

    for (int i = 0; i < StartUp.STARTUP_LOADING_HISTORY_SEARCH; i++) {
        table.setWidget(0, i, new Image(OKMBundleResources.INSTANCE.loadedDisabledIcon()));
    }

    setText(Main.i18n("startup.openkm"));
    setPopupPosition(left, top);
    setWidget(vPanel);
}

From source file:com.ikon.frontend.client.widget.thesaurus.ThesaurusSelectPopup.java

License:Open Source License

/**
 * Shows the popup // ww  w.  j  av  a 2  s. c o m
 */
public void show(int selectedFrom) {
    this.selectedFrom = selectedFrom;
    initButtons();
    int left = (Window.getClientWidth() - 400) / 2;
    int top = (Window.getClientHeight() - 325) / 2;
    setPopupPosition(left, top);
    setText(Main.i18n("thesaurus.directory.select.label"));

    // Resets to initial tree value
    thesaurusPanel.reset();

    center();
}