List of usage examples for com.google.gwt.user.client.ui CheckBox CheckBox
protected CheckBox(Element elem)
From source file:org.gwtportlets.portlet.client.ui.MenuPortlet.java
License:Open Source License
public void configure() { final TextBox path = new TextBox(); path.setVisibleLength(30);/*from ww w. j a v a 2s . c om*/ path.setTitle("Any content served from the web application " + "(JSP pages, static HTML etc.)"); path.setText(getPath()); final CheckBox vertical = new CheckBox("Vertical menu bar"); vertical.setTitle("Open first level sub menus to the right (true) or " + "below (false)"); vertical.setValue(isVertical()); FormBuilder b = new FormBuilder(); b.label("Menu template path").field(path).endRow(); b.field(vertical).colspan(2).endRow(); final Dialog dlg = new Dialog(); dlg.setText("Configure " + getWidgetName()); dlg.setWidget(b.getForm()); dlg.addButton(new CssButton("OK", new ClickHandler() { public void onClick(ClickEvent event) { dlg.hide(); setPath(path.getText().trim()); setVertical(vertical.getValue()); refresh(); } })); dlg.addCloseButton("Cancel"); dlg.showNextTo(this); }
From source file:org.jax.pubarray.gwtqueryapp.client.ProbeDetailsContainer.java
License:Open Source License
/** * Constructor/* w w w . ja v a 2 s .c om*/ * @param graphingService * the graphing service to use * @param designTerms * the metadata */ public ProbeDetailsContainer(GraphingServiceAsync graphingService, TableColumnMetadata[] designTerms) { this.graphingService = graphingService; this.probeIntensityPlotContainer = new LayoutContainer(); this.probeIntensityPlot = new Image(); this.mainPanel = new ContentPanel(); this.graphConfiguration = new ProbeIntensityGraphConfiguration(); this.designTermsStore = new ListStore<ModelData>(); List<ModelData> designTermModels = TableColumnMetadataModelUtil.fromPojosToModels(true, Arrays.asList(designTerms)); this.designTermsStore.add(designTermModels); this.orderByComboBox = new ComboBox<ModelData>(); this.orderByComboBox.setStore(this.designTermsStore); this.orderByComboBox.setDisplayField(TableColumnMetadata.NAME_PROP_STRING); this.orderByComboBox.setEditable(false); this.orderByComboBox.setAllowBlank(true); this.orderByComboBox.setForceSelection(true); this.orderByComboBox.setTypeAhead(false); this.orderByComboBox.setEmptyText("Select Design Term"); this.orderByComboBox.setTriggerAction(TriggerAction.ALL); this.orderByComboBox.addSelectionChangedListener(new SelectionChangedListener<ModelData>() { /** * {@inheritDoc} */ @Override public void selectionChanged(SelectionChangedEvent<ModelData> se) { TableColumnMetadata selectedDesignTerm = TableColumnMetadataModelUtil .fromModelToPojo(se.getSelectedItem()); ProbeDetailsContainer.this.setSelectedDesignTerm(selectedDesignTerm); ProbeDetailsContainer.this.groupReplicatesCheckBox.setEnabled(true); } }); this.groupReplicatesCheckBox = new CheckBox("Group Arrays Using"); this.groupReplicatesCheckBox.setValue(Boolean.FALSE, true); this.groupReplicatesCheckBox.setEnabled(false); this.groupReplicatesCheckBox.addValueChangeHandler(new ValueChangeHandler<Boolean>() { /** * {@inheritDoc} */ public void onValueChange(ValueChangeEvent<Boolean> event) { ProbeDetailsContainer.this.groupReplicatesChanged(); } }); final ListStore<ModelData> groupGraphTypeStore = new ListStore<ModelData>(); final BaseModel scatterPlotModel = new BaseModel(); scatterPlotModel.set(GROUP_GRAPH_ENUM_KEY, GroupedGraphType.SCATTER_PLOT); scatterPlotModel.set(GROUP_GRAPH_NAME_KEY, "Scatter Plot"); groupGraphTypeStore.add(scatterPlotModel); final BaseModel boxPlotModel = new BaseModel(); boxPlotModel.set(GROUP_GRAPH_ENUM_KEY, GroupedGraphType.BOX_PLOT); boxPlotModel.set(GROUP_GRAPH_NAME_KEY, "Box Plot"); groupGraphTypeStore.add(boxPlotModel); this.groupGraphTypeComboBox = new ComboBox<ModelData>(); this.groupGraphTypeComboBox.setEnabled(false); this.groupGraphTypeComboBox.setStore(groupGraphTypeStore); this.groupGraphTypeComboBox.setDisplayField(GROUP_GRAPH_NAME_KEY); this.groupGraphTypeComboBox.setEditable(false); this.groupGraphTypeComboBox.setAllowBlank(false); this.groupGraphTypeComboBox.setForceSelection(true); this.groupGraphTypeComboBox.setTypeAhead(false); this.groupGraphTypeComboBox.setValue(scatterPlotModel); this.groupGraphTypeComboBox.setTriggerAction(TriggerAction.ALL); this.groupGraphTypeComboBox.addSelectionChangedListener(new SelectionChangedListener<ModelData>() { /** * {@inheritDoc} */ @Override public void selectionChanged(SelectionChangedEvent<ModelData> se) { ProbeDetailsContainer.this.groupGraphTypeChanged(); } }); this.probeIntensityPlot.addLoadHandler(new LoadHandler() { /** * {@inheritDoc} */ public void onLoad(LoadEvent event) { ProbeDetailsContainer.this.probeIntensityPlotLoaded(); } }); this.probeIntensityPlot.addErrorHandler(new ErrorHandler() { /** * {@inheritDoc} */ public void onError(ErrorEvent event) { ProbeDetailsContainer.this.showErrorMask("Error Loading Image"); } }); }
From source file:org.jboss.as.console.client.domain.groups.deployment.ServerGroupSelector.java
License:Open Source License
private DefaultWindow makeWindow(DeploymentRecord deployment, ListDataProvider<ServerGroupSelection> dataProvider) { DefaultWindow window = new DefaultWindow(Console.MESSAGES.selectServerGroups()); window.setWidth(640);/*from w w w . j a v a2 s . c om*/ window.setHeight(480); window.setGlassEnabled(true); window.addCloseHandler(new CloseHandler<PopupPanel>() { @Override public void onClose(CloseEvent<PopupPanel> event) { } }); VerticalPanel layout = new VerticalPanel(); layout.addStyleName("window-content"); layout.add(new HTML("<h3>" + Console.MESSAGES.selectServerGroupsFor(deployment.getName()) + "</h3>")); Widget table = makeSelectionTable(dataProvider); layout.add(table); CheckBox enableBox = new CheckBox(Console.CONSTANTS.common_label_enable() + " " + deployment.getName()); enableBox.setValue(Boolean.TRUE); layout.add(enableBox); DialogueOptions options = new DialogueOptions( new GroupSelectSubmitHandler(this.deployment, window, enableBox), new CancelHandler(window)); Widget content = new WindowContentBuilder(layout, options).build(); window.trapWidget(content); return window; }
From source file:org.jboss.as.console.client.shared.patching.wizard.apply.ConflictStep.java
License:Open Source License
@Override protected IsWidget body(final ApplyContext context) { FlowPanel body = new FlowPanel(); body.add(new HTML(TEMPLATES.errorPanel(Console.CONSTANTS.patch_manager_conflict_body()))); errorDetails = new ErrorDetails(Console.CONSTANTS.patch_manager_show_details(), Console.CONSTANTS.patch_manager_hide_details()); body.add(errorDetails);/*from w w w. j a v a 2 s .co m*/ body.add(new HTML("<h3 class=\"patch-followup-header\">" + Console.CONSTANTS.patch_manager_possible_actions() + "</h3>")); HTMLPanel actions = new HTMLPanel( TEMPLATES.patchConflicts(Console.CONSTANTS.patch_manager_conflict_cancel_title(), Console.CONSTANTS.patch_manager_conflict_cancel_body(), Console.MESSAGES.patch_manager_conflict_override_title(), Console.CONSTANTS.patch_manager_conflict_override_body())); overrideCheck = new CheckBox(Console.CONSTANTS.patch_manager_conflict_override_check()); overrideCheck.getElement().setId(asId(PREFIX, getClass(), "_Override")); overrideCheck.addValueChangeHandler(new ValueChangeHandler<Boolean>() { @Override public void onValueChange(final ValueChangeEvent<Boolean> event) { setEnabled(event.getValue(), true); } }); actions.add(overrideCheck, "patch-conflict-override"); body.add(actions); return body; }
From source file:org.jboss.as.console.client.shared.runtime.logging.viewer.LogFilePanel.java
License:Open Source License
public LogFilePanel(final Dispatcher circuit, final LogFile logFile) { this.circuit = circuit; this.name = logFile.getName(); panel = new VerticalPanel(); panel.addStyleName("fill-layout-width"); panel.getElement().getStyle().setPadding(30, Style.Unit.PX); panel.add(new HTML("<h3>" + logFile.getName() + "</h3>")); // No search box: The search works only inside the currently displayed lines, not over the whole // log file. It's better to disable search than having a search which is ambiguous to the user. // panel.add(new SearchBox()); editor = new AceEditor(); editor.addAttachHandler(new AttachEvent.Handler() { @Override/*from www . j a v a2 s. c om*/ public void onAttachOrDetach(AttachEvent event) { if (event.isAttached()) { Scheduler.get().scheduleDeferred(new Scheduler.ScheduledCommand() { @Override public void execute() { editor.startEditor(); editor.setReadOnly(true); editor.setShowGutter(false); editor.setShowPrintMargin(false); editor.setModeByName("logfile"); editor.setThemeByName("logfile"); editor.setText(logFile.getContent()); editor.setFontSize("11px"); editor.setVScrollBarVisible(false); } }); } } }); indicator = new LogFileIndicator(); HorizontalPanel editorPanel = new HorizontalPanel(); editorPanel.setStyleName("fill-layout-width"); editorPanel.add(indicator); editorPanel.add(editor); indicator.getElement().getParentElement().getStyle().setWidth(15, PX); indicator.getElement().getParentElement().getStyle().setBackgroundColor("#030303"); panel.add(editorPanel); follow = new CheckBox("Auto Refresh"); follow.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { if (follow.getValue()) { circuit.dispatch(new FollowLogFile()); } else { circuit.dispatch(new UnFollowLogFile()); } } }); follow.getElement().getStyle().setMarginLeft(1, EM); setId(follow, BASE_ID, "auto_refresh"); head = new ToolButton("Head", new ClickHandler() { @Override public void onClick(ClickEvent event) { onNavigate(HEAD); } }); head.setOperationAddress("/{implicit.host}/{selected.server}/subsystem=logging", "read-log-file"); setId(head, BASE_ID, "head"); prev = new ToolButton("<i class=\"icon-angle-up\"></i>", new ClickHandler() { @Override public void onClick(ClickEvent event) { onNavigate(PREVIOUS); } }); prev.setOperationAddress("/{implicit.host}/{selected.server}/subsystem=logging", "read-log-file"); setId(prev, BASE_ID, "prev"); next = new ToolButton("<i class=\"icon-angle-down\"></i>", new ClickHandler() { @Override public void onClick(ClickEvent event) { onNavigate(NEXT); } }); next.setOperationAddress("/{implicit.host}/{selected.server}/subsystem=logging", "read-log-file"); setId(next, BASE_ID, "next"); tail = new ToolButton("Tail", new ClickHandler() { @Override public void onClick(ClickEvent event) { onNavigate(TAIL); } }); tail.setOperationAddress("/{implicit.host}/{selected.server}/subsystem=logging", "read-log-file"); setId(tail, BASE_ID, "tail"); ToolStrip navigationTools = new ToolStrip(); navigationTools.addToolButton(head); navigationTools.addToolButton(prev); navigationTools.addToolButton(next); navigationTools.addToolButton(tail); navigationTools.addToolWidget(follow); panel.add(navigationTools); resizeHandler = Window.addResizeHandler(new ResizeHandler() { @Override public void onResize(ResizeEvent event) { LogFilePanel.this.onResize(); } }); initWidget(panel); //setStyleName("rhs-content-panel"); }
From source file:org.jboss.as.console.client.shared.runtime.logviewer.LogFilePanel.java
License:Open Source License
public LogFilePanel(final Dispatcher circuit, final LogFile logFile) { this.circuit = circuit; this.name = logFile.getName(); panel = new VerticalPanel(); panel.setStyleName("rhs-content-panel"); panel.add(new HTML("<h3>" + logFile.getName() + "</h3>")); // No search box: The search works only inside the currently displayed lines not over the whole // log file. It's better to disable search than having a search which is ambiguous to the user. // panel.add(new SearchBox()); editor = new AceEditor(); editor.addAttachHandler(new AttachEvent.Handler() { @Override/* ww w. j a v a 2 s . com*/ public void onAttachOrDetach(AttachEvent event) { if (event.isAttached()) { Scheduler.get().scheduleDeferred(new Scheduler.ScheduledCommand() { @Override public void execute() { editor.startEditor(); editor.setReadOnly(true); editor.setShowGutter(false); editor.setShowPrintMargin(false); editor.setModeByName("logfile"); editor.setThemeByName("logfile"); editor.setText(logFile.getContent()); editor.setVScrollBarVisible(false); } }); } } }); indicator = new LogFileIndicator(); HorizontalPanel editorPanel = new HorizontalPanel(); editorPanel.setStyleName("fill-layout-width"); editorPanel.add(editor); editorPanel.add(indicator); indicator.getElement().getParentElement().getStyle().setWidth(4, PX); indicator.getElement().getParentElement().getStyle().setPaddingLeft(4, PX); panel.add(editorPanel); follow = new CheckBox("Auto Refresh"); follow.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { if (follow.getValue()) { circuit.dispatch(new FollowLogFile()); } else { circuit.dispatch(new UnFollowLogFile()); } } }); setId(follow, BASE_ID, "auto_refresh"); position = new Label(); position.getElement().setAttribute("style", "padding-right:15px;padding-top:4px;"); setId(position, BASE_ID, "position"); head = new ToolButton("Head", new ClickHandler() { @Override public void onClick(ClickEvent event) { onNavigate(HEAD); } }); setId(head, BASE_ID, "head"); prev = new ToolButton("<i class=\"icon-angle-up\"></i>", new ClickHandler() { @Override public void onClick(ClickEvent event) { onNavigate(PREVIOUS); } }); setId(prev, BASE_ID, "prev"); next = new ToolButton("<i class=\"icon-angle-down\"></i>", new ClickHandler() { @Override public void onClick(ClickEvent event) { onNavigate(NEXT); } }); setId(next, BASE_ID, "next"); tail = new ToolButton("Tail", new ClickHandler() { @Override public void onClick(ClickEvent event) { onNavigate(TAIL); } }); setId(tail, BASE_ID, "tail"); ToolStrip navigationTools = new ToolStrip(); navigationTools.addToolWidget(follow); navigationTools.addToolWidgetRight(position); navigationTools.addToolButtonRight(head); navigationTools.addToolButtonRight(prev); navigationTools.addToolButtonRight(next); navigationTools.addToolButtonRight(tail); panel.add(navigationTools); resizeHandler = Window.addResizeHandler(new ResizeHandler() { @Override public void onResize(ResizeEvent event) { LogFilePanel.this.onResize(); } }); initWidget(panel); setStyleName("rhs-content-panel"); }
From source file:org.jboss.bpm.console.client.monitor.ExecutionHistoryView.java
License:Apache License
public void provideWidget(ProvisioningCallback callback) { this.controller = Registry.get(Controller.class); controller.addView(ID, this); controller.addAction(GetProcessDefinitionsAction.ID, new GetProcessDefinitionsAction()); controller.addAction(LoadDatasetsAction.ID, new LoadDatasetsAction()); controller.addAction(LoadChartProcessInstancesAction.ID, new LoadChartProcessInstancesAction()); LayoutPanel panel = new LayoutPanel(new BoxLayout(BoxLayout.Orientation.VERTICAL)); final ToolBar toolBar = new ToolBar(); panel.add(toolBar, new BoxLayoutData(BoxLayoutData.FillStyle.HORIZONTAL)); // -----//w ww . j a va2s. c o m menuButton = new ToolButton("Open", new ClickHandler() { public void onClick(ClickEvent clickEvent) { controller.handleEvent(new Event(GetProcessDefinitionsAction.ID, null)); } }); toolBar.add(menuButton); // ----- title = new HTML(); title.getElement().setAttribute("style", "font-size:24px; font-weight:BOLD"); // ------------ BoxLayout boxLayout = new BoxLayout(BoxLayout.Orientation.HORIZONTAL); timespanPanel = new LayoutPanel(boxLayout); timespanPanel.setPadding(0); timespan = new HTML(); timespan.getElement().setAttribute("style", "padding-left:10px;padding-top:2px; color:#C8C8C8;font-size:16px;text-align:left;"); timespanButton = new ToolButton(); timespanButton.setStyle(ToolButton.ToolButtonStyle.MENU); timespanButton.getElement().setAttribute("style", "padding-right:0px;background-image:none;"); timespanButton.setVisible(false); final PopupMenu timeBtnMenu = new PopupMenu(); for (final TimespanValues ts : TimespanValues.values()) { timeBtnMenu.addItem(ts.getCanonicalName(), new Command() { public void execute() { LoadDatasetEvent theEvent = new LoadDatasetEvent(); String theDefinitionId = getDefinitionId(currentProcDef); if (theDefinitionId == null) { return; } theEvent.setDefinitionId(theDefinitionId); theEvent.setTimespan(ts); currentTimespan = ts; if (includeFailed.getValue()) { theEvent.setIncludedFailed(true); } else { theEvent.setIncludedFailed(false); } LoadingOverlay.on(chartArea, true); controller.handleEvent(new Event(LoadDatasetsAction.ID, theEvent)); } }); } ; timespanButton.setMenu(timeBtnMenu); timespanPanel.add(timespanButton, new BoxLayoutData("20px", "20px")); timespanPanel.add(timespan, new BoxLayoutData(BoxLayoutData.FillStyle.HORIZONTAL)); // ------------ final LayoutPanel contents = new LayoutPanel(new RowLayout()); LayoutPanel headerPanel = new LayoutPanel(new ColumnLayout()); headerPanel.setPadding(0); headerPanel.add(title, new ColumnLayoutData("55%")); headerPanel.add(timespanPanel, new ColumnLayoutData("45%")); // ------------ chartArea = new LayoutPanel(); chartArea.setPadding(15); chartArea.setLayout(new BorderLayout()); instancePanel = new LayoutPanel(); listBox = new org.gwt.mosaic.ui.client.ListBox(new String[] { "Process Instance" }); instancePanel.add(listBox); contents.add(headerPanel, new RowLayoutData("100")); contents.add(chartArea, new RowLayoutData(true)); // ------------ includeFailed = new CheckBox("Incl. failed / terminated?"); includeFailed.setValue(false); includeFailed.addValueChangeHandler(new ValueChangeHandler<Boolean>() { public void onValueChange(ValueChangeEvent<Boolean> isEnabled) { LoadDatasetEvent theEvent = new LoadDatasetEvent(); String theDefinitionId = getDefinitionId(currentProcDef); if (theDefinitionId == null) { return; } theEvent.setDefinitionId(theDefinitionId); theEvent.setTimespan(currentTimespan); if (includeFailed.getValue()) { theEvent.setIncludedFailed(true); } else { theEvent.setIncludedFailed(false); } LoadingOverlay.on(chartArea, true); controller.handleEvent(new Event(LoadDatasetsAction.ID, theEvent)); } }); buttonPanel = new LayoutPanel(new BoxLayout(BoxLayout.Orientation.VERTICAL)); buttonPanel.add(includeFailed); // ------------ panel.add(contents, new BoxLayoutData(BoxLayoutData.FillStyle.BOTH)); ErraiBus.get().subscribe("process.execution.history", new MessageCallback() { public void callback(Message message) { String processName = message.get(String.class, "processName"); String processDefinitionId = message.get(String.class, "processDefinitionId"); update(processName, processDefinitionId); } }); callback.onSuccess(panel); }
From source file:org.jboss.ci.tracker.client.widgets.CustomWidgets.java
License:Open Source License
public static DialogBox filterDialogBox(final ResultList resultList, List<CategorizationDto> categorizations, List<CategoryDto> categories, List<PossibleResultDto> possibleResults, FilterDto oldFilter) { final DialogBox box = new DialogBox(); final VerticalPanel panel = new VerticalPanel(); panel.setSize("20em", "20em"); box.setText("Filter results"); // ----------------------- Possible results final Label resultsLabel = new Label("Results"); panel.add(resultsLabel);/*from w w w . j ava 2 s . co m*/ for (PossibleResultDto possibleResult : possibleResults) { final CheckBox checkBox = new CheckBox(possibleResult.getName()); checkBox.setName(POSSIBLE_RESULT_SEPARATOR_PREFIX + possibleResult.getId().toString()); panel.add(checkBox); } // ----------------------- Categorizations and categories for (CategorizationDto categorization : categorizations) { final Label categorizationLabel = new Label(categorization.getName()); panel.add(categorizationLabel); for (CategoryDto category : categories) { if (category.getCategorizationId().equals(categorization.getId())) { final CheckBox checkBox = new CheckBox(category.getName()); checkBox.setName(CATEGORY_SEPARATOR_PREFIX + category.getId().toString()); panel.add(checkBox); } } } // ----------------------- Date from final DateTimeFormat dateTimeFormat = DateTimeFormat.getFormat("d.M.yyyy"); final DateBox dateBoxFrom = new DateBox(); dateBoxFrom.setFormat(new DateBox.DefaultFormat(dateTimeFormat)); dateBoxFrom.getDatePicker().setYearArrowsVisible(true); panel.add(new Label("From")); dateBoxFrom.setTitle("Midnight of the day, i.e. time 00:00"); panel.add(dateBoxFrom); // ----------------------- Date to final DateBox dateBoxTo = new DateBox(); dateBoxTo.setFormat(new DateBox.DefaultFormat(dateTimeFormat)); dateBoxTo.getDatePicker().setYearArrowsVisible(true); panel.add(new Label("To")); dateBoxTo.setTitle("Midnight of the day, i.e. time 00:00"); panel.add(dateBoxTo); // ----------------------- Set widgets according to filter setWidgetValues(panel, oldFilter, dateBoxFrom, dateBoxTo); // ----------------------- Filter button final Button buttonFilter = new Button("OK", new ClickHandler() { @Override public void onClick(final ClickEvent event) { FilterDto filter = new FilterDto(); Iterator<Widget> arrayOfWidgets = panel.iterator(); while (arrayOfWidgets.hasNext()) { Widget widget = arrayOfWidgets.next(); if (widget instanceof CheckBox) { CheckBox checkBox = (CheckBox) widget; if (checkBox.getValue()) { if (checkBox.getName().startsWith(CATEGORY_SEPARATOR_PREFIX)) { filter.addCategoryId(Integer.parseInt( checkBox.getName().substring(CATEGORY_SEPARATOR_PREFIX.length()))); } else if (checkBox.getName().startsWith(POSSIBLE_RESULT_SEPARATOR_PREFIX)) { filter.addPossibleResultId(Integer.parseInt( checkBox.getName().substring(POSSIBLE_RESULT_SEPARATOR_PREFIX.length()))); } } } } filter.setDateFrom(dateBoxFrom.getValue()); filter.setDateTo(dateBoxTo.getValue()); resultList.filterResults(filter); box.hide(); } }); buttonFilter.setWidth("5em"); panel.add(buttonFilter); panel.setCellHorizontalAlignment(buttonFilter, HasAlignment.ALIGN_RIGHT); // ----------------------- Show all results button final Button buttonShowAll = new Button("Clear", new ClickHandler() { @Override public void onClick(final ClickEvent event) { resultList.filterResults(null); box.hide(); } }); buttonShowAll.setWidth("5em"); panel.add(buttonShowAll); panel.setCellHorizontalAlignment(buttonShowAll, HasAlignment.ALIGN_RIGHT); // ----------------------- Cancel button final Button buttonCancel = new Button("Cancel", new ClickHandler() { @Override public void onClick(final ClickEvent event) { box.hide(); } }); buttonCancel.setWidth("5em"); panel.add(buttonCancel); panel.setCellHorizontalAlignment(buttonCancel, HasAlignment.ALIGN_RIGHT); box.add(panel); return box; }