Package com.gwtext.client.widgets

Examples of com.gwtext.client.widgets.Panel


        setSubject(getEntity());

        fillWidgetValues();

        Panel activeTab = wrappingPanel.getActiveTab();
        if (activeTab != null) {
            Collection<PropertyWidget> widgets = formGenerator.getWidgetsInTab(activeTab);
            if (widgets == null) { return; }
            for (PropertyWidget widget : widgets) {
                widget.refresh();
View Full Code Here


        }
    }

    protected void fillWidgetValues() {
        //set the subject and fill values only for widgets in the active tab
        Panel activeTab = wrappingPanel.getActiveTab();
        if (activeTab != null) {
            Collection<PropertyWidget> widgets = formGenerator.getWidgetsInTab(activeTab);
            if (widgets == null) { return; }
            for (PropertyWidget widget : widgets) {
                ((AbstractPropertyWidget)widget).fillValues(); //TODO: move this to interface?
View Full Code Here

            hideAllTabs();
            return;
        }

        boolean changed = false;
        Panel activeTab = wrappingPanel.getActiveTab();
        Panel firstVisibleTab = null;

        Collection<Panel> tabs = formGenerator.getTabs();
        for (Panel tab : tabs) {
            if (formGenerator.isSuitableForType(tab, types)) {
                if (!formGenerator.isTabVisible(tab)) {
                    wrappingPanel.unhideTabStripItem(tab);
                    formGenerator.setTabVisible(tab, true);
                    changed = true;
                }
                if (firstVisibleTab == null) {
                    firstVisibleTab = tab;
                }
            } else {
                if (formGenerator.isTabVisible(tab)) {
                    wrappingPanel.hideTabStripItem(tab);
                    formGenerator.setTabVisible(tab, false);
                    changed = true;
                }
            }
        }
        if (changed) {
            if (formGenerator.isTabVisible(activeTab)) {
                wrappingPanel.activate(activeTab.getId());
            }
            else if (firstVisibleTab != null) {
                wrappingPanel.activate(firstVisibleTab.getId());
            }
            else {
                //TODO deactivate tab if possible
            }
        }
View Full Code Here

        setBorder(true);
        setPaddings(15);

        setTitle("Change Summary for " + getProject().getDisplayName());

        Panel main = new Panel();
        main.setLayout(new AnchorLayout());

        main.add(new HTML("<b>Recent Activity</b>"));

        // Number of changes for today
        FlowPanel today = new FlowPanel();
        today.add(new Label("Today: "));
        lblToday = new Label(" (refresh the widget to get the count)");
        today.add(lblToday);
        main.add(today);

        // Number of changes for yesterday
        FlowPanel yesterday = new FlowPanel();
        yesterday.add(new Label("Yesterday: "));
        lblYesterday = new Label(" (refresh the widget to get the count)");
        yesterday.add(lblYesterday);
        main.add(yesterday);

        main.add(new HTML("<br /><br />"));

        // Change history grid
        grid = new ChangesGrid(getProjectId());

        /*
           * Didn't have time to investigate this much, but it was hard to get the
           * grid to have good layout. When the grid is in an AnchorLayout, it
           * seems that calls to setSize are ignored. Also, if you enter 100% for
           * the height in the AnchorLayoutData, the grid draws outside the bottom
           * of the containing portlet. I could only get this to work by
           * specifying a negative pixel value for the height.
           */
        main.add(grid, new AnchorLayoutData("100% -75"));
        add(main);
    }
View Full Code Here

    }


    @Override
    public Component createComponent() {
        wrappingPanel = new Panel();
        wrappingPanel.setPaddings(5);
        wrappingPanel.setLayout(new ColumnLayout());

        field = createField();
        deleteLink = createDeleteHyperlink();
View Full Code Here

            properties = new PropertiesHolder();
        } else {
            properties = (PropertiesHolder) asset.content;
        }

        Panel panel = new Panel();
        panel.setBorder( false );
        panel.setPaddings( 15 );

        final RecordDef recordDef = new RecordDef( new FieldDef[]{new StringFieldDef( "key" ), new StringFieldDef( "value" )} //NON-NLS
        );

        String[][] data = new String[properties.list.size()][];
        int dataIndex = 0;
        for ( PropertyHolder holder : properties.list ) {
            data[dataIndex++] = new String[]{holder.name, holder.value};
        }

        MemoryProxy proxy = new MemoryProxy( data );
        store = new Store( proxy,
                           new ArrayReader( recordDef ) );
        store.load();

        ColumnConfig keyCol = new ColumnConfig( "Key?",
                                                "key",
                                                100,
                                                true,
                                                null,
                                                "key" ); //NON-NLS
        keyCol.setEditor( new GridEditor( new TextField() ) );
        keyCol.setFixed( false );

        ColumnConfig valueCol = new ColumnConfig( "Value?",
                                                  "value",
                                                  100,
                                                  true,
                                                  null,
                                                  "value" ); //NON-NLS
        valueCol.setEditor( new GridEditor( new TextField() ) );
        valueCol.setFixed( false );

        ColumnConfig[] columnConfigs = {keyCol, valueCol};

        ColumnModel columnModel = new ColumnModel( columnConfigs );
        columnModel.setDefaultSortable( true );

        final EditorGridPanel grid = new EditorGridPanel();

        Toolbar toolbar = new Toolbar();
        ToolbarButton add = new ToolbarButton( constants.Add(),
                                               new ButtonListenerAdapter() {
                                                   public void onClick(Button button,
                                                                       EventObject e) {
                                                       addNewField( recordDef,
                                                                    grid );
                                                   }
                                               } );

        toolbar.addButton( add );

        ToolbarButton clear = new ToolbarButton( constants.Clear(),
                                                 new ButtonListenerAdapter() {
                                                     public void onClick(Button button,
                                                                         EventObject e) {
                                                         store.removeAll();
                                                         addNewField( recordDef,
                                                                      grid );
                                                     }
                                                 } );

        toolbar.addButton( clear );

        grid.setStore( store );
        grid.setColumnModel( columnModel );
        grid.setWidth( 215 );
        grid.setHeight( 300 );
        grid.setTitle( constants.Properties() );
        grid.setFrame( true );
        grid.setClicksToEdit( 2 );
        grid.setTopToolbar( toolbar );

        panel.add( grid );

        layout.addRow( grid );
    }
View Full Code Here

    setWidth("100%");

  }

  private void doMetaSearch() {
    Panel p = new Panel();
    p.setCollapsible(true);
    p.setTitle(constants.AttributeSearch());

    final Map<String, MetaDataQuery> atts = new HashMap<String, MetaDataQuery>() {
      {
        put(constants.CreatedBy(), new MetaDataQuery("drools:creator")); //NON-NLS
        put(constants.Format1(), new MetaDataQuery("drools:format"));    //NON-NLS
        put(constants.Subject(), new MetaDataQuery("drools:subject"));   //NON-NLS
        put(constants.Type1(), new MetaDataQuery("drools:type"));        //NON-NLS
        put(constants.ExternalLink(), new MetaDataQuery("drools:relation"))//NON-NLS
        put(constants.Source(), new MetaDataQuery("drools:source"));          //NON-NLS
        put(constants.Description1(), new MetaDataQuery("drools:description"));   //NON-NLS
        put(constants.LastModifiedBy(), new MetaDataQuery("drools:lastContributor"));   //NON-NLS
        put(constants.CheckinComment(), new MetaDataQuery("drools:checkinComment"))//NON-NLS
      }
    };


    FormStyleLayout fm = new FormStyleLayout();
    for (Iterator iterator = atts.keySet().iterator(); iterator.hasNext();) {
      String fieldName = (String) iterator.next();
      final MetaDataQuery q = (MetaDataQuery) atts.get(fieldName);
      final TextBox box = new TextBox();
      box.setTitle(constants.WildCardsSearchTip());
      fm.addAttribute(fieldName + ":", box);
      box.addChangeListener(new ChangeListener() {
        public void onChange(Widget w) {
          q.valueList = box.getText();
        }
      });
    }

    HorizontalPanel created = new HorizontalPanel();
    created.add(new SmallLabel(constants.AfterColon()));
    final DateField createdAfter = new DateField(constants.AfterColon(), DATE_PICKER_FORMAT);
    created.add(createdAfter);
   
    created.add(new SmallLabel("&nbsp;"));      //NON-NLS

    created.add(new SmallLabel(constants.BeforeColon()));
    final DateField createdBefore = new DateField(constants.Before(), DATE_PICKER_FORMAT);
    created.add(createdBefore);

    fm.addAttribute(constants.DateCreated1(), created);



    HorizontalPanel lastMod = new HorizontalPanel();
    lastMod.add(new SmallLabel(constants.AfterColon()));
    final DateField lastModAfter = new DateField(constants.AfterColon(), DATE_PICKER_FORMAT);
    lastMod.add(lastModAfter);

    lastMod.add(new SmallLabel("&nbsp;"));   //NON-NLS

    lastMod.add(new SmallLabel(constants.BeforeColon()));
    final DateField lastModBefore = new DateField(constants.BeforeColon(), DATE_PICKER_FORMAT);
    lastMod.add(lastModBefore);

    fm.addAttribute(constants.LastModified1(), lastMod);

    final SimplePanel resultsP = new SimplePanel();
    Button search = new Button(constants.Search());
    fm.addAttribute("", search);
    search.addClickListener(new ClickListener() {
      public void onClick(Widget w) {
        resultsP.clear();
        AssetItemGrid grid = new AssetItemGrid(openItem, "searchresults", new AssetItemGridDataLoader() { //NON-NLS
          public void loadData(int startRow, int numberOfRows,
              GenericCallback cb) {
            MetaDataQuery[] mdq = new MetaDataQuery[atts.size()];
            int i = 0;
            for (Iterator iterator = atts.keySet().iterator(); iterator
                .hasNext();) {
              String name = (String) iterator.next();
              mdq[i] = (MetaDataQuery) atts.get(name);
              i++;
            }
            RepositoryServiceFactory.getService().queryMetaData(mdq, createdAfter.getValue(), createdBefore.getValue(),
                lastModAfter.getValue(), lastModBefore.getValue(), false, startRow, numberOfRows, cb);
          }
        });
        resultsP.add(grid);
      }
    });
    fm.addRow(resultsP);
    p.add(fm);
    p.setCollapsed(true);
    layout.add(p);
  }
View Full Code Here

    p.setCollapsed(true);
    layout.add(p);
  }

  private void doQuickFind() {
    Panel p = new Panel();
    p.setCollapsible(true);
    p.setTitle(constants.NameSearch());
    p.add(new QuickFindWidget(openItem));

    p.setCollapsed(false);

    layout.add(p);
  }
View Full Code Here

    layout.add(p);
  }

  private void doTextSearch() {
    Panel p = new Panel();
    p.setCollapsible(true);
    p.setTitle(constants.TextSearch());

    p.setCollapsed(true);

    FormStyleLayout ts = new FormStyleLayout();
    final TextBox tx = new TextBox();
    ts.addAttribute(constants.SearchFor(), tx);
    Button go = new Button();
    go.setText(constants.Search1());
    ts.addAttribute("", go);
    ts.setWidth("100%");
    p.add(ts);


    final SimplePanel resultsP = new SimplePanel();
        final ClickListener cl = new ClickListener() {
      public void onClick(Widget w) {
View Full Code Here

   * @param key A key which is unique.
   */
  public void addTab (String tabname, boolean closeable, Widget widget, final String key) {

    final String panelId = key + id;
    Panel localTP = new Panel();
    localTP.setClosable(closeable);
    localTP.setTitle(tabname);
    localTP.setId(panelId);
    localTP.setAutoScroll(true);
    localTP.add(widget);
    tp.add(localTP, this.centerLayoutData);


    localTP.addListener(new PanelListenerAdapter() {
      public void onDestroy(Component component) {
        openedTabs.remove(key).destroy();
        openedAssetEditors.remove(panelId);
      }
    });

    if (widget instanceof RuleViewer) {
      this.openedAssetEditors.put(panelId, (RuleViewer) widget);
    }

    tp.activate(localTP.getId());



    openedTabs.put(key, localTP);

View Full Code Here

TOP

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

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.