當前位置: 首頁>>代碼示例>>Java>>正文


Java CheckBox類代碼示例

本文整理匯總了Java中com.google.gwt.user.client.ui.CheckBox的典型用法代碼示例。如果您正苦於以下問題:Java CheckBox類的具體用法?Java CheckBox怎麽用?Java CheckBox使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


CheckBox類屬於com.google.gwt.user.client.ui包,在下文中一共展示了CheckBox類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: render

import com.google.gwt.user.client.ui.CheckBox; //導入依賴的package包/類
@Override
public Element render(
    final Node node, final String domID, final Tree.Joint joint, final int depth) {
  // Initialize HTML elements.
  final Element rootContainer = super.render(node, domID, joint, depth);
  final Element nodeContainer = rootContainer.getFirstChildElement();
  final Element checkBoxElement = new CheckBox().getElement();
  final InputElement checkBoxInputElement =
      (InputElement) checkBoxElement.getElementsByTagName("input").getItem(0);

  final Path nodePath =
      node instanceof ChangedFileNode
          ? Path.valueOf(node.getName())
          : ((ChangedFolderNode) node).getPath();
  setCheckBoxState(nodePath, checkBoxInputElement);
  setCheckBoxClickHandler(nodePath, checkBoxElement, checkBoxInputElement.isChecked());

  // Paste check-box element to node container.
  nodeContainer.insertAfter(checkBoxElement, nodeContainer.getFirstChild());

  return rootContainer;
}
 
開發者ID:eclipse,項目名稱:che,代碼行數:23,代碼來源:CheckBoxRender.java

示例2: setProperties

import com.google.gwt.user.client.ui.CheckBox; //導入依賴的package包/類
public void setProperties(RoomPropertiesInterface properties) {
	iProperties = properties;
	iRooms.setProperties(properties);
	
	iFutureSessions.clear();
	iForm.getRowFormatter().setVisible(iFutureSessionsRow, iProperties.hasFutureSessions());
	if (iProperties.hasFutureSessions()) {
		CheckBox current = new CheckBox(iProperties.getAcademicSessionName());
		current.setValue(true); current.setEnabled(false);
		current.addStyleName("future-session");
		iFutureSessions.add(current);
		for (AcademicSessionInterface session: iProperties.getFutureSessions()) {
			if (session.isCanAddGlobalRoomGroup() || session.isCanAddDepartmentalRoomGroup()) {
				CheckBox ch = new CheckBox(session.getLabel());
				iFutureSessionsToggles.put(session.getId(), ch);
				ch.addStyleName("future-session");
				iFutureSessions.add(ch);
			}
		}
	}
}
 
開發者ID:Jenner4S,項目名稱:unitimes,代碼行數:22,代碼來源:RoomGroupEdit.java

示例3: fillFutureFlags

import com.google.gwt.user.client.ui.CheckBox; //導入依賴的package包/類
protected void fillFutureFlags(UpdateRoomGroupRequest request) {
	if (iProperties.hasFutureSessions()) {
		for (AcademicSessionInterface session: iProperties.getFutureSessions()) {
			CheckBox ch = iFutureSessionsToggles.get(session.getId());
			if (ch != null) {
				Integer flags = RoomCookie.getInstance().getFutureFlags(session.getId());
				if (ch.getValue()) {
					request.addFutureSession(session.getId());
					if (flags == null)
						RoomCookie.getInstance().setFutureFlags(session.getId(), FutureOperation.getFlagDefaultsEnabled());
				} else {
					if (flags != null)
						RoomCookie.getInstance().setFutureFlags(session.getId(), null);
				}
			}
		}
	}
}
 
開發者ID:Jenner4S,項目名稱:unitimes,代碼行數:19,代碼來源:RoomGroupEdit.java

示例4: fillFutureFlags

import com.google.gwt.user.client.ui.CheckBox; //導入依賴的package包/類
protected void fillFutureFlags(UpdateRoomFeatureRequest request) {
	if (iProperties.hasFutureSessions()) {
		for (AcademicSessionInterface session: iProperties.getFutureSessions()) {
			CheckBox ch = iFutureSessionsToggles.get(session.getId());
			if (ch != null) {
				Integer flags = RoomCookie.getInstance().getFutureFlags(session.getId());
				if (ch.getValue()) {
					request.addFutureSession(session.getId());
					if (flags == null)
						RoomCookie.getInstance().setFutureFlags(session.getId(), FutureOperation.getFlagDefaultsEnabled());
				} else {
					if (flags != null)
						RoomCookie.getInstance().setFutureFlags(session.getId(), null);
				}
			}
		}
	}
}
 
開發者ID:Jenner4S,項目名稱:unitimes,代碼行數:19,代碼來源:RoomFeatureEdit.java

示例5: generateAlsoUpdateMessage

import com.google.gwt.user.client.ui.CheckBox; //導入依賴的package包/類
protected String generateAlsoUpdateMessage(boolean includeWhenNoFlags) {
	if ((iRoom.getUniqueId() == null && iProperties.hasFutureSessions()) || iRoom.hasFutureRooms()) {
		List<String> ret = new ArrayList<String>();
		for (int i = 1; i < iApplyTo.getRowCount(); i++) {
			CheckBox ch = (CheckBox)iApplyTo.getWidget(i, 0);
			if (ch.getValue()) {
				int flags = 0;
				for (FutureOperation op: FutureOperation.values()) {
					CheckBox x = (CheckBox)iApplyTo.getWidget(i, 6 + op.ordinal());
					if (x.getValue())
						flags = op.set(flags);
				}
				if (flags == 0 && !includeWhenNoFlags) continue;
				ret.add(iApplyTo.getData(i).getSession().getLabel());
			}
		}
		if (!ret.isEmpty())
			return ToolBox.toString(ret);
	}
	return null;
}
 
開發者ID:Jenner4S,項目名稱:unitimes,代碼行數:22,代碼來源:RoomEdit.java

示例6: PeriodPreferencesWidget

import com.google.gwt.user.client.ui.CheckBox; //導入依賴的package包/類
public PeriodPreferencesWidget(boolean editable) {
	iEditable = editable;

	iPanel = new AbsolutePanel();
	
	iHorizontal = new CheckBox(MESSAGES.periodPreferenceHorizontal());
	iHorizontal.addValueChangeHandler(new ValueChangeHandler<Boolean>() {
		@Override
		public void onValueChange(ValueChangeEvent<Boolean> event) {
			RoomCookie.getInstance().setHorizontal(iHorizontal.getValue());
			render();
		}
	});
	
	initWidget(iPanel);
}
 
開發者ID:Jenner4S,項目名稱:unitimes,代碼行數:17,代碼來源:PeriodPreferencesWidget.java

示例7: getValue

import com.google.gwt.user.client.ui.CheckBox; //導入依賴的package包/類
@Override
public RequestedCourse getValue() {
	int row = iCourses.getSelectedRow();
	if (iCourses.getSelectedRow() < 0) return null;
	CourseAssignment record = iCourses.getData(row);
	if (record == null) return null;
	RequestedCourse rc = new RequestedCourse();
	rc.setCourseId(record.getCourseId());
	rc.setCourseName(MESSAGES.courseName(record.getSubject(), record.getCourseNbr()));
	if (record.hasTitle() && (!record.hasUniqueName() || iShowCourseTitles))
		rc.setCourseName(MESSAGES.courseNameWithTitle(record.getSubject(), record.getCourseNbr(), record.getTitle()));
	for (Map.Entry<String, CheckBox> e: iInstructionalMethods.entrySet())
		if (e.getValue().isEnabled() && e.getValue().getValue())
			rc.setSelectedIntructionalMethod(e.getKey(), true);
	if (iDetails != null)
		for (CourseFinderCourseDetails d: iDetails)
			d.onGetValue(rc);
	return rc;
}
 
開發者ID:Jenner4S,項目名稱:unitimes,代碼行數:20,代碼來源:CourseFinderCourses.java

示例8: AlertButton

import com.google.gwt.user.client.ui.CheckBox; //導入依賴的package包/類
/**
 * @param title The text that will appear on the button face.
 * @param alertStyle the dependent style suffix that will be appended to the default GWT style when the user is to be alerted.
 */
public AlertButton(String title, String alertStyle) {
    button = new PushButton(title);
    button.addStyleDependentName("SMALLER");
    panel = new HorizontalPanel();
    panel.setBorderWidth(1);
    checkBox = new CheckBox();
    panel.add(button);
    button.setSize("66", "21");
    panel.add(checkBox);
    checkBox.setSize("20", "20");
    ClientFactory cf = GWT.create(ClientFactory.class);
    eventBus = cf.getEventBus();
    this.alertStyle = alertStyle;
    eventBus.addHandler(WidgetSelectionChangeEvent.TYPE, updateNeededEventHandler);
    eventBus.addHandler(VariableSelectionChangeEvent.TYPE, variableChangedEventHandler);
    eventBus.addHandler(UpdateFinishedEvent.TYPE, updateFinishedHandler);
    eventBus.addHandler(MapChangeEvent.TYPE, mapChangeHandler);
    initWidget(panel);
    panel.setSize("90", "23");
    this.ensureDebugId("AlertButton");
}
 
開發者ID:NOAA-PMEL,項目名稱:LAS,代碼行數:26,代碼來源:AlertButton.java

示例9: onResponseReceived

import com.google.gwt.user.client.ui.CheckBox; //導入依賴的package包/類
@Override
public void onResponseReceived(Request request, Response response) {
    String text = response.getText();
    PopupPanel popup = new PopupPanel(true);
    popup.add(new HTML("<strong>Saved edits for:<p></p></strong>"+text+"<p></p>Click outside box to dismiss."));
    popup.setPopupPosition(200, Window.getClientHeight()/3);
    popup.show();
    CellFormatter formatter = datatable.getCellFormatter();
    for (Iterator dirtyIt = dirtyrows.keySet().iterator(); dirtyIt.hasNext();) {
        Integer widgetrow = (Integer) dirtyIt.next();
        for (int i = 0; i < headers.length; i++) {
            formatter.removeStyleName(widgetrow, i, "dirty");
        }
        
        CheckBox box = (CheckBox) datatable.getWidget(widgetrow, 0);
        box.setValue(false);
    }
    dirtyrows.clear();
}
 
開發者ID:NOAA-PMEL,項目名稱:LAS,代碼行數:20,代碼來源:ColumnEditorWidget.java

示例10: FacetPanel

import com.google.gwt.user.client.ui.CheckBox; //導入依賴的package包/類
public FacetPanel(FacetSerializable facet) {
    List<FacetMember> members = facet.getMembers();
    for ( Iterator memberIt = members.iterator(); memberIt.hasNext(); ) {
        FacetMember member = (FacetMember) memberIt.next();
        String name = member.getName();
        int count = member.getCount();
        CheckBox check = new CheckBox(name+" ("+count+")");
        check.setFormValue(facet.getName());
        check.setName(name);
        check.addClickHandler(new ClickHandler() {

            @Override
            public void onClick(ClickEvent click) {
                CheckBox source = (CheckBox) click.getSource();
                eventBus.fireEventFromSource(new FacetChangeEvent(), source);
            }
            
        });
        panel.add(check);
    }
    mainPanel.add(panel);
    initWidget(mainPanel);
}
 
開發者ID:NOAA-PMEL,項目名稱:LAS,代碼行數:24,代碼來源:FacetPanel.java

示例11: getAllSelectedPaths

import com.google.gwt.user.client.ui.CheckBox; //導入依賴的package包/類
/**
 * getAllSelectedPaths
 *
 * @return
 */
public List<String> getAllSelectedPaths() {
	List<String> paths = new ArrayList<String>();
	for (int i = 0; dataTable.getRowCount() > i; i++) {
		CheckBox checkBox = (CheckBox) dataTable.getWidget(i, colMassiveIndex);
		if (checkBox.getValue()) {
			Object obj = data.get(Integer.parseInt(dataTable.getText(i, colDataIndex)));
			if (obj instanceof GWTDocument) {
				paths.add(((GWTDocument) obj).getPath());
			} else if (obj instanceof GWTFolder) {
				paths.add(((GWTFolder) obj).getPath());
			} else if (obj instanceof GWTMail) {
				paths.add(((GWTMail) obj).getPath());
			}
		}
	}
	return paths;
}
 
開發者ID:openkm,項目名稱:document-management-system,代碼行數:23,代碼來源:ExtendedScrollTable.java

示例12: getAllSelectedUUIDs

import com.google.gwt.user.client.ui.CheckBox; //導入依賴的package包/類
/**
 * getAllSelectedUUIDs
 */
public List<String> getAllSelectedUUIDs() {
	List<String> uuidList = new ArrayList<String>();

	for (int i = 0; dataTable.getRowCount() > i; i++) {
		CheckBox checkBox = (CheckBox) dataTable.getWidget(i, colMassiveIndex);

		if (checkBox.getValue()) {
			Object obj = data.get(Integer.parseInt(dataTable.getText(i, colDataIndex)));
			if (obj instanceof GWTDocument) {
				uuidList.add(((GWTDocument) obj).getUuid());
			} else if (obj instanceof GWTFolder) {
				uuidList.add(((GWTFolder) obj).getUuid());
			} else if (obj instanceof GWTMail) {
				uuidList.add(((GWTMail) obj).getUuid());
			}
		}
	}

	return uuidList;
}
 
開發者ID:openkm,項目名稱:document-management-system,代碼行數:24,代碼來源:ExtendedScrollTable.java

示例13: getAllSelectedDocumentsUUIDs

import com.google.gwt.user.client.ui.CheckBox; //導入依賴的package包/類
/**
 * getAllSelectedDocumentsUUIDs
 */
public List<String> getAllSelectedDocumentsUUIDs() {
	List<String> uuidList = new ArrayList<String>();

	for (int i = 0; dataTable.getRowCount() > i; i++) {
		CheckBox checkBox = (CheckBox) dataTable.getWidget(i, colMassiveIndex);

		if (checkBox.getValue()) {
			Object obj = data.get(Integer.parseInt(dataTable.getText(i, colDataIndex)));
			if (obj instanceof GWTDocument) {
				uuidList.add(((GWTDocument) obj).getUuid());
			}
		}
	}

	return uuidList;
}
 
開發者ID:openkm,項目名稱:document-management-system,代碼行數:20,代碼來源:ExtendedScrollTable.java

示例14: getAllSelectedDocumentsPaths

import com.google.gwt.user.client.ui.CheckBox; //導入依賴的package包/類
/**
 * getAllSelectedDocumentsPaths
 */
public List<String> getAllSelectedDocumentsPaths() {
	List<String> pathList = new ArrayList<String>();

	for (int i = 0; dataTable.getRowCount() > i; i++) {
		CheckBox checkBox = (CheckBox) dataTable.getWidget(i, colMassiveIndex);

		if (checkBox.getValue()) {
			Object obj = data.get(Integer.parseInt(dataTable.getText(i, colDataIndex)));
			if (obj instanceof GWTDocument) {
				pathList.add(((GWTDocument) obj).getPath());
			}
		}
	}

	return pathList;
}
 
開發者ID:openkm,項目名稱:document-management-system,代碼行數:20,代碼來源:ExtendedScrollTable.java

示例15: getAllSelectedMailUUIDs

import com.google.gwt.user.client.ui.CheckBox; //導入依賴的package包/類
/**
 * getAllSelectedMailUUIDs
 */
public List<String> getAllSelectedMailUUIDs() {
	List<String> uuidList = new ArrayList<String>();

	for (int i = 0; dataTable.getRowCount() > i; i++) {
		CheckBox checkBox = (CheckBox) dataTable.getWidget(i, colMassiveIndex);

		if (checkBox.getValue()) {
			Object obj = data.get(Integer.parseInt(dataTable.getText(i, colDataIndex)));
			if (obj instanceof GWTMail) {
				uuidList.add(((GWTMail) obj).getUuid());
			}
		}
	}

	return uuidList;
}
 
開發者ID:openkm,項目名稱:document-management-system,代碼行數:20,代碼來源:ExtendedScrollTable.java


注:本文中的com.google.gwt.user.client.ui.CheckBox類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。