Package com.google.gwt.user.client.ui

Examples of com.google.gwt.user.client.ui.DisclosurePanel


   

    final CanvasViewMainPanel mainPanel = new CanvasViewMainPanel();

    final HorizontalPanel addItemPanel = new HorizontalPanel();
    final DisclosurePanel addDisclosurePanel = new DisclosurePanel(
        prefsUtils.getMsg("gadgetLabelAdd"));
    final TextArea message = new TextArea();
   
    message.setSize(GadgetNativeUtils.getGadgetWidth() / 2 + "px","200px");
   
    final VerticalPanel priority = new VerticalPanel();
    final RadioButton highPriority = new RadioButton("priorityFilter",
        prefsUtils.getMsg("gadgetLabelHigh"));
    final RadioButton medPriority = new RadioButton("priorityFilter",
        prefsUtils.getMsg("gadgetLabelMedium"));
    final RadioButton lowPriority = new RadioButton("priorityFilter",
        prefsUtils.getMsg("gadgetLabelLow"));
    lowPriority.setValue(true);
    priority.add(highPriority);
    priority.add(medPriority);
    priority.add(lowPriority);

    final Button saveButton = new Button(
        prefsUtils.getMsg("gadgetLabelSave"));
    final PrioritySelection selection = new PrioritySelection(
        viewPersonalNotesQry, viewPersonalNotesRequest);
    addItemPanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_BOTTOM);
    addItemPanel.add(message);
    addItemPanel.add(new HTML(" "));
    addItemPanel.add(priority);
    addItemPanel.add(new HTML(" "));
    addItemPanel.add(saveButton);
   
    /**  This code is designed to demonstrate a ("custom")request
    *  to a server side method that is defined on the Gadget level
    *  the name of the server side method is explicitly set "doDeleteAll"
    *  with the  setContentActoinName() method.
    *  @ see com.gadglet.gadgets.personalNotes.server.RequestHandler.deleteAll()
     
      to test enable both client and server-side code 
    */
   
   
    final Button deleteAllButton = new Button(prefsUtils.getMsg("gadgetLabelDelete")+ " " + prefsUtils.getMsg("gadgetLabelAll"));
    addItemPanel.add(UIUtils.getSpace());
    addItemPanel.add(deleteAllButton);
 
   
    deleteAllButton.addClickHandler(new ClickHandler() {
      @Override
      public void onClick(ClickEvent event) {
        changePersonalNoteQry.setContentActoinName("doDeleteAll");
        changePersonalNoteQry.clearParamList();


        addDeletePersonalNoteRequest.makeRequest();
   

      }
    });

    addDisclosurePanel.add(addItemPanel);
    addDisclosurePanel.setHeader(new HTML(prefsUtils
        .getMsg("gadgetLabelAdd")));

    mainPanel.add(addDisclosurePanel);

    mainPanel.add(selection.getPanel());
View Full Code Here


    }

    final CanvasViewMainPanel mainPanel = new CanvasViewMainPanel();

    final HorizontalPanel addItemPanel = new HorizontalPanel();
    final DisclosurePanel addDisclosurePanel = new DisclosurePanel();

    ActionLabel add = new ActionLabel(prefsUtils.getMsg("gadgetLabelNew"));
    add.setTitle(prefsUtils.getMsg("gadgetLabelNew"));

    addDisclosurePanel.setHeader(add);

    final VerticalPanel bookMark = new VerticalPanel();

    final TextArea discssionText = new TextArea();
    discssionText.setWidth("400px");

    bookMark.add(discssionText);

    final Button saveButton = new Button(
        prefsUtils.getMsg("gadgetLabelSave"));

    addItemPanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_BOTTOM);
    addItemPanel.add(bookMark);

    addItemPanel.add(new HTML(" "));
    addItemPanel.add(saveButton);

    addDisclosurePanel.add(addItemPanel);

    mainPanel.add(addDisclosurePanel);
   
    mainPanel.add(viewAll);
View Full Code Here

    add.setTitle(prefsUtils.getMsg("gadgetLabelAdd"));

    final CanvasViewMainPanel mainPanel = new CanvasViewMainPanel();

    final HorizontalPanel addItemPanel = new HorizontalPanel();
    final DisclosurePanel addDisclosurePanel = new DisclosurePanel();
   
    addDisclosurePanel.setHeader(add);

   
    final TextArea message = new TextArea();
   
    message.setSize(GadgetNativeUtils.getGadgetWidth() / 2 + "px","200px");
   
    final VerticalPanel priority = new VerticalPanel();
    final RadioButton highPriority = new RadioButton("priorityFilter",
        prefsUtils.getMsg("gadgetLabelHigh"));
    final RadioButton medPriority = new RadioButton("priorityFilter",
        prefsUtils.getMsg("gadgetLabelMedium"));
    final RadioButton lowPriority = new RadioButton("priorityFilter",
        prefsUtils.getMsg("gadgetLabelLow"));
    lowPriority.setValue(true);
    priority.add(highPriority);
    priority.add(medPriority);
    priority.add(lowPriority);

    final Button saveButton = new Button(
        prefsUtils.getMsg("gadgetLabelSave"));
    final PrioritySelection selection = new PrioritySelection(
        viewPersonalNotesQry, viewPersonalNotesRequest);
    addItemPanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_BOTTOM);
    addItemPanel.add(message);
    addItemPanel.add(new HTML(" "));
    addItemPanel.add(priority);
    addItemPanel.add(new HTML(" "));
    addItemPanel.add(saveButton);
   
    /**  This code is designed to demonstrate a ("custom")request
    *  to a server side method that is defined on the Gadget level
    *  the name of the server side method is explicitly set "doDeleteAll"
    *  with the  setContentActoinName() method.
    *  @ see com.gadglet.gadgets.personalNotesApps.server.RequestHandler.deleteAll()
     
      to test enable both client and server-side code 
    */
   
   
    final Button deleteAllButton = new Button(prefsUtils.getMsg("gadgetLabelDelete")+ " " + prefsUtils.getMsg("gadgetLabelAll"));
    addItemPanel.add(UIUtils.getSpace());
    addItemPanel.add(deleteAllButton);
 
   
    deleteAllButton.addClickHandler(new ClickHandler() {
      @Override
      public void onClick(ClickEvent event) {
        changePersonalNoteQry.setContentActoinName("doDeleteAll");
        changePersonalNoteQry.clearParamList();


        addDeletePersonalNoteRequest.makeRequest();
   

      }
    });
   

    addDisclosurePanel.add(addItemPanel);

    mainPanel.add(addDisclosurePanel);

    mainPanel.add(selection.getPanel());

View Full Code Here

    ActionLabel add = new ActionLabel(prefsUtils.getMsg("gadgetLabelAdd"));
    add.setTitle(prefsUtils.getMsg("gadgetLabelAdd"));
   
    final HorizontalPanel addItemPanel = new HorizontalPanel();
    final DisclosurePanel addDisclosurePanel = new DisclosurePanel();
    addDisclosurePanel.setHeader(add);
   
    final TextArea message = new TextArea();

    final VerticalPanel priority = new VerticalPanel();
    final RadioButton highPriority = new RadioButton("priorityFilter",
        prefsUtils.getMsg("gadgetLabelHigh"));
    final RadioButton medPriority = new RadioButton("priorityFilter",
        prefsUtils.getMsg("gadgetLabelMedium"));
    final RadioButton lowPriority = new RadioButton("priorityFilter",
        prefsUtils.getMsg("gadgetLabelLow"));
    lowPriority.setValue(true);
    priority.add(highPriority);
    priority.add(medPriority);
    priority.add(lowPriority);

    final Button saveButton = new Button(
        prefsUtils.getMsg("gadgetLabelSave"));

    final PrioritySelection selection = new PrioritySelection(
        viewPersonalNotesQry, viewPersonalNotesRequest);
    addItemPanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_BOTTOM);
    addItemPanel.add(message);
    addItemPanel.add(new HTML(" "));
    addItemPanel.add(priority);
    addItemPanel.add(new HTML(" "));
    addItemPanel.add(saveButton);

    addDisclosurePanel.add(addItemPanel);


    mainPanel.add(addDisclosurePanel);

    mainPanel.add(selection.getPanel());
View Full Code Here

          String.valueOf(test.getInternalId()));
    }
    VerticalPanel addForm = new VerticalPanel();
    addForm.add(options);

    final DisclosurePanel disclosure = new DisclosurePanel();
    Button button = new Button(" Add ", new ClickHandler() {
        @Override
        public void onClick(ClickEvent event) {
          long id = Long.parseLong((options.getValue(options.getSelectedIndex())));
          presenter.assignTestCaseToCapability(capability.getCapabilityId(), id);
          disclosure.setOpen(false);
          TestCase test = getTestCaseById(id);
          test.setTargetCapabilityId(capability.getCapabilityId());
          refresh();
        }
      });
    addForm.add(button);
    disclosure.setAnimationEnabled(true);
    disclosure.setOpen(false);
    disclosure.setContent(addForm);

    HorizontalPanel title = new HorizontalPanel();
    title.add(new Label(header));
    addTestAnchor = new Anchor(addText);
    addTestAnchor.addClickHandler(new ClickHandler() {
        @Override
        public void onClick(ClickEvent event) {
          disclosure.setOpen(!disclosure.isOpen());
        }
      });
    addTestAnchor.setVisible(isEditable);
    title.add(addTestAnchor);
View Full Code Here

          String.valueOf(bug.getInternalId()));
    }
    VerticalPanel addForm = new VerticalPanel();
    addForm.add(options);

    final DisclosurePanel disclosure = new DisclosurePanel();
    Button button = new Button(" Add ", new ClickHandler() {
        @Override
        public void onClick(ClickEvent event) {
          long id = Long.parseLong((options.getValue(options.getSelectedIndex())));
          presenter.assignBugToCapability(capability.getCapabilityId(), id);
          disclosure.setOpen(false);
          Bug bug = getBugById(id);
          bug.setTargetCapabilityId(capability.getCapabilityId());
          refresh();
        }
      });
    addForm.add(button);
    disclosure.setAnimationEnabled(true);
    disclosure.setOpen(false);
    disclosure.setContent(addForm);

    HorizontalPanel title = new HorizontalPanel();
    title.add(new Label(header));
    addBugAnchor = new Anchor(addText);
    addBugAnchor.addClickHandler(new ClickHandler() {
        @Override
        public void onClick(ClickEvent event) {
          disclosure.setOpen(!disclosure.isOpen());
        }
      });
    addBugAnchor.setVisible(isEditable);
    title.add(addBugAnchor);
View Full Code Here

          String.valueOf(checkin.getInternalId()));
    }
    VerticalPanel addForm = new VerticalPanel();
    addForm.add(options);

    final DisclosurePanel disclosure = new DisclosurePanel();
    Button button = new Button(" Add ", new ClickHandler() {
        @Override
        public void onClick(ClickEvent event) {
          long id = Long.parseLong((options.getValue(options.getSelectedIndex())));
          presenter.assignCheckinToCapability(capability.getCapabilityId(), id);
          disclosure.setOpen(false);
          Checkin checkin = getCheckinById(id);
          checkin.setTargetCapabilityId(capability.getCapabilityId());
          refresh();
        }
      });
    addForm.add(button);
    disclosure.setAnimationEnabled(true);
    disclosure.setOpen(false);
    disclosure.setContent(addForm);

    HorizontalPanel title = new HorizontalPanel();
    title.add(new Label(header));
    addCheckinAnchor = new Anchor(addText);
    addCheckinAnchor.addClickHandler(new ClickHandler() {
        @Override
        public void onClick(ClickEvent event) {
          disclosure.setOpen(!disclosure.isOpen());
        }
      });
    addCheckinAnchor.setVisible(isEditable);
    title.add(addCheckinAnchor);
View Full Code Here

    spacer = new VerticalPanel();
    spacer.setHeight( "4px" );
    rootPanel.add( spacer );

    DisclosurePanel disclosurePanel = new DisclosurePanel( Messages.getString( "advancedOptions" ) );
    disclosurePanel.getHeader().setStyleName( "gwt-Label" );
    HorizontalPanel mainPanel = new HorizontalPanel();
    mainPanel.add( new HTML( " " ) );
    VerticalPanel disclosureContent = new VerticalPanel();

    HTML replaceLabel = new HTML( Messages.getString( "fileExists" ) );
    replaceLabel.setStyleName( "gwt-Label" );
    disclosureContent.add( replaceLabel );

    final CustomListBox overwriteFileDropDown = new CustomListBox();
    final CustomListBox filePermissionsDropDown = new CustomListBox();

    DefaultListItem replaceListItem = new DefaultListItem( Messages.getString( "replaceFile" ) );
    replaceListItem.setValue( "true" );
    overwriteFileDropDown.addItem( replaceListItem );
    DefaultListItem doNotImportListItem = new DefaultListItem( Messages.getString( "doNotImport" ) );
    doNotImportListItem.setValue( "false" );
    overwriteFileDropDown.addItem( doNotImportListItem );
    overwriteFileDropDown.setVisibleRowCount( 1 );
    disclosureContent.add( overwriteFileDropDown );

    spacer = new VerticalPanel();
    spacer.setHeight( "4px" );
    disclosureContent.add( spacer );

    HTML filePermissionsLabel = new HTML( Messages.getString( "filePermissions" ) );
    filePermissionsLabel.setStyleName( "gwt-Label" );
    disclosureContent.add( filePermissionsLabel );

    DefaultListItem usePermissionsListItem = new DefaultListItem( Messages.getString( "usePermissions" ) );
    usePermissionsListItem.setValue( "false" );
    filePermissionsDropDown.addItem( usePermissionsListItem ); // If selected set "overwriteAclPermissions" to
    // false.
    DefaultListItem retainPermissionsListItem = new DefaultListItem( Messages.getString( "retainPermissions" ) );
    retainPermissionsListItem.setValue( "true" );
    filePermissionsDropDown.addItem( retainPermissionsListItem ); // If selected set "overwriteAclPermissions" to
    // true.

    final ChangeListener filePermissionsHandler = new ChangeListener() {
      @Override
      public void onChange( Widget sender ) {
        String value = filePermissionsDropDown.getSelectedItem().getValue().toString();

        applyAclPermissions.setValue( Boolean.valueOf( value ) );
        applyAclPermissions.setFormValue( value );
        overwriteAclPermissions.setFormValue( value );
        overwriteAclPermissions.setValue( Boolean.valueOf( value ) );
        setRetainOwnershipState();
      }
    };
    filePermissionsDropDown.addChangeListener( filePermissionsHandler );
    filePermissionsDropDown.setVisibleRowCount( 1 );
    disclosureContent.add( filePermissionsDropDown );

    spacer = new VerticalPanel();
    spacer.setHeight( "4px" );
    disclosureContent.add( spacer );

    HTML fileOwnershipLabel = new HTML( Messages.getString( "fileOwnership" ) );
    fileOwnershipLabel.setStyleName( "gwt-Label" );
    disclosureContent.add( fileOwnershipLabel );

    retainOwnershipDropDown.addChangeListener( new ChangeListener() {
      @Override
      public void onChange( Widget sender ) {
        String value = retainOwnershipDropDown.getSelectedItem().getValue().toString();
        retainOwnership.setValue( value );
      }
    } );
    DefaultListItem keepOwnershipListItem = new DefaultListItem( Messages.getString( "keepOwnership" ) );
    keepOwnershipListItem.setValue( "true" );
    retainOwnershipDropDown.addItem( keepOwnershipListItem );
    DefaultListItem assignOwnershipListItem = new DefaultListItem( Messages.getString( "assignOwnership" ) );
    assignOwnershipListItem.setValue( "false" );
    retainOwnershipDropDown.addItem( assignOwnershipListItem );

    retainOwnershipDropDown.setVisibleRowCount( 1 );
    disclosureContent.add( retainOwnershipDropDown );

    spacer = new VerticalPanel();
    spacer.setHeight( "4px" );
    disclosureContent.add( spacer );

    ChangeListener overwriteFileHandler = new ChangeListener() {
      @Override
      public void onChange( Widget sender ) {
        String value = overwriteFileDropDown.getSelectedItem().getValue().toString();
        overwriteFile.setValue( value );
      }
    };
    overwriteFileDropDown.addChangeListener( overwriteFileHandler );

    HTML loggingLabel = new HTML( Messages.getString( "logging" ) );
    loggingLabel.setStyleName( "gwt-Label" );
    disclosureContent.add( loggingLabel );

    final CustomListBox loggingDropDown = new CustomListBox();
    loggingDropDown.addChangeListener( new ChangeListener() {
      public void onChange( Widget sender ) {
        String value = loggingDropDown.getSelectedItem().getValue().toString();
        logLevel.setValue( value );
      }
    } );
    DefaultListItem noneListItem = new DefaultListItem( Messages.getString( "none" ) );
    noneListItem.setValue( "ERROR" );
    loggingDropDown.addItem( noneListItem );
    DefaultListItem shortListItem = new DefaultListItem( Messages.getString( "short" ) );
    shortListItem.setValue( "WARN" );
    loggingDropDown.addItem( shortListItem );
    DefaultListItem debugListItem = new DefaultListItem( Messages.getString( "verbose" ) );
    debugListItem.setValue( "TRACE" );
    loggingDropDown.addItem( debugListItem );
    loggingDropDown.setVisibleRowCount( 1 );
    disclosureContent.add( loggingDropDown );

    mainPanel.add( disclosureContent );
    disclosurePanel.setContent( mainPanel );
    rootPanel.add( disclosurePanel );

    importDir.setName( "importDir" );
    importDir.setText( repositoryFile.getPath() );
    importDir.setVisible( false );
View Full Code Here

    advancedOptions.setWidget(0, 1, new TextBox());
    advancedOptions.setHTML(1, 0, constants.cwDisclosurePanelFormGender());
    advancedOptions.setWidget(1, 1, genderPanel);

    // Add advanced options to form in a disclosure panel
    DisclosurePanel advancedDisclosure = new DisclosurePanel(
        constants.cwDisclosurePanelFormAdvancedCriteria());
    advancedDisclosure.setAnimationEnabled(true);
    advancedDisclosure.ensureDebugId("cwDisclosurePanel");
    advancedDisclosure.setContent(advancedOptions);
    layout.setWidget(3, 0, advancedDisclosure);
    cellFormatter.setColSpan(3, 0, 2);

    // Wrap the contents in a DecoratorPanel
    DecoratorPanel decPanel = new DecoratorPanel();
View Full Code Here

  public boolean hasCSS() {
    return false;
  }

  DisclosurePanel createDisclosurePanel(final String name) {
    DisclosurePanel widget = new DisclosurePanel();
    widget.setContent(new HTML("content for " + name));
    widget.setTitle(name);
    widget.setHeader(new CheckBox(name));
    class MyHandler implements DisclosureHandler, OpenHandler<DisclosurePanel>,
        CloseHandler<DisclosurePanel> {

      public void onClose(CloseEvent<DisclosurePanel> event) {
        report(event);
      }

      public void onClose(DisclosureEvent event) {
        report(name + "close");
      }

      public void onOpen(DisclosureEvent event) {
        report(name + "open");
      }

      public void onOpen(OpenEvent<DisclosurePanel> event) {
        report(event);
      }
    }
    MyHandler handler = new MyHandler();
    widget.addCloseHandler(handler);
    widget.addOpenHandler(handler);
    widget.addEventHandler(handler);
    return widget;
  }
View Full Code Here

TOP

Related Classes of com.google.gwt.user.client.ui.DisclosurePanel

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.