本文整理汇总了Java中org.eclipse.swt.widgets.TableItem类的典型用法代码示例。如果您正苦于以下问题:Java TableItem类的具体用法?Java TableItem怎么用?Java TableItem使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
TableItem类属于org.eclipse.swt.widgets包,在下文中一共展示了TableItem类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: checkSelection
import org.eclipse.swt.widgets.TableItem; //导入依赖的package包/类
private void checkSelection(final Table table) {
TableItem[] items = table.getSelection();
if (items != null && items.length > 0) {
for (TableItem item: items) {
Plugin plugin = (Plugin) item.getData();
if (plugin != null) {
if (source.stream().anyMatch(p -> p.equals(plugin))) {
btnSelect.setEnabled(true);
} else if (target.stream().anyMatch(p -> p.equals(plugin))) {
btnDeselect.setEnabled(true);
}
return;
}
}
}
btnSelect.setEnabled(false);
btnDeselect.setEnabled(false);
}
示例2: getConditionalOperatorModifyListener
import org.eclipse.swt.widgets.TableItem; //导入依赖的package包/类
/**
* Gets the conditional operator modify listener.
*
* @param conditionsList
* the conditions list
* @param fieldsAndTypes
* the fields and types
* @param fieldNames
* the field names
* @param saveButton
* the save button
* @param displayButton
* the display button
* @return the conditional operator modify listener
*/
public ModifyListener getConditionalOperatorModifyListener(final List<Condition> conditionsList,
final Map<String, String> fieldsAndTypes, final String[] fieldNames, final Button saveButton, final Button displayButton) {
ModifyListener listener = new ModifyListener() {
@Override
public void modifyText(ModifyEvent e) {
CCombo source = (CCombo) e.getSource();
TableItem tableItem = getTableItem(source);
Condition condition = (Condition) tableItem.getData();
if (tableItem.getData(FilterConstants.VALUE2TEXTBOX) != null) {
Text text = (Text) tableItem.getData(FilterConstants.VALUE2TEXTBOX);
enableAndDisableValue2TextBox(condition.getConditionalOperator(), text);
}
processConditionalOperator(source, conditionsList, fieldsAndTypes, fieldNames, saveButton, displayButton);
}
};
return listener;
}
示例3: getZnodeAclFromTable
import org.eclipse.swt.widgets.TableItem; //导入依赖的package包/类
public List<ACL> getZnodeAclFromTable() {
Table table = getTable();
TableItem[] items = table.getItems();
Set<ACL> aclSet = new HashSet<ACL>(items.length);
for (TableItem item : items) {
int perms = getItemPerms(item);
Id id = getItemId(item);
ACL acl = new ACL(perms, id);
aclSet.add(acl);
}
return new ArrayList<ACL>(aclSet);
}
示例4: tableSelectionChanged
import org.eclipse.swt.widgets.TableItem; //导入依赖的package包/类
private void tableSelectionChanged(TableItem item) {
Button setIdButton = getSetIdButton();
setIdButton.setEnabled(SCHEME_DIGEST.equals(item.getText(TABLE_COLUMN_SCHEME)));
Button removeButton = getRemoveButton();
removeButton.setEnabled(item != null);
initSchemeTableEditor(item);
initIdTableEditor(item);
Control idEditor = _IdTableEditor.getEditor();
if (idEditor != null && !idEditor.isDisposed()) {
idEditor.setFocus();
}
}
示例5: getItemPerms
import org.eclipse.swt.widgets.TableItem; //导入依赖的package包/类
private int getItemPerms(TableItem item) {
int perms = 0;
Button allCheckBox = getItemPermCheckBox(item, ZooDefs.Perms.ALL);
if (allCheckBox.getSelection()) {
perms = ZooDefs.Perms.ALL;
}
else {
for (int perm : PERMS) {
Button permCheckBox = getItemPermCheckBox(item, perm);
if (permCheckBox.getSelection()) {
perms |= perm;
}
}
}
return perms;
}
示例6: initPropertiesSectionFromModel
import org.eclipse.swt.widgets.TableItem; //导入依赖的package包/类
/**
* TODO: Comment.
*
*/
protected void initPropertiesSectionFromModel() {
Table table = getPropertiesSectionTable();
table.removeAll();
Map<String, String> properties = getZooKeeperConnectionProperties();
for (String key : properties.keySet()) {
TableItem item = new TableItem(table, SWT.NONE);
String value = properties.get(key);
item.setText(0, key);
item.setText(1, value);
}
packTable(table, PROPERTIES_COLUMN_WIDTHS);
}
示例7: initDescriptorSectionFromModel
import org.eclipse.swt.widgets.TableItem; //导入依赖的package包/类
protected void initDescriptorSectionFromModel() {
Descriptor descriptor = getJmxDescriptor();
if (descriptor == null) {
return;
}
Table table = getDescriptorTable();
if (table == null) {
return;
}
table.removeAll();
for (String fieldName : descriptor.getFieldNames()) {
TableItem item = new TableItem(table, SWT.NONE);
Object value = descriptor.getFieldValue(fieldName);
item.setText(0, fieldName);
item.setText(1, String.valueOf(value));
}
packTable(table, DEFAULT_NAME_VALUE_COLUMN_WIDTHS);
}
示例8: initPrimarySectionFromModel
import org.eclipse.swt.widgets.TableItem; //导入依赖的package包/类
@Override
protected void initPrimarySectionFromModel() {
Table table = getPrimaryTable();
table.removeAll();
MBeanAttributeModel model = getModel();
MBeanAttribute attribute = model.getData();
String valueString = attribute.getValueAsString();
String valueError = attribute.getValueRetrievalErrorMessage();
TableItem item = new TableItem(table, SWT.NONE);
item.setText(0, attribute.getName());
if (valueError != null) {
item.setText(1, valueError);
item.setForeground(1, table.getDisplay().getSystemColor(SWT.COLOR_RED));
}
else {
item.setText(1, valueString);
}
packTable(table, DEFAULT_NAME_VALUE_COLUMN_WIDTHS);
}
示例9: initInfoSectionFromModel
import org.eclipse.swt.widgets.TableItem; //导入依赖的package包/类
@Override
protected void initInfoSectionFromModel() {
Table table = getInfoTable();
table.removeAll();
MBeanFeatureInfo featureInfo = getFeatureInfo();
TableItem nameItem = new TableItem(table, SWT.NONE);
nameItem.setText(0, FEATURE_INFO_PROPERTY_NAME_NAME);
nameItem.setText(1, featureInfo.getName());
TableItem descriptionItem = new TableItem(table, SWT.NONE);
descriptionItem.setText(0, FEATURE_INFO_PROPERTY_NAME_DESCRIPTION);
descriptionItem.setText(1, featureInfo.getDescription());
}
示例10: setVisible
import org.eclipse.swt.widgets.TableItem; //导入依赖的package包/类
@Override
public void setVisible ( final boolean visible )
{
super.setVisible ( visible );
if ( visible )
{
final Object[] data = this.mergeController.makeKnownFactories ().toArray ();
this.factoriesViewer.setInput ( data );
final Set<String> factories = this.mergeController.getIgnoreFactories ();
// select all
for ( final TableItem item : this.factoriesViewer.getTable ().getItems () )
{
item.setChecked ( factories.contains ( item.getData () ) );
}
// set ignore fields
this.fieldsViewer.setInput ( this.mergeController.getIgnoreFields () );
}
}
示例11: getFieldNameModifyListener
import org.eclipse.swt.widgets.TableItem; //导入依赖的package包/类
/**
* Gets the field name modify listener.
*
* @param tableViewer
* the table viewer
* @param conditionsList
* the conditions list
* @param fieldsAndTypes
* the fields and types
* @param fieldNames
* the field names
* @param saveButton
* the save button
* @param displayButton
* the display button
* @return the field name modify listener
*/
public ModifyListener getFieldNameModifyListener(final TableViewer tableViewer, final List<Condition> conditionsList,
final Map<String, String> fieldsAndTypes, final String[] fieldNames, final Button saveButton, final Button displayButton) {
ModifyListener listener = new ModifyListener() {
@Override
public void modifyText(ModifyEvent e) {
CCombo source = (CCombo) e.getSource();
int index = (int) source.getData(FilterConstants.ROW_INDEX);
Condition filterConditions = conditionsList.get(index);
String fieldName = source.getText();
filterConditions.setFieldName(fieldName);
if(StringUtils.isNotBlank(fieldName)){
String fieldType = fieldsAndTypes.get(fieldName);
TableItem item = tableViewer.getTable().getItem(index);
CCombo conditionalCombo = (CCombo) item.getData(FilterConditionsDialog.CONDITIONAL_OPERATORS);
if(conditionalCombo != null && StringUtils.isNotBlank(fieldType)){
conditionalCombo.setText(filterConditions.getConditionalOperator());
conditionalCombo.setItems(FilterHelper.INSTANCE.getTypeBasedOperatorMap().get(fieldType));
new AutoCompleteField(conditionalCombo, new CComboContentAdapter(), conditionalCombo.getItems());
}
}
validateCombo(source);
toggleSaveDisplayButton(conditionsList, fieldsAndTypes, fieldNames, saveButton, displayButton);
}
};
return listener;
}
示例12: selectedMonitors
import org.eclipse.swt.widgets.TableItem; //导入依赖的package包/类
public List<DecoratedMonitor> selectedMonitors ()
{
if ( this.tableRef.get ().getTable ().getSelectionCount () == 0 )
{
return new ArrayList<DecoratedMonitor> ();
}
final List<DecoratedMonitor> result = new ArrayList<DecoratedMonitor> ();
for ( final TableItem row : this.tableRef.get ().getTable ().getSelection () )
{
if ( row.getData () instanceof DecoratedMonitor )
{
result.add ( (DecoratedMonitor)row.getData () );
}
}
return result;
}
示例13: deleteFile
import org.eclipse.swt.widgets.TableItem; //导入依赖的package包/类
/**
* Delete the currently selected files.
*/
protected void deleteFile() {
TableItem[] selection = fileTable.getSelection();
String message = (selection.length > 1) ?
textBundle.get("DeletePromptMultipleFiles") : //$NON-NLS-1$
textBundle.get("DeletePromptSingleFile") //$NON-NLS-1$
+ textBundle.get("DeletePromptTrailer"); //$NON-NLS-1$
int answer = SwtUtil.showYesNoDialog(shell,
textBundle.get("DeletePromptTitle"), //$NON-NLS-1$
message);
if (answer == SWT.YES) {
for (int i=0; i<selection.length; i++) {
TableItem tableItem = selection[i];
FileEntry fileEntry = (FileEntry) tableItem.getData();
fileEntry.delete();
}
fillFileTable(currentFileList);
saveToolItem.setEnabled(true);
}
}
示例14: refreshTable
import org.eclipse.swt.widgets.TableItem; //导入依赖的package包/类
/**
* Refresh the table of information.
*/
protected void refreshTable() {
fileTable.removeAll();
Iterator specs = wizard.getImportSpecifications().iterator();
boolean canFinish = specs.hasNext();
while (specs.hasNext()) {
ImportSpecification spec = (ImportSpecification) specs.next();
File file = new File(spec.getSourceFilename());
TableItem item = new TableItem(fileTable, SWT.NULL);
item.setText(new String[] {
file.getName(),
spec.getTargetFilename(),
spec.getFiletype() });
item.setData(spec);
canFinish &= spec.hasFiletype();
}
fileTable.redraw();
wizard.enableFinishButton(canFinish);
}
示例15: createConvertor
import org.eclipse.swt.widgets.TableItem; //导入依赖的package包/类
/**
* @param context
* @return
* @throws CoreException
*/
public OffLinePostConversionImpl createConvertor(ResourceContext context) throws CoreException {
List<BuildPolicy> selected = new ArrayList<BuildPolicy>();
TableItem[] items = buildPoliciesViewer.getTable().getItems();
for (TableItem tableItem : items) {
if (tableItem.getChecked()) {
selected.add((BuildPolicy) tableItem.getData());
}
}
BuildPolicy[] policies = new BuildPolicy[selected.size()];
selected.toArray(policies);
ResourceContext ctx = new ResourceContext(
context.getContainerFullPath(),
gcc.getRoot(),
gcc.getPackageFragment(),
gcc.getClassName(),
gcc.getExtendedClassName(),
context.getSelectedFile(),
gcc.getMode(),
context.getClassExtension());
return new OffLinePostConversionImpl(ctx, policies, Integer.parseInt(timeoutText.getText()));
}