List of usage examples for com.google.gwt.user.client.ui RadioButton isChecked
@Deprecated public boolean isChecked()
From source file:com.dimdim.conference.ui.user.client.meetinglobby.MeetingLobbyControlPanel.java
License:Open Source License
public void applyChanges() { int size = this.users.size(); for (int i = size - 1; i >= 0; i--) { RadioButton accept = (RadioButton) this.acceptBoxes.elementAt(i); RadioButton deny = (RadioButton) this.denyBoxes.elementAt(i); if (accept.isChecked() || deny.isChecked()) { UIRosterEntry user = (UIRosterEntry) this.users.elementAt(i); Widget row = (Widget) this.rows.elementAt(i); if (accept.isChecked()) { this.userRosterManager.grantEntryToUser(user); } else { this.userRosterManager.denyEntryToUser(user); }//from w w w . j av a 2 s. c om this.scrolledTable.remove(row); this.acceptBoxes.remove(i); this.denyBoxes.remove(i); this.users.remove(i); this.rows.remove(i); } } }
From source file:com.ephesoft.dcma.gwt.rv.client.view.RadioButtonDialogView.java
License:Open Source License
@UiHandler("okButton") protected void onOk(ClickEvent event) { int radioButtonNumber = -1; if (radioButtonList != null) { int index = 0; for (RadioButton radioButton : radioButtonList) { if (radioButton.isChecked()) { radioButtonNumber = index; break; }//w ww. ja v a 2 s. c o m index++; } } listener.onOkClick(radioButtonNumber); hide(); }
From source file:org.drools.brms.client.packages.PackageBuilderWidget.java
License:Apache License
/** * This will display a dialog for creating a snapshot. *//*from w ww. j av a2s . c o m*/ private void showSnapshotDialog(Widget w) { LoadingPopup.showMessage("Loading existing snapshots..."); final FormStylePopup form = new FormStylePopup("images/snapshot.png", "Create a snapshot for deployment."); form.addRow(new HTML("<i>A package snapshot is essentially a " + "read only 'locked in' and labelled view of a package at a point in time, which can be used for deployment.</i>")); final VerticalPanel vert = new VerticalPanel(); form.addAttribute("Choose or create snapshot name:", vert); final List radioList = new ArrayList(); final TextBox newName = new TextBox(); final String newSnapshotText = "NEW: "; RepositoryServiceFactory.getService().listSnapshots(conf.name, new GenericCallback() { public void onSuccess(Object data) { SnapshotInfo[] result = (SnapshotInfo[]) data; for (int i = 0; i < result.length; i++) { RadioButton existing = new RadioButton("snapshotNameGroup", result[i].name); radioList.add(existing); vert.add(existing); } HorizontalPanel newSnap = new HorizontalPanel(); final RadioButton newSnapRadio = new RadioButton("snapshotNameGroup", newSnapshotText); newSnap.add(newSnapRadio); newName.setEnabled(false); newSnapRadio.addClickListener(new ClickListener() { public void onClick(Widget w) { newName.setEnabled(true); } }); newSnap.add(newName); radioList.add(newSnapRadio); vert.add(newSnap); LoadingPopup.close(); } }); final TextBox comment = new TextBox(); form.addAttribute("Comment:", comment); Button create = new Button("Create new snapshot"); form.addAttribute("", create); create.addClickListener(new ClickListener() { String name = ""; public void onClick(Widget w) { boolean replace = false; for (Iterator iter = radioList.iterator(); iter.hasNext();) { RadioButton but = (RadioButton) iter.next(); if (but.isChecked()) { name = but.getText(); if (!but.getText().equals(newSnapshotText)) { replace = true; } break; } } if (name.equals(newSnapshotText)) { name = newName.getText(); } if (name.equals("")) { Window.alert("You have to enter or chose a label (name) for the snapshot."); return; } RepositoryServiceFactory.getService().createPackageSnapshot(conf.name, name, replace, comment.getText(), new GenericCallback() { public void onSuccess(Object data) { Window.alert("The snapshot called: " + name + " was successfully created."); form.hide(); } }); } }); form.setWidth("50%"); form.setPopupPosition((DirtyableComposite.getWidth() - form.getOffsetWidth()) / 2, 100); form.show(); // form.setPopupPosition( Window.getClientWidth() / 3, // Window.getClientHeight() / 3 ); // form.show(); }
From source file:org.drools.guvnor.client.packages.PackageBuilderWidget.java
License:Apache License
/** * This will display a dialog for creating a snapshot. *//*ww w . jav a2 s . c om*/ public static void showSnapshotDialog(final String packageName) { LoadingPopup.showMessage("Loading existing snapshots..."); final FormStylePopup form = new FormStylePopup("images/snapshot.png", "Create a snapshot for deployment."); form.addRow(new HTML("<i>A package snapshot is a " + "read only 'locked in' and labelled view of a package at a point in time, which can be used for deployment.</i>" + "<b>You should build the package before taking a snapshot, generally.</b>")); final VerticalPanel vert = new VerticalPanel(); form.addAttribute("Choose or create snapshot name:", vert); final List radioList = new ArrayList(); final TextBox newName = new TextBox(); final String newSnapshotText = "NEW: "; RepositoryServiceFactory.getService().listSnapshots(packageName, new GenericCallback() { public void onSuccess(Object data) { SnapshotInfo[] result = (SnapshotInfo[]) data; for (int i = 0; i < result.length; i++) { RadioButton existing = new RadioButton("snapshotNameGroup", result[i].name); radioList.add(existing); vert.add(existing); } HorizontalPanel newSnap = new HorizontalPanel(); final RadioButton newSnapRadio = new RadioButton("snapshotNameGroup", newSnapshotText); newSnap.add(newSnapRadio); newName.setEnabled(false); newSnapRadio.addClickListener(new ClickListener() { public void onClick(Widget w) { newName.setEnabled(true); } }); newSnap.add(newName); radioList.add(newSnapRadio); vert.add(newSnap); LoadingPopup.close(); } }); final TextBox comment = new TextBox(); form.addAttribute("Comment:", comment); Button create = new Button("Create new snapshot"); form.addAttribute("", create); create.addClickListener(new ClickListener() { String name = ""; public void onClick(Widget w) { boolean replace = false; for (Iterator iter = radioList.iterator(); iter.hasNext();) { RadioButton but = (RadioButton) iter.next(); if (but.isChecked()) { name = but.getText(); if (!but.getText().equals(newSnapshotText)) { replace = true; } break; } } if (name.equals(newSnapshotText)) { name = newName.getText(); } if (name.equals("")) { Window.alert("You have to enter or chose a label (name) for the snapshot."); return; } RepositoryServiceFactory.getService().createPackageSnapshot(packageName, name, replace, comment.getText(), new GenericCallback() { public void onSuccess(Object data) { Window.alert("The snapshot called: " + name + " was successfully created."); form.hide(); } }); } }); form.show(); // form.setPopupPosition( Window.getClientWidth() / 3, // Window.getClientHeight() / 3 ); // form.show(); }