Search in sources :

Example 11 with ButtonBar

use of com.extjs.gxt.ui.client.widget.button.ButtonBar in project jahia by Jahia.

the class EngineCards method showEngine.

/**
 * show the first engine in the main area
 */
@Override
public void showEngine() {
    for (ButtonBar buttonBar : bars) {
        barItems.add(new ArrayList<Component>(buttonBar.getItems()));
    }
    list.getSelectionModel().select(0, false);
    mainContainer.showEngine();
}
Also used : ButtonBar(com.extjs.gxt.ui.client.widget.button.ButtonBar) Component(com.extjs.gxt.ui.client.widget.Component)

Example 12 with ButtonBar

use of com.extjs.gxt.ui.client.widget.button.ButtonBar in project jahia by Jahia.

the class ContentImport method doImport.

public void doImport(String path, Object value) {
    Log.debug(path + " " + value);
    JahiaContentManagementService.App.getInstance().importContent(path, value.toString(), replaceContent, new BaseAsyncCallback<List<GWTJahiaJobDetail>>() {

        public void onApplicationFailure(Throwable caught) {
            com.google.gwt.user.client.Window.alert(Messages.get("label.error") + "\n" + caught.getLocalizedMessage());
            Log.error(Messages.get("label.error"), caught);
            hide();
        }

        public void onSuccess(List<GWTJahiaJobDetail> result) {
            removeAll();
            unmask();
            add(new Label(Messages.get("label.import.wait", "Your import will be processed by the system as a background job.")));
            if (result.size() > 0) {
                add(new Label(Messages.getWithArgs("label.import.waitingprocess", "There are {0} jobs to finish before this import will be processed.", new Object[] { Integer.toString(result.size()) })));
            }
            ButtonBar buttons = ((ButtonBar) getBottomComponent());
            Button close = new Button(Messages.get("label.close"), new SelectionListener<ButtonEvent>() {

                public void componentSelected(ButtonEvent event) {
                    hide();
                }
            });
            close.addStyleName("button-close");
            buttons.removeAll();
            buttons.add(close);
            layout();
            Map<String, Object> data = new HashMap<String, Object>();
            data.put(Linker.REFRESH_ALL, true);
            m_linker.refresh(data);
        }
    });
}
Also used : ButtonBar(com.extjs.gxt.ui.client.widget.button.ButtonBar) Label(com.extjs.gxt.ui.client.widget.Label) GWTJahiaJobDetail(org.jahia.ajax.gwt.client.data.job.GWTJahiaJobDetail) Button(com.extjs.gxt.ui.client.widget.button.Button) ButtonEvent(com.extjs.gxt.ui.client.event.ButtonEvent) List(java.util.List) HashMap(java.util.HashMap) Map(java.util.Map) SelectionListener(com.extjs.gxt.ui.client.event.SelectionListener)

Example 13 with ButtonBar

use of com.extjs.gxt.ui.client.widget.button.ButtonBar in project jahia by Jahia.

the class PortletDefinitionField method onTriggerClick.

@Override
protected void onTriggerClick(ComponentEvent componentEvent) {
    super.onTriggerClick(componentEvent);
    if (disabled || isReadOnly()) {
        return;
    }
    final Window w = new Window();
    w.addStyleName("portlet-definition-window");
    w.setLayout(new FitLayout());
    final PortletDefinitionCard card = new PortletDefinitionCard();
    w.setModal(true);
    w.setSize(600, 400);
    ButtonBar bar = new ButtonBar();
    Button ok = new Button(Messages.get("org.jahia.engines.PortletsManager.wizard.ok.label", "OK"), new SelectionListener<ButtonEvent>() {

        @Override
        public void componentSelected(ButtonEvent event) {
            GWTJahiaPortletDefinition def = card.getSelectedPortletDefinition();
            setRawValue(def.getDefinitionName());
            w.hide();
        }
    });
    ok.addStyleName("button-ok");
    bar.add(ok);
    w.setTopComponent(bar);
    w.add(card);
    w.show();
}
Also used : Window(com.extjs.gxt.ui.client.widget.Window) GWTJahiaPortletDefinition(org.jahia.ajax.gwt.client.data.node.GWTJahiaPortletDefinition) ButtonBar(com.extjs.gxt.ui.client.widget.button.ButtonBar) Button(com.extjs.gxt.ui.client.widget.button.Button) ButtonEvent(com.extjs.gxt.ui.client.event.ButtonEvent) FitLayout(com.extjs.gxt.ui.client.widget.layout.FitLayout)

Aggregations

ButtonBar (com.extjs.gxt.ui.client.widget.button.ButtonBar)13 Button (com.extjs.gxt.ui.client.widget.button.Button)10 FitLayout (com.extjs.gxt.ui.client.widget.layout.FitLayout)6 ButtonEvent (com.extjs.gxt.ui.client.event.ButtonEvent)5 SelectionListener (com.extjs.gxt.ui.client.event.SelectionListener)4 ArrayList (java.util.ArrayList)4 List (java.util.List)4 Window (com.extjs.gxt.ui.client.widget.Window)3 AsyncCallback (com.google.gwt.user.client.rpc.AsyncCallback)3 GWTJahiaNode (org.jahia.ajax.gwt.client.data.node.GWTJahiaNode)3 ModelData (com.extjs.gxt.ui.client.data.ModelData)2 ListStore (com.extjs.gxt.ui.client.store.ListStore)2 Label (com.extjs.gxt.ui.client.widget.Label)2 BaseAsyncCallback (org.jahia.ajax.gwt.client.core.BaseAsyncCallback)2 JahiaContentManagementServiceAsync (org.jahia.ajax.gwt.client.service.content.JahiaContentManagementServiceAsync)2 BaseTreeLoader (com.extjs.gxt.ui.client.data.BaseTreeLoader)1 LoadEvent (com.extjs.gxt.ui.client.data.LoadEvent)1 RpcProxy (com.extjs.gxt.ui.client.data.RpcProxy)1 MessageBoxEvent (com.extjs.gxt.ui.client.event.MessageBoxEvent)1 TreeStore (com.extjs.gxt.ui.client.store.TreeStore)1