Package com.gwtext.client.widgets

Examples of com.gwtext.client.widgets.Window


    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


    private void showTextEditor(EventObject e,
                                final String dta,
                                final Record r,
                                String val,
                                DTColumnConfig colConf) {
        final Window w = new Window();
        w.setWidth( 200 );
        w.setAutoDestroy( true );
        w.setPlain( true );
        w.setBodyBorder( false );
        w.setTitle( dta );
        final TextBox box = new TextBox();
        box.setText( val );
        box.addKeyboardListener( new KeyboardListenerAdapter() {
            public void onKeyUp(Widget sender,
                                char keyCode,
                                int modifiers) {
                if ( keyCode == KeyboardListener.KEY_ENTER ) {
                    r.set( dta,
                           box.getText() );

                    w.destroy();
                }
            }
        } );

        if ( dt.isNumeric( colConf,
                           getSCE() ) ) {
            box.addKeyboardListener( ActionValueEditor.getNumericFilter( box ) );
        }

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

        Button ok = new Button( constants.OK() );
        ok.addClickListener( new ClickListener() {
            public void onClick(Widget wg) {
                r.set( dta,
                       box.getText() );
                w.destroy();
            }
        } );
        p.add( ok );

        w.setPosition( e.getPageX(),
                       e.getPageY() );
        w.show();
    }
View Full Code Here

        this.afterShowEvent = c;
    }

    public void show() {

        dialog = new Window();
        dialog.setAutoScroll( true );
        dialog.setModal( modal );
        dialog.setPlain( true );
        dialog.setConstrainHeader( true );
        dialog.setBodyBorder( false );
View Full Code Here



    private ErrorPopup(String message, String longMessage) {

      Window w = new Window();
      w.setTitle(constants.Error());
      w.setWidth(400);
      //w.setHeight((longMessage != null) ? 300 : 150);
      w.setModal(true);
      w.setShadow(true);
      w.setClosable(true);
      w.setPlain(true);

      w.setLayout(new VerticalLayout());
        body = new VerticalPanel();


        addMessage(message, longMessage);

        body.setWidth("100%");
        w.add(body);


       

        w.show();


        w.addListener(new WindowListenerAdapter() {
            @Override
            public void onDeactivate(Window window) {
                instance = null;
            }
        });
View Full Code Here

        this.afterShowEvent = c;
    }

    public void show() {

        dialog = new Window();
        dialog.setAutoScroll( true );
        dialog.setModal( modal );
        dialog.setPlain( true );
        dialog.setConstrainHeader( true );
        dialog.setBodyBorder( false );
View Full Code Here



    private ErrorPopup(String message, String longMessage) {

      Window w = new Window();
      w.setTitle(constants.Error());
      w.setWidth(400);
      //w.setHeight((longMessage != null) ? 300 : 150);
      w.setModal(true);
      w.setShadow(true);
      w.setClosable(true);
      w.setPlain(true);

      w.setLayout(new VerticalLayout());
        body = new VerticalPanel();


        addMessage(message, longMessage);

        body.setWidth("100%");
        w.add(body);


       

        w.show();


        w.addListener(new WindowListenerAdapter() {
            @Override
            public void onDeactivate(Window window) {
                instance = null;
            }
        });
View Full Code Here

    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

    private void showTextEditor(EventObject e,
                                final String dta,
                                final Record r,
                                String val,
                                DTColumnConfig colConf) {
        final Window w = new Window();
        w.setWidth( 200 );
        w.setAutoDestroy( true );
        w.setPlain( true );
        w.setBodyBorder( false );
        w.setTitle( dta );
       
        String typeDescription = dt.getType(colConf, getSCE());
        Panel p = new Panel();

        if (typeDescription != null
        && typeDescription.equals(SuggestionCompletionEngine.TYPE_DATE)) {
      final DatePickerTextBox datePicker = new DatePickerTextBox(val);
      String m = Format.format(((Constants) GWT.create(Constants.class))
          .ValueFor0(), dta);
      datePicker.setTitle(m);
      datePicker.addValueChanged(new ValueChanged() {
        public void valueChanged(String newValue) {
          r.set(dta, newValue);
        }
      });

      p.add(datePicker);
      p.add(new InfoPopup(constants.CategoryParentRules(), Format.format(
          constants.FillInColumnWithValue(), typeDescription)));

      w.add(p);
      w.setBorder(false);

      Button ok = new Button(constants.OK());
      ok.addClickHandler(new ClickHandler() {
        public void onClick(ClickEvent arg0) {
          r.set(dta, datePicker.getDateString());
          w.destroy();
        }
      });

      p.add(ok);
     
    } else {
      final TextBox box = new TextBox();
      box.setText(val);
      box.addKeyboardListener(new KeyboardListenerAdapter() {
        public void onKeyUp(Widget sender, char keyCode, int modifiers) {
          if (keyCode == KeyboardListener.KEY_ENTER) {
            r.set(dta, box.getText());
            w.destroy();
          }
        }
      });

      if (dt.isNumeric(colConf, getSCE())) {
        box.addKeyboardListener(ActionValueEditor
                .getNumericFilter(box));
      }

      p.add(box);
      if (typeDescription != null) {
        p.add(new InfoPopup(constants.CategoryParentRules(), Format
            .format(constants.FillInColumnWithValue(),
                typeDescription)));
      }
      w.add(p);
      w.setBorder(false);

      Button ok = new Button(constants.OK());
      ok.addClickListener(new ClickListener() {
        public void onClick(Widget wg) {
          r.set(dta, box.getText());
          w.destroy();
        }
      });
      p.add(ok);
    }

        w.setPosition( e.getPageX(),
                       e.getPageY() );
        w.show();
    }
View Full Code Here

    public ValueType getSearchedValueType() {
        return searchedValueType;
    }

    private void showSearchResults(String searchText) {
        final Window window = new Window();
        window.setTitle("Search results");
        window.setWidth(500);
        window.setHeight(365);
        window.setLayout(new FitLayout());

        FormPanel panel = new FormPanel();

        Button showInTreeButton = new Button("Select in tree", new ButtonListenerAdapter() {
            @Override
            public void onClick(Button button, EventObject e) {
                doSelect(searchGrid.getSelection());
            }
        });

        Button closeButton = new Button("Close", new ButtonListenerAdapter() {
            @Override
            public void onClick(Button button, EventObject e) {
                window.close(); // TODO: cancel existing search
                window.destroy();
            }
        });

        panel.add(searchGrid, new AnchorLayoutData("100% 100%"));
        panel.addButton(showInTreeButton);
        panel.addButton(closeButton);

        window.add(panel);

        searchGrid.getProxy().setValueType(getSearchedValueType());
        searchGrid.setSearchFieldText(searchText);

        if (searchText == null || searchText.trim().length() == 0) {
            searchGrid.getStore().removeAll();
        }
        else {
            searchGrid.reload(projectId, searchText, searchedValueType);
        }

        window.show();
    }
View Full Code Here

    /**
     * Creates Edit profile Popup
     */
    public void editProfile() {
        final Window win = new Window();
        FormPanel editProfileFormPanel = new FormPanel();

        Label label = new Label("Welcome. Please edit your profile information.");
        label.setStyleName("login-welcome-msg");

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

        editProfileFormPanel.add(editProfileTable);

        final UserId userId = Application.get().getUserId();
        final TextBox userNameTextBox = new TextBox();
        userNameTextBox.setWidth("250px");
        userNameTextBox.setEnabled(false);
        Label userNameLabel = new Label("User name:");
        userNameLabel.setStyleName("label");

        editProfileTable.setWidget(2, 0, userNameLabel);
        editProfileTable.setWidget(2, 1, userNameTextBox);

        if (!userId.isGuest()) {
            userNameTextBox.setText(userId.getUserName());
        }

        final HTML changePasswordHTML = new HTML(
                "&nbsp<b><span style='font-size:100%;text-decoration:underline;'>Click here to change your password</span></b>");
        changePasswordHTML.setStyleName("links-blue");
        //if else https
//        addChangePasswordHTMLClickHandler(changePasswordHTML);

        editProfileTable.setWidget(3, 1, changePasswordHTML);

        final TextBox userEmailTextBox = new TextBox();
        userEmailTextBox.setWidth("250px");
        Label emailIdLabel = new Label("Email:");
        emailIdLabel.setStyleName("label");
        editProfileTable.setWidget(4, 0, emailIdLabel);
        editProfileTable.setWidget(4, 1, userEmailTextBox);


        Label ontologyNotificationIdLabel = new Label("Notify me of ont. changes:");
        ontologyNotificationIdLabel.setStyleName("label");
        final ListBox ontologyNotificationListBox = new ListBox(false);
        ontologyNotificationListBox.setWidth("250px");
        ontologyNotificationListBox.addItem(NotificationInterval.NEVER.getValue());
        ontologyNotificationListBox.addItem(NotificationInterval.IMMEDIATELY.getValue());
        ontologyNotificationListBox.addItem(NotificationInterval.HOURLY.getValue());
        ontologyNotificationListBox.addItem(NotificationInterval.DAILY.getValue());
        ontologyNotificationListBox.setSelectedIndex(1);
        editProfileTable.setWidget(5, 0, ontologyNotificationIdLabel);
        editProfileTable.setWidget(5, 1, ontologyNotificationListBox);

        Label commentsNotificationIdLabel = new Label("Notify me of discussions:");
        commentsNotificationIdLabel.setStyleName("label");
        final ListBox commentsNotificationListBox = new ListBox(false);
        commentsNotificationListBox .setWidth("250px");
        commentsNotificationListBox.addItem(NotificationInterval.NEVER.getValue());
        commentsNotificationListBox.addItem(NotificationInterval.IMMEDIATELY.getValue());
        commentsNotificationListBox.addItem(NotificationInterval.HOURLY.getValue());
        commentsNotificationListBox.addItem(NotificationInterval.DAILY.getValue());
        commentsNotificationListBox.setSelectedIndex(1);
        editProfileTable.setWidget(6, 0, commentsNotificationIdLabel );
        editProfileTable.setWidget(6, 1, commentsNotificationListBox );

        Button okButton = new Button("Ok", new OkButtonListenerAdapter(win, userEmailTextBox, userNameTextBox, commentsNotificationListBox, ontologyNotificationListBox));

        Button cancelButton = new Button("Cancel", new ButtonListenerAdapter() {
            @Override
            public void onClick(Button button, EventObject e) {
                win.close();
            }
        });

        HorizontalPanel buttonPanel = new HorizontalPanel();
        buttonPanel.setSpacing(20);
        buttonPanel.add(okButton);
        buttonPanel.add(cancelButton);

        editProfileTable.setWidget(7, 1, buttonPanel);
        editProfileTable.getFlexCellFormatter()
                .setAlignment(7, 1, HasAlignment.ALIGN_CENTER, HasAlignment.ALIGN_MIDDLE);

        FlexTable topEditProfileTable = new FlexTable();
        topEditProfileTable.setWidget(0, 0, editProfileFormPanel);
        topEditProfileTable.getFlexCellFormatter().setAlignment(0, 0, HasAlignment.ALIGN_CENTER,
                HasAlignment.ALIGN_MIDDLE);
        Panel panel = new Panel();
        panel.setBorder(false);
        panel.setPaddings(15);
        panel.setCls("loginpanel");
        panel.setLayout(new FitLayout());
        win.setLayout(new FitLayout());

        panel.add(topEditProfileTable, new AnchorLayoutData("-100 30%"));

        win.setTitle("Edit Profile");
        win.setClosable(true);
        win.setWidth(408);
        win.setHeight(400);
        win.setClosable(true);
        win.setPaddings(7);
        win.setCloseAction(Window.HIDE);
        win.add(panel);
        if (!userId.isGuest()) {
            win.show();

            win.getEl().mask("Retrieving user email...");
            AdminServiceManager.getInstance().getUserEmail(userId, new RetrieveUserEmailHandler(win, userEmailTextBox));

            NotificationServiceManager.getInstance().getNotificationDelay(userId, new AsyncCallback<Map<NotificationType, NotificationInterval>>() {

                public void onSuccess(Map<NotificationType, NotificationInterval> notificationPreferences) {
                    win.getEl().unmask();
                    for (NotificationType type : notificationPreferences.keySet()) {
                        if (type.equals(NotificationType.ONTOLOGY)){
                            int i = 0;
                            while (i < ontologyNotificationListBox.getItemCount()){
                                final String s = ontologyNotificationListBox.getItemText(i);
                                if (notificationPreferences.get(type).getValue().equals(s)){
                                    ontologyNotificationListBox.setItemSelected(i, true);
                                }
                                i ++;
                            }
                        }
                        if (type.equals(NotificationType.COMMENT)){
                            int i = 0;
                            while (i < commentsNotificationListBox.getItemCount()){
                                final String s = commentsNotificationListBox.getItemText(i);
                                if (notificationPreferences.get(type).getValue().equals(s)){
                                    commentsNotificationListBox.setItemSelected(i, true);
                                }
                                i ++;
                            }
                        }
                    }
                }

                public void onFailure(Throwable caught) {
                    GWT.log("Error at Getting User Notification Preferences:", caught);
                    win.getEl().unmask();
                    MessageBox.alert("failed. Please try again. Message: " + caught.getMessage());
                    win.close();
                }
            });

//            final FlexTable editProfTable = editProfileTable;
            OpenIdServiceManager.getInstance().getUsersOpenId(userId.getUserName(), new GetUsersOpenIdHandler(win, editProfileTable));
View Full Code Here

TOP

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

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.