Ejemplo n.º 1
0
  private Window createGeolocationWindow() {

    final Window w = new Window();
    w.setMinimizable(true);
    w.setMaximizable(true);
    w.setIcon(IconHelper.createStyle("accordion"));
    w.setHeading("Contact list");
    w.setWidth(500);
    w.setHeight(500);
    w.setLayout(new FitLayout());

    ContentPanel cp = new ContentPanel();
    cp.setAnimCollapse(false);
    cp.setHeading("Localize your friends");
    cp.setScrollMode(Scroll.NONE);
    cp.setLayout(new FitLayout());

    Frame frame = new Frame();
    frame.setUrl("geolocation.html");
    frame.setLayoutData(new FitLayout());
    cp.add(frame);

    w.add(cp);
    return w;
  }
Ejemplo n.º 2
0
  private void adminMenu(ContentPanel accordionPanel) {
    /* Administracion */
    ContentPanel adminCP = new ContentPanel();
    adminCP.setAnimCollapse(false);
    adminCP.setHeading("Administracion");
    adminCP.setLayout(new RowLayout(Orientation.VERTICAL));

    Button area = new Button("ABM- Area");
    area.setWidth("100%");
    area.addListener(
        Events.OnClick,
        new Listener<BaseEvent>() {
          @Override
          public void handleEvent(BaseEvent be) {
            ABMArea a = new ABMArea();
            a.show();
          }
        });
    adminCP.add(area);
    Button tiporev = new Button("ABM- TipoRelevamiento");
    tiporev.setWidth("100%");
    adminCP.add(tiporev);

    Button tema = new Button("ABM- Tema");

    tema.setWidth("100%");
    adminCP.add(tema);

    accordionPanel.add(adminCP);
  }
  protected void initUI() {
    TabItem west = (TabItem) Registry.get(AppView.TAB_STORAGE);
    ContentPanel clusters = new ContentPanel();
    clusters.setAnimCollapse(false);
    clusters.setHeading("Storage Engines");
    clusters.addListener(
        Events.Expand,
        new Listener<ComponentEvent>() {
          public void handleEvent(ComponentEvent be) {
            Dispatcher.get().dispatch(AppEvents.NAV_STORAGE);
          }
        });

    storageEnginesPanel = new StorageEnginesPanel();
    storageEnginesPanel
        .getGrid()
        .getSelectionModel()
        .addSelectionChangedListener(
            new SelectionChangedListener<StorageEngine>() {
              @Override
              public void selectionChanged(SelectionChangedEvent<StorageEngine> se) {
                AppEvent evt = new AppEvent(AppEvents.VIEW_STORAGE_ENGINE, se.getSelectedItem());
                Dispatcher.forwardEvent(evt);
              }
            });
    clusters.add(storageEnginesPanel, new BorderLayoutData(LayoutRegion.CENTER));

    west.add(clusters);
  }
Ejemplo n.º 4
0
  private ContentPanel buildConfigBloc(ConfigGroup configGroup, ImageResource icon) {
    final ContentPanel cPanel = new ContentPanel(new ColumnLayout());
    cPanel.setHeading(
        "<div class='config-title'>" + I18nUtils.getString(configGroup.key) + "</div>");
    cPanel.getHeader().addStyleName("config-header");
    cPanel.setCollapsible(true);
    cPanel.setAnimCollapse(false);
    cPanel.collapse();
    cPanel.setIcon(AbstractImagePrototype.create(icon));
    cPanel.addListener(
        Events.Expand,
        new Listener<ComponentEvent>() {

          @Override
          public void handleEvent(ComponentEvent be) {
            cPanel.layout(true);
          }
        });

    cPanel.getHeader().addDomHandler(this, ClickEvent.getType());
    mapConfigGroupPanel.put(configGroup, cPanel);
    mapHeaderGroup.put(cPanel.getHeader(), cPanel);

    return cPanel;
  }
Ejemplo n.º 5
0
  protected void onRender(Element parent, int index) {
    super.onRender(parent, index);

    ContentPanel inforPanel = new ContentPanel();
    //		 inforPanel.setHeading(this.getCurState().getAuction().getString(IAuction.AUCTION_NAME));
    HorizontalPanel infoContent = new HorizontalPanel();
    infoContent.setSpacing(20);
    Label sk = new Label("拍卖活动名称:");
    Label sv = new Label(this.getCurState().getAuction().getString(IAuction.AUCTION_NAME));
    Label ek = new Label("拍卖商品名称:");
    Label ev = new Label(this.getCurState().getAuction().getString(IAuction.GOOD_NAME));
    infoContent.add(sk);
    infoContent.add(sv);
    infoContent.add(ek);
    infoContent.add(ev);
    inforPanel.add(infoContent);

    BasePagingLoader loader = new PagingListService().getLoader(ModelNames.AUCTIONLOG);
    loader.load(0, 10);
    store = new ListStore<BeanObject>(loader);
    toolBar = new PagingToolBar(10);
    toolBar.bind(loader);

    List<ColumnConfig> columns = new ArrayList<ColumnConfig>();
    final CheckBoxSelectionModel<BeanObject> smRowSelection =
        new CheckBoxSelectionModel<BeanObject>();
    columns.add(smRowSelection.getColumn());
    columns.add(new ColumnConfig(IAuctionLog.BID_USER, "买家", 150));
    columns.add(new ColumnConfig(IAuctionLog.BID_PRICE, "出价", 150));
    columns.add(new ColumnConfig(IAuctionLog.BID_TIME, "时间", 150));
    columns.add(new ColumnConfig(IAuctionLog.LOG_ID, "状态", 150));

    ColumnModel cm = new ColumnModel(columns);
    grid = new Grid<BeanObject>(store, cm);

    //        grid.setLoadMask(true);
    //        grid.setBorders(true);
    grid.setSelectionModel(smRowSelection);
    grid.addPlugin(smRowSelection);
    grid.setHeight(250);

    ContentPanel contentPanel = new ContentPanel();
    contentPanel.setFrame(true);
    contentPanel.setCollapsible(true);
    contentPanel.setAnimCollapse(false);
    contentPanel.setButtonAlign(HorizontalAlignment.CENTER);
    contentPanel.setIconStyle("icon-table");
    contentPanel.setLayout(new FitLayout());
    contentPanel.add(grid);
    contentPanel.setBottomComponent(toolBar);

    topPanel.add(inforPanel);
    topPanel.add(contentPanel);
    add(topPanel);
  }
Ejemplo n.º 6
0
  private void reportesMenu(ContentPanel accordionPanel) {
    /* Reportes */

    ContentPanel reportesCP = new ContentPanel();
    reportesCP.setAnimCollapse(false);
    reportesCP.setHeading("Reportes");
    reportesCP.setLayout(new RowLayout(Orientation.VERTICAL));

    Button insp = new Button("Inspecciones");
    insp.setWidth("100%");
    reportesCP.add(insp);

    accordionPanel.add(reportesCP);
  }
Ejemplo n.º 7
0
  /** This widget can be used to display the actions that are considered relevant */
  public WidgetSpecialActions() {
    Listener<ComponentEvent> l =
        new Listener<ComponentEvent>() {
          public void handleEvent(ComponentEvent ce) {
            DataList l = (DataList) ce.component;
            ServiceVisualizerManager.displayService(l.getSelectedItem().getId());
          }
        };
    ContentPanel frame = new ContentPanel();
    frame.setFrame(true);
    frame.setCollapsible(true);
    frame.setAnimCollapse(false);
    frame.setHeading("Interesting actions");

    final DataList list = new DataList();
    list.setFlatStyle(true);

    list.addListener(Events.SelectionChange, l);

    DataListItem item = new DataListItem();
    item.setText("Get Twitter followers");
    item.setId("http://soa4all.eu/twitter/getFollowers");
    list.add(item);

    item = new DataListItem();
    item.setText("Watson Search");
    item.setId("http://soa4all.eu/watson/search");
    list.add(item);

    item = new DataListItem();
    item.setText("BT Scenario 1");
    item.setStyleAttribute("color", "#00FF00");
    item.setId("http://soa4all.eu/composed/BTscenario1");
    list.add(item);

    item = new DataListItem();
    item.setText("Get Twitter Follower (Semantic)");
    item.setId("http://soa4all.eu/twitter/getFollowersSemantic");
    list.add(item);

    item = new DataListItem();
    item.setText("Profile Details (Fake Service)");
    item.setId("http://soa4all.eu/twitter/getProfileDetails");
    list.add(item);

    frame.setLayout(new FitLayout());
    frame.add(list);

    initWidget(frame);
  }
Ejemplo n.º 8
0
  private void tablero(ContentPanel accordionPanel) {
    /* Reportes */
    ContentPanel tablero = new ContentPanel();
    tablero.setAnimCollapse(false);
    tablero.setHeading("Tablero Partido");
    tablero.setLayout(new RowLayout(Orientation.VERTICAL));
    Button tableroControl = new Button("Tablero Control");

    tableroControl.addListener(
        Events.OnClick,
        new Listener<BaseEvent>() {
          @Override
          public void handleEvent(BaseEvent be) {
            TableroView tableroView = new TableroView();
            tableroView.show();
          }
        });

    tableroControl.setWidth(135);
    tablero.add(tableroControl);

    accordionPanel.add(tablero);
  }
Ejemplo n.º 9
0
  private void populateMenu(ContentPanel accordionPanel) {
    /* Reportes */
    ContentPanel populatorsContainer = new ContentPanel();
    populatorsContainer.setAnimCollapse(false);
    populatorsContainer.setHeading("Creacion de Datos Aut.");
    populatorsContainer.setLayout(new RowLayout(Orientation.VERTICAL));
    Button areaBTN = new Button("Crear Areas");
    areaBTN.setWidth("100%");
    areaBTN.addListener(
        Events.OnClick,
        new Listener<BaseEvent>() {
          @Override
          public void handleEvent(BaseEvent be) {
            final AreaServiceAsync areaServiceAsync = GWT.create(AreaService.class);
            areaServiceAsync.populateINIT(
                new AsyncCallback<Void>() {

                  @Override
                  public void onSuccess(Void result) {
                    Info.display("Areas Creadas", "eso");
                  }

                  @Override
                  public void onFailure(Throwable caught) {
                    Info.display("FALLO Creacion areas!", "eso");
                  }
                });
          }
        });

    Button tipoRelevBTN = new Button("Crear Tipos");
    tipoRelevBTN.setWidth("100%");
    tipoRelevBTN.addListener(
        Events.OnClick,
        new Listener<BaseEvent>() {
          @Override
          public void handleEvent(BaseEvent be) {
            final TipoRelevamientoServiceAsync tipoRelevamientoServiceAsync =
                GWT.create(TipoRelevamientoService.class);
            tipoRelevamientoServiceAsync.populateINIT(
                new AsyncCallback<Void>() {

                  @Override
                  public void onSuccess(Void result) {
                    Info.display("Tipos Relevamiendos Creadas", "eso");
                  }

                  @Override
                  public void onFailure(Throwable caught) {
                    Info.display("FALLO Creacion Tipos Relevamientos!", "eso");
                  }
                });
          }
        });

    Button temasvBTN = new Button("Crear Temas");
    temasvBTN.setWidth("100%");
    temasvBTN.addListener(
        Events.OnClick,
        new Listener<BaseEvent>() {
          @Override
          public void handleEvent(BaseEvent be) {
            final TemaServiceAsync tipoRelevamientoServiceAsync = GWT.create(TemaService.class);
            tipoRelevamientoServiceAsync.populateINIT(
                new AsyncCallback<Void>() {

                  @Override
                  public void onSuccess(Void result) {
                    Info.display("Temas Creadas", "eso");
                  }

                  @Override
                  public void onFailure(Throwable caught) {
                    Info.display("FALLO Creacion Temas!", "eso");
                  }
                });
          }
        });

    Button inspeccionesBTN = new Button("Crear Inspecciones de Ejemplo");
    inspeccionesBTN.setWidth("100%");
    inspeccionesBTN.addListener(
        Events.OnClick,
        new Listener<BaseEvent>() {
          @Override
          public void handleEvent(BaseEvent be) {
            final InspeccionServiceAsync tipoRelevamientoServiceAsync =
                GWT.create(InspeccionService.class);
            tipoRelevamientoServiceAsync.examplesCreate(
                new AsyncCallback<Void>() {

                  @Override
                  public void onSuccess(Void result) {
                    Info.display("Ejemplos Creados", "eso");
                  }

                  @Override
                  public void onFailure(Throwable caught) {
                    Info.display("FALLO Ejemplos Creados", "eso");
                  }
                });
          }
        });

    populatorsContainer.add(areaBTN);
    populatorsContainer.add(tipoRelevBTN);
    populatorsContainer.add(temasvBTN);
    populatorsContainer.add(inspeccionesBTN);

    accordionPanel.add(populatorsContainer);
  }
Ejemplo n.º 10
0
  @Override
  protected void onRender(Element parent, int index) {
    super.onRender(parent, index);

    final ExampleServiceAsync service = (ExampleServiceAsync) Registry.get(Examples.SERVICE);

    RpcProxy<List<Photo>> proxy =
        new RpcProxy<List<Photo>>() {
          @Override
          protected void load(Object loadConfig, AsyncCallback<List<Photo>> callback) {
            service.getPhotos(callback);
          }
        };

    ListLoader<ListLoadResult<Photo>> loader =
        new BaseListLoader<ListLoadResult<Photo>>(proxy, new BeanModelReader());
    ListStore<BeanModel> store = new ListStore<BeanModel>(loader);
    loader.load();

    final ContentPanel panel = new ContentPanel();
    panel.setCollapsible(true);
    panel.setAnimCollapse(false);
    panel.setFrame(true);
    panel.setHeading("CheckBox ListView (0 items selected)");
    panel.setWidth(300);
    panel.setAutoHeight(true);
    panel.setBodyBorder(false);

    final CheckBoxListView<BeanModel> view =
        new CheckBoxListView<BeanModel>() {
          @Override
          protected BeanModel prepareData(BeanModel model) {
            String s = model.get("name");
            model.set("shortName", Format.ellipse(s, 15));
            return model;
          }
        };

    view.setStore(store);
    view.setDisplayProperty("name");
    view.getSelectionModel()
        .addListener(
            Events.SelectionChange,
            new Listener<SelectionChangedEvent<BeanModel>>() {

              public void handleEvent(SelectionChangedEvent<BeanModel> be) {
                panel.setHeading(
                    "CheckBox ListView (" + be.getSelection().size() + " items selected)");
              }
            });
    panel.add(view);

    panel.addButton(
        new Button(
            "get checked items",
            new SelectionListener<ButtonEvent>() {

              @Override
              public void componentSelected(ButtonEvent ce) {
                Info.display(
                    "Checked Items", "There are " + view.getChecked().size() + " items checked!");
              }
            }));
    add(panel);
  }
Ejemplo n.º 11
0
  protected void onRender(Element parent, int index) {
    super.onRender(parent, index);

    criteria.addCondition(new Condition(IGoods.DELETED, Condition.EQUALS, "true"));
    BasePagingLoader loader = new PagingListService().getLoader(ModelNames.GOODS, criteria);
    loader.load(0, 10);
    final ListStore<BeanObject> store = new ListStore<BeanObject>(loader);

    toolBar = new PagingToolBar(10);
    toolBar.bind(loader);

    List<ColumnConfig> columns = new ArrayList<ColumnConfig>();
    final CheckBoxSelectionModel<BeanObject> smRowSelection =
        new CheckBoxSelectionModel<BeanObject>();
    columns.add(smRowSelection.getColumn());
    columns.add(new ColumnConfig(IGoods.ID, "ID", 50));
    ColumnConfig col = new ColumnConfig(IGoods.NAME, Resources.constants.Goods_name(), 100);
    columns.add(col);
    col = new ColumnConfig(IGoods.SN, Resources.constants.Goods_SN(), 100);
    columns.add(col);

    col = new ColumnConfig(IGoods.SHOPPRICE, Resources.constants.Goods_shopPrice(), 80);
    col.setAlignment(HorizontalAlignment.RIGHT);
    col.setNumberFormat(NumberFormat.getCurrencyFormat());
    columns.add(col);

    ColumnConfig actcol = new ColumnConfig("Action", Resources.constants.GoodsList_action(), 100);
    //		columns.add(actcol);

    ColumnModel cm = new ColumnModel(columns);

    Grid<BeanObject> grid = new EditorGrid<BeanObject>(store, cm);
    grid.setLoadMask(true);
    grid.setBorders(true);
    grid.setSelectionModel(smRowSelection);
    //      grid.setAutoExpandColumn("forum");

    ActionCellRenderer render = new ActionCellRenderer(grid);
    ActionCellRenderer.ActionInfo act = new ActionCellRenderer.ActionInfo();
    act.setImage("icon_edit.gif");
    act.setAction("editGoods($id)");
    act.setTooltip(Resources.constants.GoodsList_action_edit());
    render.addAction(act);
    act = new ActionCellRenderer.ActionInfo();
    act.setImage("icon_trash.gif");
    act.setAction("deleteGoods($id)");
    act.setTooltip(Resources.constants.GoodsList_action_delete());
    render.addAction(act);

    actcol.setRenderer(render);

    HorizontalPanel header = new HorizontalPanel();
    header.add(Resources.images.icon_search().createImage());
    header.add(new Label("  " + Resources.constants.GoodsList_keyword()));
    header.add(txtKeyword);
    header.add(btnFind);
    add(header);

    btnFind.addSelectionListener(
        new SelectionListener<ButtonEvent>() {
          public void componentSelected(ButtonEvent ce) {
            search();
          }
        });

    ContentPanel panel = new ContentPanel();
    panel.setFrame(true);
    panel.setCollapsible(true);
    panel.setAnimCollapse(false);
    panel.setButtonAlign(HorizontalAlignment.CENTER);
    panel.setIconStyle("icon-table");
    //        panel.setHeading("Paging Grid");
    panel.setLayout(new FitLayout());
    panel.add(grid);
    panel.setSize(880, 350);
    panel.setBottomComponent(toolBar);

    panel.setButtonAlign(HorizontalAlignment.CENTER);
    panel.addButton(
        new Button(
            "彻底删除",
            new SelectionListener<ButtonEvent>() {
              public void componentSelected(ButtonEvent ce) {
                List<BeanObject> items = smRowSelection.getSelectedItems();
                purgeGoods(items);
              }
            }));

    panel.addButton(
        new Button(
            "恢复",
            new SelectionListener<ButtonEvent>() {
              public void componentSelected(ButtonEvent ce) {
                List<BeanObject> items = smRowSelection.getSelectedItems();
                restoreGoods(items);
              }
            }));

    add(panel);
  }
Ejemplo n.º 12
0
  /** 初始化界面。 */
  public MagazineManager() {
    curState = new State();

    BasePagingLoader loader = new PagingListService().getLoader(ModelNames.MAILTEMPLATE, criteria);
    loader.load(0, 10);
    store = new ListStore<BeanObject>(loader);
    toolBar = new PagingToolBar(10);
    toolBar.bind(loader);

    List<ColumnConfig> columns = new ArrayList<ColumnConfig>();
    ColumnConfig title = new ColumnConfig(IMailTemplate.SUBJECT, "杂志标题", 200);
    columns.add(title);
    columns.add(new ColumnConfig(IMailTemplate.LASTMODIFY, "杂志上次编辑时间", 160));
    columns.add(new ColumnConfig(IMailTemplate.LASTSEND, "杂志上次发送时间", 160));
    ColumnConfig insert = new ColumnConfig("insert", "插入发送队列", 160);
    columns.add(insert);
    ColumnConfig actcol = new ColumnConfig("Action", "操作", 100);
    columns.add(actcol);
    ColumnModel cm = new ColumnModel(columns);

    grid = new Grid<BeanObject>(store, cm);
    grid.setLoadMask(true);
    grid.setBorders(true);

    ActionCellRenderer render = new ActionCellRenderer(grid);
    ActionCellRenderer insertRender = new ActionCellRenderer(grid);
    ActionCellRenderer.ActionInfo act = new ActionCellRenderer.ActionInfo();
    act.setImage("icon_edit.gif");
    act.setAction("editMagazine($id)");
    act.setTooltip("编辑");
    render.addAction(act);
    act = new ActionCellRenderer.ActionInfo();
    act.setImage("icon_trash.gif");
    act.setAction("deleteMagazine($id)");
    act.setTooltip("删除");
    render.addAction(act);
    act = new ActionCellRenderer.ActionInfo();
    act.setText("插入队列");
    act.setAction("insertMagazine($id)");
    act.setTooltip("插入队列");
    insertRender.addAction(act);

    actcol.setRenderer(render);
    insert.setRenderer(insertRender);

    ContentPanel panel = new ContentPanel();
    panel.setFrame(true);
    panel.setCollapsible(true);
    panel.setAnimCollapse(false);
    panel.setButtonAlign(HorizontalAlignment.CENTER);
    panel.setIconStyle("icon-table");
    panel.setLayout(new FitLayout());
    panel.add(grid);
    panel.setSize(850, 350);
    panel.setBottomComponent(toolBar);
    panel.setHeading("邮件杂志列表");
    panel.setButtonAlign(HorizontalAlignment.LEFT);

    // 添加新杂志
    final com.extjs.gxt.ui.client.widget.button.Button addMagazine =
        new com.extjs.gxt.ui.client.widget.button.Button("添加新杂志");
    addMagazine.addSelectionListener(
        new SelectionListener<ButtonEvent>() {
          public void componentSelected(ButtonEvent ce) {
            // add new magazine function
            NewMagazine.State state = new NewMagazine.State();
            state.execute();
          }
        });
    panel.addButton(addMagazine);

    add(panel);
    initJS(this);
  }
Ejemplo n.º 13
0
  private Window createAccordionWindow() {
    final Window w = new Window();
    w.setMinimizable(true);
    w.setMaximizable(true);
    w.setIcon(IconHelper.createStyle("accordion"));
    w.setHeading("Contact list");
    w.setWidth(200);
    w.setHeight(350);

    ToolBar toolBar = new ToolBar();
    Button item = new Button();
    item.setIcon(IconHelper.createStyle("icon-connect"));
    toolBar.add(item);

    toolBar.add(new SeparatorToolItem());
    w.setTopComponent(toolBar);

    item = new Button();
    item.setIcon(IconHelper.createStyle("icon-user-add"));
    toolBar.add(item);

    item = new Button();
    item.setIcon(IconHelper.createStyle("icon-user-delete"));
    toolBar.add(item);

    w.setLayout(new AccordionLayout());

    ContentPanel cp = new ContentPanel();
    cp.setAnimCollapse(false);
    cp.setHeading("Online Users");
    cp.setScrollMode(Scroll.AUTO);
    cp.getHeader().addTool(new ToolButton("x-tool-refresh"));

    w.add(cp);

    TreeStore<ModelData> store = new TreeStore<ModelData>();
    TreePanel<ModelData> tree = new TreePanel<ModelData>(store);
    tree.setIconProvider(
        new ModelIconProvider<ModelData>() {

          public AbstractImagePrototype getIcon(ModelData model) {
            if (model.get("icon") != null) {
              return IconHelper.createStyle((String) model.get("icon"));
            } else {
              return null;
            }
          }
        });
    tree.setDisplayProperty("name");

    ModelData m = newItem("Eurecom", null);
    store.add(m, false);
    tree.setExpanded(m, true);

    store.add(m, newItem("Emerson Milton", "user-suit"), false);
    store.add(m, newItem("Christina Blake", "user-girl"), false);
    store.add(m, newItem("Heriberto Rush", "user-kid"), false);
    store.add(m, newItem("Candice Carson", "user-girl"), false);
    store.add(m, newItem("Bell Snedden", "user-kid"), false);
    store.add(m, newItem("Dirk Newman", "user-kid"), false);
    store.add(m, newItem("Chad Andrews", "user-suit"), false);

    m = newItem("Italy", null);
    store.add(m, false);
    tree.setExpanded(m, true);
    store.add(m, newItem("Benito Meeks", "user-suit"), false);
    store.add(m, newItem("Gail Horton", "user-girl"), false);

    m = newItem("Paris", null);
    store.add(m, false);
    tree.setExpanded(m, true);
    store.add(m, newItem("Claudio Engle", "user-suit"), false);
    store.add(m, newItem("Sine", "user-girl"), false);

    m = newItem("Hometown", null);
    store.add(m, false);
    tree.setExpanded(m, true);
    store.add(m, newItem("Hollie Voss", "user-girl"), false);

    cp.add(tree);

    cp = new ContentPanel();
    cp.setAnimCollapse(false);
    cp.setHeading("Settings");
    cp.setBodyStyleName("pad-text");
    cp.addText("Smape1");
    w.add(cp);

    cp = new ContentPanel();
    cp.setAnimCollapse(false);
    cp.setHeading("Blocked");
    cp.setBodyStyleName("pad-text");
    cp.addText("Smape2");
    w.add(cp);

    return w;
  }