Package com.gwtext.client.widgets

Examples of com.gwtext.client.widgets.Window$CloseAction


    public String getBpRestBase() {
        return bpRestBase;
    }

    public void showPopup(String title) {
        window = new Window();
        window.setSize(600, 470);
        window.setTitle(title);
        window.setLayout(new FitLayout());
        window.setClosable(true);
        window.setPaddings(7);
View Full Code Here


     */
    public void init() {

        inviteeListFlexTable = new FlexTable();

        invitationWindow = new Window();

        sendInvitationButton = new Button("Invite");
    }
View Full Code Here

    public static void selectClses(Project project, boolean allowMultiple, final SelectionCallback callback) {
        final Collection<EntityData> selection = new HashSet<EntityData>();

        final ClassSelectionPanel classSelectionPanel = new ClassSelectionPanel(project, allowMultiple);
        final Window selectWindow = new com.gwtext.client.widgets.Window();
        selectWindow.setTitle("Select class");
        selectWindow.setWidth(600);
        selectWindow.setHeight(480);
        selectWindow.setMinWidth(300);
        selectWindow.setMinHeight(350);
        selectWindow.setLayout(new FitLayout());
        selectWindow.setPaddings(5);
        selectWindow.setButtonAlign(Position.CENTER);

        selectWindow.setPlain(true);

        com.gwtext.client.widgets.Button cancelButton = new com.gwtext.client.widgets.Button("Cancel");
        cancelButton.addListener(new ButtonListenerAdapter() {
            @Override
            public void onClick(Button button, EventObject e) {
                selectWindow.hide();
                selectWindow.destroy();
            }
        });

        com.gwtext.client.widgets.Button selectButton = new com.gwtext.client.widgets.Button("Select");
        selectButton.addListener(new ButtonListenerAdapter() {
            @Override
            public void onClick(Button button, EventObject e) {
                Collection<EntityData> tmpselection = classSelectionPanel.getSelection();
                if (tmpselection == null || tmpselection.size() == 0) {
                    MessageBox.alert("No selection", "No class selected. Please select a class from the tree.");
                    return;
                } else {
                    for (EntityData sel : tmpselection) {
                        selection.add(sel);
                    }
                    if (callback != null) {
                        callback.onSelect(selection);
                    }
                }
                selectWindow.hide();
                selectWindow.destroy();
            }
        });

        selectWindow.add((Component)classSelectionPanel.getSelectable());
        selectWindow.addButton(selectButton);
        selectWindow.addButton(cancelButton);

        selectWindow.show();
        selectWindow.center();
    }
View Full Code Here

    }


    public static void selectIndividuals(Project project, Collection<EntityData> clses, boolean allowMultiple, boolean showClsesPanel, final SelectionCallback callback) {
        final IndividualsWithClassSelectionPanel classSelectionPanel = new IndividualsWithClassSelectionPanel(project, clses, allowMultiple, showClsesPanel);
        final Window selectWindow = new com.gwtext.client.widgets.Window();
        selectWindow.setTitle("Select individuals");
        selectWindow.setWidth(800);
        selectWindow.setHeight(500);
        selectWindow.setLayout(new FitLayout());
        selectWindow.setPaddings(5);
        selectWindow.setButtonAlign(Position.CENTER);
        selectWindow.setPlain(true);

        com.gwtext.client.widgets.Button cancelButton = new com.gwtext.client.widgets.Button("Cancel");
        cancelButton.addListener(new ButtonListenerAdapter() {
            @Override
            public void onClick(Button button, EventObject e) {
                selectWindow.hide();
                selectWindow.destroy();
            }
        });

        com.gwtext.client.widgets.Button selectButton = new com.gwtext.client.widgets.Button("Select");
        selectButton.addListener(new ButtonListenerAdapter() {
            @Override
            public void onClick(Button button, EventObject e) {
                Collection<EntityData> tmpselection = classSelectionPanel.getSelection();
                if (tmpselection == null || tmpselection.size() == 0) {
                    MessageBox.alert("No selection", "No entity selected. Please make a selection in the right panel.");
                    return;
                } else {
                    final Collection<EntityData> selection = new HashSet<EntityData>();
                    for (EntityData sel : tmpselection) {
                        selection.add(sel);
                    }
                    if (callback != null) {
                        callback.onSelect(selection);
                    }
                }
                selectWindow.hide();
                selectWindow.destroy();
            }
        });

        selectWindow.add(classSelectionPanel);
        selectWindow.addButton(selectButton);
        selectWindow.addButton(cancelButton);

        selectWindow.show();
        selectWindow.center();
    }
View Full Code Here

        this.ontologyIdPropertyName =  (String)bpSearchProperties.get(BioPortalConstants.CONFIG_PROPERTY_ONTOLGY_ID_PROPERTY);
        this.conceptIdPropertyName =  (String)bpSearchProperties.get(BioPortalConstants.CONFIG_PROPERTY_CONCEPT_ID_PROPERTY);
    }

    private void onAddNewReference(String string) {
        Window window = getSelectionWindow();
        window.show();
    }
View Full Code Here

        Window window = getSelectionWindow();
        window.show();
    }

    private void onReplaceReference(String string) {
        Window window = getSelectionWindow();
        window.show();
    }
View Full Code Here

        window.show();
    }

    protected Window getSelectionWindow() {
        if (selectWindow == null) {
            selectWindow = new Window();
            selectWindow.setTitle("Select values");
            selectWindow.setWidth(600);
            selectWindow.setHeight(480);
            selectWindow.setMinWidth(300);
            selectWindow.setMinHeight(350);
View Full Code Here

    /**
     * Creates and displays invitation window when user clicks invitation URL.
     * @param invitationId
     */
    public void updateInvitationAccount(final String invitationId) {
        final Window win = new Window();
        FormPanel newUserformPanel = new FormPanel();

        Label label = new Label("Welcome! Please enter your Name and Password");
        label.setStyleName("login-welcome-msg");

        FlexTable newUserTable = new FlexTable();
        newUserTable.setWidget(0, 0, label);
        newUserTable.getFlexCellFormatter().setColSpan(0, 0, 2);
        newUserTable.getFlexCellFormatter().setHeight(1, 0, "15px");
        newUserTable.getFlexCellFormatter().setHeight(2, 0, "25px");
        newUserTable.getFlexCellFormatter().setHeight(3, 0, "25px");
        newUserTable.getFlexCellFormatter().setHeight(4, 0, "25px");
        newUserTable.getFlexCellFormatter().setHeight(5, 0, "25px");
        newUserTable.getFlexCellFormatter().setHeight(6, 0, "50px");
        newUserformPanel.add(newUserTable);

        final TextBox newUserID = new TextBox();
        newUserID.setWidth("250px");
        Label userIdLabel = new Label("User ID:");
        userIdLabel.setStyleName("label");
        newUserTable.setWidget(2, 0, userIdLabel);
        newUserTable.setWidget(2, 1, newUserID);

        final TextBox newUserEmailID = new TextBox();
        newUserEmailID.setWidth("250px");
        newUserEmailID.setEnabled(false);
        newUserEmailID.setText(invitationId);
        Label emailIDLabel = new Label("Email:");
        emailIDLabel.setStyleName("label");
        newUserTable.setWidget(3, 0, emailIDLabel);
        newUserTable.setWidget(3, 1, newUserEmailID);

        final PasswordTextBox newUserPassword = new PasswordTextBox();
        newUserPassword.setWidth("250px");
        Label newPasswordLabel = new Label("New Password:");
        newPasswordLabel.setStyleName("label");
        newUserTable.setWidget(4, 0, newPasswordLabel);
        newUserTable.setWidget(4, 1, newUserPassword);

        final PasswordTextBox confirmPassword = new PasswordTextBox();
        confirmPassword.setWidth("250px");
        Label newConfirmPassLabel = new Label("Confirm Password:");
        newConfirmPassLabel.setStyleName("label");
        newUserTable.setWidget(5, 0, newConfirmPassLabel);
        newUserTable.setWidget(5, 1, confirmPassword);

        confirmPassword.addKeyDownHandler(new KeyDownHandler() {
            public void onKeyDown(KeyDownEvent event) {
                if (event.getNativeKeyCode() == KeyCodes.KEY_ENTER) {
                    if (newUserEmailID.getText().trim().equals("") || newUserPassword.getText().trim().equals("")
                            || confirmPassword.getText().trim().equals("")) {
                        MessageBox.showAlert("User ID and Password both are required.");
                    } else {

                        updateInvitationTemporaryAccount(newUserID.getText(), newUserPassword, confirmPassword,
                                invitationId, win);

                    }
                }
            }
        });

        com.gwtext.client.widgets.Button register = new com.gwtext.client.widgets.Button("Register", new ButtonListenerAdapter() {
            @Override
            public void onClick(com.gwtext.client.widgets.Button button, EventObject e) {
                if (newUserEmailID.getText().trim().equals("") || newUserPassword.getText().trim().equals("")
                        || confirmPassword.getText().trim().equals("")) {
                    MessageBox.showAlert("User ID and Password both are required.");
                } else {

                    updateInvitationTemporaryAccount(newUserID.getText(), newUserPassword, confirmPassword,
                            invitationId, win);

                }
            }
        });

        com.gwtext.client.widgets.Button cancel = new com.gwtext.client.widgets.Button("Cancel", new ButtonListenerAdapter() {
            @Override
            public void onClick(com.gwtext.client.widgets.Button button, EventObject e) {
                win.close();
            }
        });

        HorizontalPanel buttonPanel = new HorizontalPanel();
        buttonPanel.add(register);
        HorizontalPanel spacingPanel = new HorizontalPanel();
        spacingPanel.setWidth("20px");
        buttonPanel.add(spacingPanel);
        buttonPanel.add(cancel);

        newUserTable.setWidget(6, 1, buttonPanel);
        newUserTable.getFlexCellFormatter().setAlignment(6, 1, HasAlignment.ALIGN_CENTER, HasAlignment.ALIGN_MIDDLE);

        win.setTitle("Invitation Account Registration");
        win.setClosable(true);
        win.setWidth(428);
        win.setHeight(240);
        win.setClosable(true);
        win.setPaddings(7);
        win.setCloseAction(Window.HIDE);
        win.add(newUserformPanel);
        win.show();
    }
View Full Code Here

        });
        return addLink;
    }

    protected void onSelectEntity() {
        final Window window = new Window();
        window.setTitle("Select value");
        window.setClosable(true);
        window.setPaddings(7);
        window.setWidth(250);
        window.setHeight(350);
        window.setLayout(new FitLayout());
        //window.setCloseAction(Window.HIDE);
        window.add(new SelectionDialog(window, createSelectable()));
        window.show();
    }
View Full Code Here

  /**
   * Show a drop down editor, obviously.
   */

  private void showDropDownEditor(EventObject e, final String dataIdx, final Record r, String val, String[] vals) {
    final Window w = new Window();
    w.setWidth(200);
    w.setPlain(true);
    w.setBodyBorder(false);
    w.setAutoDestroy(true);
    w.setTitle(dataIdx);
    final ListBox drop = new ListBox();
    for (int i = 0; i < vals.length; i++) {
      String v = vals[i].trim();
            if (v.indexOf('=') > 0) {
                String[] splut = ConstraintValueEditorHelper.splitValue(v);
                drop.addItem(splut[1], splut[0]);
                if (splut[0].equals(val)) {
            drop.setSelectedIndex(i);
          }
            } else {
          drop.addItem(v, v);
                if (v.equals(val)) {
            drop.setSelectedIndex(i);
          }
            }

    }
    drop.addKeyboardListener(new KeyboardListenerAdapter() {
      public void onKeyUp(Widget sender, char keyCode,
          int modifiers) {
        if (keyCode == KeyboardListener.KEY_ENTER) {
          r.set(dataIdx, drop.getValue(drop.getSelectedIndex()));
          w.destroy();
        }
      }
    });




    Panel p = new Panel();
    p.add(drop);
    w.add(p);
    w.setBorder(false);

    Button ok = new Button(constants.OK());
    ok.addClickListener(new ClickListener() {
      public void onClick(Widget wg) {
        r.set(dataIdx, drop.getValue(drop.getSelectedIndex()));
        w.destroy();
      }
    });
    p.add(ok);

    w.setPosition(e.getPageX(), e.getPageY());
    w.show();

  }
View Full Code Here

TOP

Related Classes of com.gwtext.client.widgets.Window$CloseAction

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.