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

Examples of com.google.gwt.user.client.ui.TreeItem$ContentPanel


        public void onClick(Widget sender) {             
          method.addRequest(new RequestNode(method, method.getApplication()));         
          listRequest(method, methodTreeItem);         
        }
      });
      TreeItem addRequestTreeItem = new TreeItem(addRequestButton);
      addRequestTreeItem.setUserObject(WadlXml.requestNode);
      methodTreeItem.addItem(addRequestTreeItem);
      return;
    }
    RequestItem requestItem = new RequestItem(method, methodTreeItem);
    TreeItem requestTreeItem = new TreeItem(requestItem);
    requestTreeItem.setUserObject(WadlXml.requestNode);   
    methodTreeItem.addItem(requestTreeItem);
    methodTreeItem.setState(SettingsDialog.treeItemsAlwaysOpen);   
   
    // check whether the request came from an analyzed uri...
    String requestString = "";
    if (request.getApplication() != null) {
      requestString = request.getApplication().getAnalyzer().getRequestString();
    }       
    ParamItem.listParams(
        request,
        requestTreeItem,
        requestString);
       
    // representations
    RepresentationItem.listRepresentations(request, requestTreeItem)
   
    // close request item
    GenericClosingItem requestCloseItem = new GenericClosingItem(WadlXml.requestNode);
    TreeItem requestCloseTreeItem = new TreeItem(requestCloseItem);
    requestCloseTreeItem.setUserObject(WadlXml.requestNode);
    methodTreeItem.addItem(requestCloseTreeItem);
   
    WadlTreeRoot.addButtons(buttonTreeItems, methodTreeItem);
   
    methodTreeItem.setState(SettingsDialog.treeItemsAlwaysOpen);
View Full Code Here


  /**
   * Creates the request parameter tree
   * @return The request parameter tree
   */
  public void buildTree() {       
    requestItem = new TreeItem();   
    requestTree.addItem(requestItem);
   
    updateTree();
   
    // reanalyze button
View Full Code Here

       
    String[] queryParameters = uri.getQueryParameters();
    String[] queryValues = uri.getQueryValues();    
    for (int i = 0; i < queryParameters.length; i++) {
      final HorizontalPanel containerPanel = new HorizontalPanel();
      final TreeItem parameterItem = new TreeItem(containerPanel);
      // parameter name label
      HTML parameterName = new HTML("<nobr/>" + queryParameters[i] + " =&nbsp;</nobr>");           
      containerPanel.add(parameterName);
      // parameter value textbox
      final TextBox queryValueTextBox = new TextBox();
      queryValueTextBox.setWidth("10em");
      queryValueTextBox.setText(queryValues[i]);
      // track parameter value changes
      final String currentParameter = queryParameters[i];     
      queryValueTextBox.addKeyboardListener(new KeyboardListener() {
        public void onKeyDown(Widget sender, char keyCode, int modifiers) {
          // empty
        }

        public void onKeyPress(Widget sender, char keyCode, int modifiers) {
          // empty
        }

        public void onKeyUp(Widget sender, char keyCode, int modifiers) {
          updateParameterValue(currentParameter, queryValueTextBox.getText());
        }       
      });
      queryValueTextBox.addChangeListener(new ChangeListener() {
        public void onChange(Widget sender) {
          updateParameterValue(currentParameter, queryValueTextBox.getText());
        }
      });
      containerPanel.add(queryValueTextBox);
     
      // remove parameter link
      Hyperlink removeParameterLink = new Hyperlink(GuiFactory.strings.remove(), true, "");
      removeParameterLink.addClickListener(new ClickListener() {
        public void onClick(Widget sender) {
          removeHyperlink(parameterItem, queryValueTextBox.getText());
        }
      });
      containerPanel.add(removeParameterLink);     
      requestItem.addItem(parameterItem);
      parameterItem.setState(true);
    }   
    requestItem.setState(true);   
  }
View Full Code Here

   */
  public void addParam() {
    TextBox requestUriTextBox = ReferenceManager.getRequestUriTextBox(requestString);
    Uri uri = new Uri(requestUriTextBox.getText());   
    final HorizontalPanel containerPanel = new HorizontalPanel();
    final TreeItem parameterItem = new TreeItem(containerPanel);
    // parameter name textbox
    final TextBox queryParamNameTextBox = new TextBox();
    queryParamNameTextBox.setWidth("10em");
    // parameter value textbox
    final TextBox queryValueTextBox = new TextBox();
    queryValueTextBox.setWidth("10em");
    final String currentParameter = GuiFactory.strings.paramName();
    final String currentValue = GuiFactory.strings.paramValue();   
    String newUri = uri.getScheme() + "://" + uri.getAuthority() + uri.getPath() + "?";
    String[] queryParameters = uri.getQueryParameters();
    String[] queryValues = uri.getQueryValues();
    for (int i = 0; i < queryParameters.length; i++) {
      if (i > 0) {
        newUri += "&";       
      }
      newUri += queryParameters[i] + "=" + queryValues[i];      
    }
    newUri += "&" + currentParameter + "=" + currentValue + uri.getFragment();
    updateReferences(requestUriTextBox, newUri);   
    queryParamNameTextBox.addKeyboardListener(new KeyboardListener() {
      public void onKeyDown(Widget sender, char keyCode, int modifiers) {
        // empty
      }

      public void onKeyPress(Widget sender, char keyCode, int modifiers) {
        // empty
      }

      public void onKeyUp(Widget sender, char keyCode, int modifiers) {
        updateParameterName(queryParamNameTextBox.getText(), queryValueTextBox.getText());
      }
    });
    queryParamNameTextBox.addChangeListener(new ChangeListener() {
      public void onChange(Widget sender) {
        updateParameterName(queryParamNameTextBox.getText(), queryValueTextBox.getText());
      }
    });
    queryParamNameTextBox.setText(GuiFactory.strings.paramName());
    containerPanel.add(queryParamNameTextBox);
    queryParamNameTextBox.setSelectionRange(0, queryParamNameTextBox.getText().length());     
    HTML parameterName = new HTML("<nobr/> =&nbsp;</nobr>");
    containerPanel.add(parameterName);    
    queryValueTextBox.addKeyboardListener(new KeyboardListener() {
      public void onKeyDown(Widget sender, char keyCode, int modifiers) {
        // empty
      }

      public void onKeyPress(Widget sender, char keyCode, int modifiers) {
        // empty
      }

      public void onKeyUp(Widget sender, char keyCode, int modifiers) {
        updateParameterValue(queryParamNameTextBox.getText(), queryValueTextBox.getText());       
      }
     
    });
    queryValueTextBox.addChangeListener(new ChangeListener() {
      public void onChange(Widget sender) {     
        updateParameterValue(queryParamNameTextBox.getText(), queryValueTextBox.getText());       
      }
    });
    queryValueTextBox.setText(GuiFactory.strings.paramValue());
    containerPanel.add(queryValueTextBox);   
   
    Hyperlink removeParameterLink = new Hyperlink(GuiFactory.strings.remove(), true, "");
    removeParameterLink.addClickListener(new ClickListener() {
      public void onClick(Widget sender) {
        removeHyperlink(parameterItem, queryValueTextBox.getText());
      }
    });     
    containerPanel.add(removeParameterLink);
    requestItem.addItem(parameterItem);   
    parameterItem.setState(true);   
 
View Full Code Here

        addSelectionHandler(new SelectionHandler<TreeItem>() {
            @Override
            public void onSelection(SelectionEvent<TreeItem> event) {

                final TreeItem selectedItem = event.getSelectedItem();

                if (selectedItem.getElement().hasAttribute("token")) {
                    String token = selectedItem.getElement().getAttribute("token");
                    Console.MODULES.getPlaceManager().revealPlaceHierarchy(
                            Places.fromString(token)
                    );

                }

                // highlight section
                Scheduler.get().scheduleDeferred(new Scheduler.ScheduledCommand() {
                    @Override
                    public void execute() {
                        Console.MODULES.getEventBus().fireEvent(
                                new LHSHighlightEvent(treeId, selectedItem.getText(), category)
                        );
                    }
                });

            }
View Full Code Here

        for(ServerGroupRecord record : serverGroupRecords)
        {
            String groupName = record.getGroupName();
            final String token = "domain/" + NameTokens.ServerGroupPresenter + ";name=" + groupName;
            final TreeItem item = new LHSNavTreeItem(groupName, token);
            serverGroupTree.addItem(item);
        }
    }
View Full Code Here

        hostTree.removeItems();

        for(Server server: servers)
        {
            final String serverName = server.getName();
            final TreeItem item = new LHSNavTreeItem(serverName, buildToken(serverName));
            hostTree.addItem(item);
        }

        if(servers.isEmpty())
        {
            TreeItem empty = new TreeItem(new HTML(Console.CONSTANTS.common_label_noRecords()));
            hostTree.addItem(empty);
        }

    }
View Full Code Here

        List<ModelNode> result = response.get("result").asList();

        for (final ModelNode node : result) {

            final String title = node.asString();
            final TreeItem item = new AddressableTreeItem(title, title);
            getView().addItem(item);

            ModelNode operation = new ModelNode();
            operation.get(OP).set(ModelDescriptionConstants.READ_CHILDREN_NAMES_OPERATION);
            operation.get("child-type").set(title);
View Full Code Here

        int includedSubsystems =0;

        // build groups first
        for(SubsystemGroup group : SubsystemMetaData.getGroups().values())
        {
            final TreeItem groupTreeItem = new TreeItem(group.getName());

            for(SubsystemGroupItem groupItem : group.getItems())
            {
                for(SubsystemRecord subsys: subsystems)
                {
                    if(subsys.getTitle().equals(groupItem.getKey())
                            && groupItem.isDisabled()==false)
                    {
                        includedSubsystems++;

                        final String key = subsys.getTitle().toLowerCase().replace(" ", "_");
                        String token = parentPlace + key;
                        final LHSNavTreeItem link = new LHSNavTreeItem(groupItem.getName(), token);
                        link.setKey(key);

                        if(key.equals("datasources")) // the eventing currently doesn't work reliably
                        {
                            Timer t = new Timer() {
                                @Override
                                public void run() {
                                    groupTreeItem.setState(true);
                                    //link.setSelected(true);

                                    Scheduler.get().scheduleDeferred(new Scheduler.ScheduledCommand(){
                                        @Override
                                        public void execute() {
                                            Console.MODULES.getEventBus().fireEvent(
                                                    new LHSHighlightEvent(subsysTree.getTreeId(), link.getText(), "profiles")
                                            );
                                        }
                                    });
                                }
                            };
                            t.schedule(500);
                        }

                        groupTreeItem.addItem(link);
                    }
                }
            }

            // skip empty groups
            if(groupTreeItem.getChildCount()>0)
                subsysTree.addItem(groupTreeItem);

        }

        // fallback in case no manageable subsystems exist
        if(includedSubsystems==0)
        {
            HTML explanation = new HTML("No manageable subsystems exist.");
            explanation.addClickHandler(new ClickHandler() {
                @Override
                public void onClick(ClickEvent event) {
                    displaySubsystemHelp(subsysTree);
                }
            });
            subsysTree.addItem(new TreeItem(explanation));
        }
    }
View Full Code Here

        tree.addItem(item);
    }

    @Override
    public void updateItem(String itemName, String base64) {
        TreeItem match = null;
        for(int i=0; i<tree.getItemCount(); i++)
        {
            TreeItem item = tree.getItem(i);
            if(item.getText().equals(itemName))
            {
                match = item;
                break;
            }
        }
View Full Code Here

TOP

Related Classes of com.google.gwt.user.client.ui.TreeItem$ContentPanel

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.