Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ruby-on-rails-3/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 我有一个多栏的表格。是否可以使用Jface在每个列条目中创建单选按钮?_Java_Swt_Jface - Fatal编程技术网

Java 我有一个多栏的表格。是否可以使用Jface在每个列条目中创建单选按钮?

Java 我有一个多栏的表格。是否可以使用Jface在每个列条目中创建单选按钮?,java,swt,jface,Java,Swt,Jface,我有一个多栏的表格。是否可以使用JFace在每个列条目中创建单选按钮 我尝试使用TableEditor,我只会在一列中添加一个单选按钮,而不是在所有列中添加。我是JFace的新手,如果您能进一步指导我,我将不胜感激 你不能直接按下单选按钮,你必须使用图像。对列使用ColumnLabelProvider,并使用getImage方法 经历这一切。将帮助您提供本地外观和控制感。您不能直接放置单选按钮,您必须使用图像。对列使用ColumnLabelProvider,并使用getImage方法 经历这一切

我有一个多栏的表格。是否可以使用JFace在每个列条目中创建单选按钮

我尝试使用
TableEditor
,我只会在一列中添加一个单选按钮,而不是在所有列中添加。我是JFace的新手,如果您能进一步指导我,我将不胜感激


你不能直接按下单选按钮,你必须使用图像。对列使用ColumnLabelProvider,并使用getImage方法


经历这一切。将帮助您提供本地外观和控制感。

您不能直接放置单选按钮,您必须使用图像。对列使用ColumnLabelProvider,并使用getImage方法


经历这一切。将帮助您提供本地的外观和控制感。

您应该为表中的每一列/行添加一个单选按钮,第0列除外

for (int i = 0; i < employeeCount; i++)
{
    TableItem item; 
    Button radio; 
    TableEditor editor; 

    item = new TableItem(table, SWT.NO_FOCUS);

    item.setText(0, employees[i]); //Let's assume you have an array of employees' names

    radio = new Button(table, SWT.RADIO);
    //TODO: setup your radiobutton here (text, behavior, etc.)
    editor = new TableEditor(table);
    editor.setEditor(radio, item, 1); //1 is the column index (excellent)
    editor.layout();

    radio = new Button(table, SWT.RADIO);
    //TODO: setup your radiobutton here (text, behavior, etc.)
    editor = new TableEditor(table);
    editor.setEditor(radio, item, 2); //2 is the column index (good)
    editor.layout();

    radio = new Button(table, SWT.RADIO);
    //TODO: setup your radiobutton here (name, text, behavior, etc.)
    editor = new TableEditor(table);
    editor.setEditor(radio, item, 3); //3 is the column index (average)
    editor.layout();

    radio = new Button(table, SWT.RADIO);
    //TODO: setup your radiobutton here (text, behavior, etc.)
    editor = new TableEditor(table);
    editor.setEditor(radio, item, 4); //4 is the column index (poor)
    editor.layout();
}
for(int i=0;i

这应该行。

您应该为表中的每一列/行添加一个单选按钮,第0列除外

for (int i = 0; i < employeeCount; i++)
{
    TableItem item; 
    Button radio; 
    TableEditor editor; 

    item = new TableItem(table, SWT.NO_FOCUS);

    item.setText(0, employees[i]); //Let's assume you have an array of employees' names

    radio = new Button(table, SWT.RADIO);
    //TODO: setup your radiobutton here (text, behavior, etc.)
    editor = new TableEditor(table);
    editor.setEditor(radio, item, 1); //1 is the column index (excellent)
    editor.layout();

    radio = new Button(table, SWT.RADIO);
    //TODO: setup your radiobutton here (text, behavior, etc.)
    editor = new TableEditor(table);
    editor.setEditor(radio, item, 2); //2 is the column index (good)
    editor.layout();

    radio = new Button(table, SWT.RADIO);
    //TODO: setup your radiobutton here (name, text, behavior, etc.)
    editor = new TableEditor(table);
    editor.setEditor(radio, item, 3); //3 is the column index (average)
    editor.layout();

    radio = new Button(table, SWT.RADIO);
    //TODO: setup your radiobutton here (text, behavior, etc.)
    editor = new TableEditor(table);
    editor.setEditor(radio, item, 4); //4 is the column index (poor)
    editor.layout();
}
for(int i=0;i

那应该行。

谢谢你的帮助!谢谢你的帮助!