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


Java SelectionMode.SINGLE屬性代碼示例

本文整理匯總了Java中javafx.scene.control.SelectionMode.SINGLE屬性的典型用法代碼示例。如果您正苦於以下問題:Java SelectionMode.SINGLE屬性的具體用法?Java SelectionMode.SINGLE怎麽用?Java SelectionMode.SINGLE使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在javafx.scene.control.SelectionMode的用法示例。


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

示例1: assignPgpKeyToOtherUserButtonClicked

@FXML
private void assignPgpKeyToOtherUserButtonClicked(final ActionEvent event) {
	final SelectUserDialog dialog = new SelectUserDialog(getScene().getWindow(),
			new ArrayList<>(getUserRegistry().getUsers()), null, SelectionMode.SINGLE,
			"Please select the user to whom you want to 'push' the selected PGP key(s).");
	dialog.showAndWait();
	final List<User> selectedUsers = dialog.getSelectedUsers();
	if (selectedUsers == null || selectedUsers.isEmpty())
		return;

	final User targetUser = selectedUsers.get(0);
	final Set<PgpKey> selectedPgpKeys = getSelectedPgpKeys();
	for (final PgpKey pgpKey : selectedPgpKeys) {
		user.getPgpKeyIds().remove(pgpKey.getPgpKeyId());
		targetUser.getPgpKeyIds().add(pgpKey.getPgpKeyId());
	}
}
 
開發者ID:subshare,項目名稱:subshare,代碼行數:17,代碼來源:UserPane.java

示例2: select

@Override
public void select(T obj) {
    if (obj == null && getSelectionMode() == SelectionMode.SINGLE) {
        clearSelection();
        return;
    }

    // We have no option but to iterate through the model and select the
    // first occurrence of the given object. Once we find the first one, we
    // don't proceed to select any others.
    Object rowObj = null;
    for (int i = 0, max = getItemCount(); i < max; i++) {
        rowObj = getModelItem(i);
        if (rowObj == null) {
            continue;
        }

        if (rowObj.equals(obj)) {
            if (isSelected(i)) {
                return;
            }

            if (getSelectionMode() == SINGLE) {
                quietClearSelection();
            }

            select(i);
            return;
        }
    }

    // if we are here, we did not find the item in the entire data model.
    // Even still, we allow for this item to be set to the give object.
    // We expect that in concrete subclasses of this class we observe the
    // data model such that we check to see if the given item exists in it,
    // whilst SelectedIndex == -1 && SelectedItem != null.
    setSelectedIndex(-1);
    setSelectedItem(obj);
}
 
開發者ID:ChiralBehaviors,項目名稱:Kramer,代碼行數:39,代碼來源:MultipleCellSelection.java

示例3: addSelectedItem

private void addSelectedItem(T item) {
    if (getItems().contains(item) && !selectedItems.contains(item)) {
        if (getSelectionMode() == SelectionMode.SINGLE) {
            selectedItems.clear();
        }
        selectedItems.add(item);
        if (getSelectedItem() == null || getSelectionMode() == SelectionMode.SINGLE) {
            setSelectedItem(item);
        }
    }
}
 
開發者ID:ClemensFischer,項目名稱:FX-Map-Control,代碼行數:11,代碼來源:MapItemsControl.java

示例4: createContent

@Override
protected Parent createContent() {
	selectUserPane = new SelectUserPane(
			getUsersWithUnlockedPgpKeys(), createRepoData.getOwners(), SelectionMode.SINGLE,
			Messages.getString("SelectOwnerWizardPage.selectUserPane.headerText")) { //$NON-NLS-1$
		@Override
		protected void updateComplete() {
			SelectOwnerWizardPage.this.setComplete(! createRepoData.getOwners().isEmpty());
		}
	};
	return selectUserPane;
}
 
開發者ID:subshare,項目名稱:subshare,代碼行數:12,代碼來源:SelectOwnerWizardPage.java

示例5: SelectUserPane

public SelectUserPane() {
	this(Collections.emptyList(), Collections.emptyList(), SelectionMode.SINGLE, "Bla bla header");
}
 
開發者ID:subshare,項目名稱:subshare,代碼行數:3,代碼來源:SelectUserPane.java


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