我知道JList并且JComboBox.我需要具有多种选择功能的组合框下拉功能JList.
这是因为列表的内容太大而无法使用简单列表显示.我还需要选择多个项目,否则我会满意JComboBox.
有什么建议?
我有一个CellTable,它有4列:
| Column 1 | Column 2 | Column 3 | Column 4 |
Run Code Online (Sandbox Code Playgroud)
目标:
用户可以在按住鼠标按钮并将鼠标悬停在列上时选择多个列.
例如,用户单击第1列并按住鼠标按钮,在第2列和第3列上移动,从而选择第2列和第3列.
我试过了:
final MultiSelectionModel<data> selectionModel = new MultiSelectionModel<BestellungData>();
cellTable.setSelectionModel(selectionModel);
cellTable.addCellPreviewHandler(new Handler<data>()
{
@Override
public void onCellPreview(
CellPreviewEvent<data> event) {
// TODO Auto-generated method stub
if ("click".equals(event.getNativeEvent().getType())) {
selectionModel.setSelected(event.getValue(), true);
}
}
});
Run Code Online (Sandbox Code Playgroud)
但它不起作用.
我有一个包含文件名的ListBox.现在我需要从这个ListBox获取所选项目的数组.我在这里找到了一些答案,但它们都没有为我工作.我正在使用Caliburn Micro框架.
这是我的观点:
<Window x:Class="ProgramsAndUpdatesDesktop.Views.DeleteHistoryView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:ProgramsAndUpdatesDesktop.Views"
mc:Ignorable="d"
ResizeMode="CanResizeWithGrip"
MaxWidth="300"
MinWidth="300"
MinHeight="500"
Title="DeleteHistoryView" Height="500" Width="300">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="*" />
<RowDefinition Height="30" />
</Grid.RowDefinitions>
<StackPanel Grid.Column="0" Grid.Row="0">
<ListBox x:Name="DeleteHistoryListBox" SelectedItem="{Binding Path=DeleteHistorySelectedItem}"
ItemsSource="{Binding DeleteHistoryListBox, NotifyOnSourceUpdated=True}"
SelectionMode="Multiple">
</ListBox>
</StackPanel>
<StackPanel Grid.Column="0" Grid.Row="1">
<Button x:Name="DeleteHistoryButtonAction">Delete</Button>
</StackPanel>
</Grid>
Run Code Online (Sandbox Code Playgroud)
这是我的ViewModel:
class DeleteHistoryViewModel : Screen
{
string historyFolderPath = Environment.ExpandEnvironmentVariables(ConfigurationManager.AppSettings["HistoryFolderPath"]);
private ObservableCollection<string> deleteHistoryListBox = new ObservableCollection<string>();
public ObservableCollection<string> DeleteHistoryListBox
{
get { return deleteHistoryListBox; }
set { deleteHistoryListBox …Run Code Online (Sandbox Code Playgroud) 我目前正在尝试recyclerview-selection从Android支持库28.0.0-alpha1 实现新的API,并且遇到了一些问题.我的目标是拥有一个RecyclerView能够选择多行,显示上下文操作栏并对其执行操作的功能,例如"删除"或"共享"
我会尝试提供足够的代码来充分了解正在发生的事情,但如果有必要,我总能回复更多.
在我Fragment包含RecyclerView我关注的内容中,我正在启动一个SelectionTracker,并将其设置在我的上面RecyclerView.Adapter,就像这样:
private void buildRecyclerView() {
sheetsAdapter = new SheetsAdapter(getContext(), this, sheets);
gridManager = new GridLayoutManager(getContext(), getResources().getInteger(R.integer.grid_span_count));
ItemOffsetDecoration itemDecoration = new ItemOffsetDecoration(getContext(), R.dimen.item_offset);
sheetsRecycler.addItemDecoration(itemDecoration);
sheetsRecycler.setLayoutManager(gridManager);
sheetsRecycler.setAdapter(sheetsAdapter);
sheetsRecycler.setHasFixedSize(true);
SelectionTracker selectionTracker = new SelectionTracker.Builder<>("sheet_selection",
sheetsRecycler,
new StableIdKeyProvider(sheetsRecycler),
new SheetDetailsLookup(sheetsRecycler),
StorageStrategy.createLongStorage())
.withOnContextClickListener(this)
.build();
sheetsAdapter.setSelectionTracker(selectionTracker);
}
Run Code Online (Sandbox Code Playgroud)
这Fragment也是implements OnContextClickListener为了收听我在我的项目中的长按RecyclerView:
@Override
public boolean onContextClick(@NonNull MotionEvent e) {
if (actionMode != null) {
return false;
}
// …Run Code Online (Sandbox Code Playgroud) android multipleselection android-actionmode android-recyclerview
我在我的程序中使用Windows窗体TreeView控件.我想允许用户通过拖动鼠标指针来选择同一级别的多个节点(也称为"套索"选择).我不认为标准的TreeView允许这样做.
我的问题是实现这一目标的最佳方法是什么?我是否必须在自定义或派生控件中编写自己的自定义选择行为?我从哪里开始?
我不需要详细解释.只是在正确的方向上轻微推动.
有没有人知道如何制作具有这样多个选择的NSPopUpButton。

我经常复制多行代码,然后将它们粘贴到多个选择中,希望每个选择都有该代码块,但代码块却被分割成多个选择,因为行/选择的数量匹配。如果行/选择的数量匹配,这是默认行为,这很有用,但在像这样的情况下则不然。
我的第一直觉是看看是否有一个快捷方式可以取消该行为,因为我正在粘贴,就像“paste_and_indent”的快捷方式是“super+shift+v”一样。但我没有找到。
每次遇到此问题时,我都会取消选择其中一项并粘贴,然后仅选择我取消选择并粘贴的一项。
如果有人知道更好的方法,请分享。
keyboard-shortcuts copy-paste multiline multipleselection sublimetext2
我有一个 Materialize Multiple Select 元素。但我似乎找不到检索所选值的方法。有人知道如何检索选定的值吗?
但问题是如何在关闭时检索选择器内的值。
编辑:我正在使用 Materialize CSS ( http://materializecss.com )
我在使用iOS 5新功能在编辑模式下选择多个单元格时遇到问题.应用程序结构如下:
-> UIViewController
---> UITableView
----> CustomUITableViewCell
Run Code Online (Sandbox Code Playgroud)
其中UIViewController是委托和数据源UITableView(我使用UIViewController而不是UITableViewController出于需求原因,我无法更改).将单元格加载到UITableView以下代码中.
- (UITableViewCell *)tableView:(UITableView *)tv cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
CustomTableViewCell *cell = (CustomTableViewCell*)[tv dequeueReusableCellWithIdentifier:kCellTableIdentifier];
if (cell == nil)
{
[[NSBundle mainBundle] loadNibNamed:@"CustomTableViewCellXib" owner:self options:nil];
cell = self.customTableViewCellOutlet;
cell.selectionStyle = UITableViewCellSelectionStyleNone;
}
// configure the cell with data
[self configureCell:cell atIndexPath:indexPath];
return cell;
}
Run Code Online (Sandbox Code Playgroud)
已从xib文件创建单元接口.特别是,我创建了一个新的xib文件,其中superview由一个UITableViewCell元素组成.为了提供自定义,我将该元素的类型设置为CustomUITableViewCell,其中CustomUITableViewCellextends UITableViewCell.
@interface CustomTableViewCell : UITableViewCell
// do stuff here
@end …Run Code Online (Sandbox Code Playgroud) 我正在为我们的网站编写一个自定义小部件来显示一些选定的帖子.在管理部分,我有一个多选框让管理员按名称选择多个帖子.这工作正常,但是当我选择几个不同的帖子并保存时,没有任何东西被保存.
任何人都可以对此有所了解吗?
这是我的代码......
<?php
/*
Plugin Name: Hot Topics
Plugin URI: http://www.weddingideasmag.com
Description: Use this widget to choose an array of posts snippets to show
Version: 1.0)
Author: James Payne
Author URI: http://www.bluntcreative.co.uk
License: GPL2
*/
class HotTopics extends WP_Widget {
// constructor
function HotTopics() {
$widget_ops = array( 'name' => 'Hot Topics','classname' => 'widget-hot-topics', 'description' => __( "Use this widget to choose an array of posts snippets to show in the sidebar." ) );
$this->WP_Widget( 'hottopics', __('Hot Topics'), $widget_ops); …Run Code Online (Sandbox Code Playgroud)