Example usage for com.google.gwt.user.client.ui DeckPanel DeckPanel

List of usage examples for com.google.gwt.user.client.ui DeckPanel DeckPanel

Introduction

In this page you can find the example usage for com.google.gwt.user.client.ui DeckPanel DeckPanel.

Prototype

public DeckPanel() 

Source Link

Document

Creates an empty deck panel.

Usage

From source file:org.jboss.as.console.client.core.Header.java

License:Open Source License

public DeckPanel createSubnavigation() {

    DeckPanel subnavigation = new DeckPanel();

    // TODO: fill in contents

    return subnavigation;
}

From source file:org.jboss.as.console.client.search.SearchPopup.java

License:Open Source License

SearchPopup(final Harvest harvest, final Index index, final PlaceManager placeManager) {
    super("Search");
    addStyleName("hal-searchPopup");

    this.harvest = harvest;
    this.index = index;
    this.placeManager = placeManager;

    deck = new DeckPanel();
    VerticalPanel indexPanel = new VerticalPanel();
    indexPanel.setStyleName("fill-layout-width");
    indexPanel.getElement().getStyle().setPadding(2, Style.Unit.PX);
    indexPanel.add(new HTML(Console.MESSAGES.search_index_pending()));
    progressBar = new ProgressElement();
    indexPanel.add(progressBar);/*from w  w w  .j  a v a 2s.  com*/
    deck.add(indexPanel);

    VerticalPanel searchPanel = new VerticalPanel();
    searchPanel.setStyleName("window-content");

    searchPanel.add(new HTML("<h3>" + Console.CONSTANTS.search_popup_title() + "</h3>"));
    searchPanel.add(new Label(Console.MESSAGES.search_popup_description(SearchTool.getShortcut())));

    textBox = new TextBox();
    textBox.getElement().getStyle().setWidth(66, PCT);
    textBox.getElement().setAttribute("placeholder", Console.CONSTANTS.search_placeholder());
    textBox.getElement().getStyle().setMarginTop(15, PX);
    textBox.addKeyUpHandler(new KeyUpHandler() {
        @Override
        public void onKeyUp(KeyUpEvent keyUpEvent) {
            if (keyUpEvent.isDownArrow() && !resultProvider.getList().isEmpty()) {
                resultList.setFocus(true);
            } else {
                executeQuery();
            }
        }
    });

    textBox.setTabIndex(0);
    searchPanel.add(textBox);

    numberOfResults = new HTML();
    numberOfResults.addStyleName("no-results");
    numberOfResults.setVisible(false);
    searchPanel.add(numberOfResults);

    resultList = new DefaultCellList<TokenGroup>(new ResultCell());
    resultList.addCellPreviewHandler(new CellPreviewEvent.Handler<TokenGroup>() {
        @Override
        public void onCellPreview(CellPreviewEvent event) {
            if (event.getNativeEvent().getKeyCode() == KeyCodes.KEY_ENTER) {
                resultSelectionModel
                        .setSelected(resultProvider.getList().get(resultList.getKeyboardSelectedRow()), true);
            }
        }
    });

    resultSelectionModel = new SingleSelectionModel<TokenGroup>();
    resultSelectionModel.addSelectionChangeHandler(new SelectionChangeEvent.Handler() {
        @Override
        public void onSelectionChange(SelectionChangeEvent event) {
            navigate();
        }
    });

    resultList.setSelectionModel(resultSelectionModel);
    resultList.addStyleName("fill-layout-width");
    resultList.addStyleName("search-result");

    resultProvider = new ListDataProvider<TokenGroup>();
    resultProvider.addDataDisplay(resultList);
    searchPanel.add(resultList);

    deck.add(searchPanel);
    deck.showWidget(1);
    resultList.setTabIndex(0);
    setWidget(new ScrollPanel(deck));
}

From source file:org.jboss.as.console.client.shared.deployment.DeploymentBrowser.java

License:Open Source License

public DeploymentBrowser(final DeploymentStore deploymentStore,
        final SingleSelectionModel<DeploymentRecord> selectionModel) {
    forms = new HashMap<String, Form<DeploymentData>>();
    indexes = new HashMap<String, Integer>();

    this.selectionModel = selectionModel;
    deploymentTreeModel = new DeploymentTreeModel(this, deploymentStore, this.selectionModel);
    cellBrowser = new DefaultCellBrowser.Builder(deploymentTreeModel, null).build();

    breadcrumb = new DeploymentBreadcrumb();
    breadcrumb.getElement().setAttribute("style", "margin-top:30px;");

    int index = 0;
    this.contextPanel = new DeckPanel();
    this.helpCallback = new HelpCallback();

    Label noInfo = new Label("No deployments available.");
    noInfo.getElement().addClassName("console-DeploymentBreadcrumb-noinfo");
    noInfo.getElement().addClassName("console-DeploymentBreadcrumb-context");
    this.contextPanel.add(noInfo);
    index++;/*from   w  ww.j  a  va2s . c om*/

    addContext(DeploymentRecord.class, index++, new TextAreaItem("name", "Name"),
            new TextAreaItem("runtimeName", "Runtime Name"));

    addContext(DeploymentEjbSubsystem.class, index++);

    addContext(DeploymentJpaSubsystem.class, index++, new TextAreaItem("name", "Name"),
            new TextBoxItem("defaultDataSource", "Default Datasource"),
            new TextBoxItem("defaultInheritance", "Default Inheritance"));

    addContext(DeploymentWebSubsystem.class, index++, new TextAreaItem("name", "Name"),
            new TextBoxItem("contextRoot", "Context Root"), new TextBoxItem("virtualHost", "Virtual Host"));

    addContext(DeploymentWebserviceSubsystem.class, index++);

    addContext(DeployedEjb.class, index++, new TextAreaItem("name", "Name"),
            new TextBoxItem("componentClassname", "Component Classname"),
            new ListItem("declaredRoles", "Declared Roles"), new TextBoxItem("runAsRole", "Run As Role"),
            new TextBoxItem("securityDomain", "Security Domain"));

    addContext(DeployedPersistenceUnit.class, index++, new TextAreaItem("name", "Name"),
            new CheckBoxItem("enabled", "Statistics Enabled"));

    addContext(DeployedServlet.class, index++, new TextAreaItem("name", "Name"),
            new TextBoxItem("servletClass", "Servlet Class"));

    addContext(DeployedEndpoint.class, index++, new TextAreaItem("name", "Name"),
            new TextBoxItem("classname", "Classname"), new TextBoxItem("context", "Context"),
            new TextBoxItem("endpointType", "Type"), new TextBoxItem("wsdl", "WSDL"));
}

From source file:org.jboss.as.console.client.shared.deployment.NewDeploymentWizard.java

License:Open Source License

/**
 *
 * @param presenter/*w  ww .j av a 2  s  .  c o m*/
 * @param window
 * @param isUpdate Are we updating content that is already in the repository?
 * @param oldDeployment The original deployment.  If isUpdate == false, this should be null.
 */
public NewDeploymentWizard(DeployCommandExecutor presenter, DefaultWindow window, boolean isUpdate,
        DeploymentRecord oldDeployment) {
    this.presenter = presenter;
    this.window = window;
    this.isUpdate = isUpdate;
    this.oldDeployment = oldDeployment;

    deck = new DeckPanel();

    step1 = new DeploymentStep1(this, window);
    step2 = new DeploymentStep2(this, window);

    deck.add(step1.asWidget());
    deck.add(step2.asWidget());

    deck.showWidget(0);
}

From source file:org.jboss.as.console.client.shared.patching.wizard.PatchWizard.java

License:Open Source License

@Override
public Widget asWidget() {
    deck = new DeckPanel() {
        @Override//from w ww  .  j  a v  a 2 s . co  m
        public void showWidget(final int index) {
            shrink(); // some steps might have expanded the window
            S state = lookupState(index);
            if (state != null) {
                PatchWizardStep<C, S> step = steps.get(state);
                if (step != null) {
                    step.onShow(context);
                }
            }
            super.showWidget(index);
        }
    };
    for (PatchWizardStep<C, S> step : steps.values()) {
        deck.add(step);
    }
    deck.showWidget(state.ordinal());

    TrappedFocusPanel trap = new TrappedFocusPanel(deck);
    trap.getElement().setId(asId(PREFIX, getClass()));
    return trap;
}

From source file:org.jboss.as.console.client.shared.subsys.elytron.ui.PolicyView.java

License:Apache License

@SuppressWarnings("unchecked")
public Widget asWidget() {
    ToolStrip tools = new ToolStrip();
    addButton = new ToolButton(Console.CONSTANTS.common_label_add(), event -> onAdd());
    tools.addToolButtonRight(addButton);
    tools.addToolButtonRight(new ToolButton(Console.CONSTANTS.common_label_delete(), event -> {
        if (selectionModel.getSelectedObject() != null) {
            String name = selectionModel.getSelectedObject().getName();
            Feedback.confirm(Console.MESSAGES.deleteTitle(title),
                    Console.MESSAGES.deleteConfirm(title + " '" + name + "'"), isConfirmed -> {
                        if (isConfirmed) {
                            circuit.dispatch(new RemoveResourceGeneric(addressTemplate, name));
                        }//w  ww  . j av a  2s.  c o  m
                    });
        }
    }));

    ProvidesKey<Property> providesKey = Property::getName;
    table = new DefaultCellTable<>(5, providesKey);
    dataProvider = new ListDataProvider<>(providesKey);
    dataProvider.addDataDisplay(table);
    TextColumn<Property> nameColumn = new TextColumn<Property>() {
        @Override
        public String getValue(Property node) {
            return node.getName();
        }
    };
    TextColumn<Property> typeColumn = new TextColumn<Property>() {
        @Override
        public String getValue(Property node) {
            if (node.getValue().hasDefined(CUSTOM_POLICY)) {
                return "Custom Policy";
            } else if (node.getValue().hasDefined(JACC_POLICY)) {
                return "JACC Policy";
            } else {
                return "n/a";
            }
        }
    };
    table.addColumn(nameColumn, "Name");
    table.addColumn(typeColumn, "Type");

    DefaultPager pager = new DefaultPager();
    pager.setDisplay(table);

    selectionModel = new SingleSelectionModel<>(providesKey);
    selectionModel.addSelectionChangeHandler(event -> {
        Property selectedProperty = selectionModel.getSelectedObject();
        if (selectedProperty != null) {
            if (selectedProperty.getValue().hasDefined(CUSTOM_POLICY)) {
                forms.showWidget(1);
            } else if (selectedProperty.getValue().hasDefined(JACC_POLICY)) {
                forms.showWidget(2);
            } else {
                forms.showWidget(0);
            }
        } else {
            forms.showWidget(0);
        }
        selectTableItem(selectedProperty);

    });
    table.setSelectionModel(selectionModel);

    ResourceDescription customPolicyDescription = complexAttributeDescription(resourceDescription,
            CUSTOM_POLICY);
    ModelNodeFormBuilder customPolicyFormBuilder = new ModelNodeFormBuilder().include("class-name", "module")
            .unsorted().setResourceDescription(customPolicyDescription).setSecurityContext(securityContext);
    customPolicyForm = customPolicyFormBuilder.build();
    customPolicyForm.getForm().setToolsCallback(new FormCallback() {
        @Override
        @SuppressWarnings("unchecked")
        public void onSave(Map changeset) {
            circuit.dispatch(new ModifyComplexAttribute(addressTemplate, CUSTOM_POLICY,
                    selectionModel.getSelectedObject().getName(), payload(changeset)));
        }

        @Override
        public void onCancel(final Object entity) {
            customPolicyForm.getForm().cancel();
        }
    });

    ResourceDescription jaccPolicyDescription = complexAttributeDescription(resourceDescription, JACC_POLICY);
    ModelNodeFormBuilder jaccPolicyFormBuilder = new ModelNodeFormBuilder()
            .include("policy", "configuration-factory", "module").unsorted()
            .setResourceDescription(jaccPolicyDescription).setSecurityContext(securityContext);
    jaccPolicyForm = jaccPolicyFormBuilder.build();
    jaccPolicyForm.getForm().setToolsCallback(new FormCallback() {
        @Override
        @SuppressWarnings("unchecked")
        public void onSave(Map changeset) {
            circuit.dispatch(new ModifyComplexAttribute(addressTemplate, JACC_POLICY,
                    selectionModel.getSelectedObject().getName(), payload(changeset)));
        }

        @Override
        public void onCancel(final Object entity) {
            jaccPolicyForm.getForm().cancel();
        }
    });

    forms = new DeckPanel();
    forms.add(new Label());
    forms.add(customPolicyForm.asWidget());
    forms.add(jaccPolicyForm.asWidget());
    forms.showWidget(0);

    MultipleToOneLayout layoutBuilder = new MultipleToOneLayout().setPlain(true).setHeadline(title)
            .setDescription(SafeHtmlUtils.fromString(resourceDescription.get(DESCRIPTION).asString()))
            .setMasterTools(tools).setMaster(Console.MESSAGES.available(title), table)
            .addDetail(Console.CONSTANTS.common_label_attributes(), forms.asWidget());
    return layoutBuilder.build();
}

From source file:org.jboss.as.console.client.shared.subsys.jca.wizard.NewDatasourceWizard.java

License:Open Source License

public Widget asWidget() {

    deck = new DeckPanel() {
        @Override//from   w  w  w . j a  va2 s  .  c  om
        public void showWidget(int index) {
            super.showWidget(index);
            trap.getFocus().reset(getWidget(index).getElement());
            trap.getFocus().onFirstInput();
        }
    };

    deck.add(new DatasourceStep1(this).asWidget());

    step2 = new DatasourceStep2(this);
    deck.add(step2.asWidget());

    step3 = new DataSourceStep3(this);
    deck.add(step3.asWidget());

    trap = new TrappedFocusPanel(deck);

    deck.showWidget(0);

    return trap;
}

From source file:org.jboss.as.console.client.shared.subsys.jca.wizard.NewXADatasourceWizard.java

License:Open Source License

public Widget asWidget() {

    deck = new DeckPanel() {
        @Override/*from   www .  j a v  a2  s .  c om*/
        public void showWidget(int index) {
            super.showWidget(index);
            trap.getFocus().reset(getWidget(index).getElement());
            trap.getFocus().onFirstInput();
        }
    };

    deck.add(new XADatasourceStep1(this).asWidget());

    step2 = new XADatasourceStep2(this);
    deck.add(step2.asWidget());

    step3 = new XADatasourceStep3(this);
    deck.add(step3.asWidget());

    step4 = new XADatasourceStep4(this);
    deck.add(step4.asWidget());

    trap = new TrappedFocusPanel(deck);

    deck.showWidget(0);

    return trap;
}

From source file:org.jboss.as.console.client.teiid.TransportWizard.java

License:Apache License

public Widget asWidget() {
    this.deck = new DeckPanel() {
        @Override/*from   w  ww .  j  a  v a2 s. c  o  m*/
        public void showWidget(int index) {
            super.showWidget(index);
            trap.getFocus().reset(getWidget(index).getElement());
            trap.getFocus().onFirstInput();
        }
    };

    List<FormItem<?>> commonItems = TransportEditor.buildCommonFormItems();
    deck.add(stepWizard(commonItems.toArray(new FormItem<?>[commonItems.size()]), 0, true));
    /*
    List<FormItem<?>> sslItems = TransportEditor.buildSSLFormItems();
    deck.add(stepWizard(this.transport, sslItems.toArray(new FormItem<?>[sslItems.size()]), 1, true));
    */
    trap = new TrappedFocusPanel(deck);
    deck.showWidget(0);
    return trap;
}

From source file:org.jboss.as.console.client.widgets.tabs.OffPageContainer.java

License:Open Source License

OffPageContainer() {
    this.deck = new DeckPanel();
    this.texts = new ArrayList<>();
}