当前位置: 首页>>代码示例>>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;未经允许,请勿转载。