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


Java TableItem.getData方法代碼示例

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


在下文中一共展示了TableItem.getData方法的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);
}
 
開發者ID:gluonhq,項目名稱:ide-plugins,代碼行數:19,代碼來源:PluginsSWT.java

示例2: 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;
}
 
開發者ID:eclipse,項目名稱:neoscada,代碼行數:17,代碼來源:MonitorsViewTable.java

示例3: selectedEvents

import org.eclipse.swt.widgets.TableItem; //導入方法依賴的package包/類
public List<DecoratedEvent> selectedEvents ()
{
    if ( this.tableViewer.getTable ().getSelectionCount () == 0 )
    {
        return new ArrayList<DecoratedEvent> ();
    }
    final ArrayList<DecoratedEvent> result = new ArrayList<DecoratedEvent> ();
    for ( final TableItem row : this.tableViewer.getTable ().getSelection () )
    {
        if ( row.getData () instanceof DecoratedEvent )
        {
            result.add ( (DecoratedEvent)row.getData () );
        }
    }
    return result;
}
 
開發者ID:eclipse,項目名稱:neoscada,代碼行數:17,代碼來源:EventViewTable.java

示例4: 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);
	}
}
 
開發者ID:AppleCommander,項目名稱:AppleCommander,代碼行數:24,代碼來源:DiskExplorerTab.java

示例5: 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;
}
 
開發者ID:capitalone,項目名稱:Hydrograph,代碼行數:46,代碼來源:FilterHelper.java

示例6: 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;
}
 
開發者ID:capitalone,項目名稱:Hydrograph,代碼行數:34,代碼來源:FilterHelper.java

示例7: modify

import org.eclipse.swt.widgets.TableItem; //導入方法依賴的package包/類
@Override
public void modify ( final Object element, final String property, final Object value )
{
    logger.debug ( "Modify Value: {}:{}:{}", new Object[] { element, property, value } );

    final TableItem tableItem = (TableItem)element;

    if ( tableItem.getData () instanceof AttributeEntry )
    {
        final AttributeEntry entry = (AttributeEntry)tableItem.getData ();
        if ( property.equals ( "value" ) )
        {
            entry.setValue ( value.toString () );
        }
        else if ( property.equals ( "name" ) )
        {
            entry.setName ( value.toString () );
        }
        else if ( property.equals ( "value-type" ) )
        {
            final Integer i = (Integer)value;
            final String valueType = WriteAttributesOperationWizardValuePage.this.valueTypeEditor.getItems ()[i];
            for ( final ValueType vt : ValueType.values () )
            {
                if ( vt.label ().equals ( valueType ) )
                {
                    entry.setValueType ( vt );
                }
            }
        }
        this.viewer.update ( entry, WriteAttributesOperationWizardValuePage.this.PROPERTIES );
        dialogChanged ();
    }
}
 
開發者ID:eclipse,項目名稱:neoscada,代碼行數:35,代碼來源:WriteAttributesOperationWizardValuePage.java

示例8: gatherIgnoredFactories

import org.eclipse.swt.widgets.TableItem; //導入方法依賴的package包/類
protected Set<String> gatherIgnoredFactories ()
{
    final Set<String> result = new HashSet<String> ();
    for ( final TableItem item : this.factoriesViewer.getTable ().getItems () )
    {
        if ( item.getChecked () )
        {
            final String data = (String)item.getData ();
            result.add ( data );
        }
    }
    return result;
}
 
開發者ID:eclipse,項目名稱:neoscada,代碼行數:14,代碼來源:IgnorePage.java

示例9: getStepDetails

import org.eclipse.swt.widgets.TableItem; //導入方法依賴的package包/類
public List<StepDetail> getStepDetails() {
	TableItem[] items = table.getItems();
	List<StepDetail> details = new ArrayList<StepDetail>();
	for (TableItem tableItem : items) {
		StepDetail sd = (StepDetail) tableItem.getData();
		details.add(sd);
	}
	return details;
}
 
開發者ID:gw4e,項目名稱:gw4e.project,代碼行數:10,代碼來源:SummaryExecutionPage.java

示例10: updateModelsAndPathGenerators

import org.eclipse.swt.widgets.TableItem; //導入方法依賴的package包/類
private void updateModelsAndPathGenerators() {
	forceUpdate = true;
	tableViewer.setInput(mainFile);
	TableItem []  all = table.getItems();
	int index=0;
	for (TableItem tableItem : all) {
		ModelData d =  (ModelData) tableItem.getData();
		tableItem.setChecked(additionalExecutionContexts[index++].isSelected());
	}
	for (int i = 0, n = tableViewer.getTable().getColumnCount(); i < n; i++)
		tableViewer.getTable().getColumn(i).pack();
}
 
開發者ID:gw4e,項目名稱:gw4e.project,代碼行數:13,代碼來源:ModelPathGenerator.java

示例11: validate

import org.eclipse.swt.widgets.TableItem; //導入方法依賴的package包/類
public String validate() {
	TableItem[] items = tableViewer.getTable().getItems();
	for (int i = 0; i < items.length; i++) {
		TableItem ti = items[i];
		if (ti.getChecked()) {
			ModelData data = (ModelData) ti.getData();
			return data.validatePolicy();
		}
	}
	return null;
}
 
開發者ID:gw4e,項目名稱:gw4e.project,代碼行數:12,代碼來源:ModelPathGenerator.java

示例12: getModel

import org.eclipse.swt.widgets.TableItem; //導入方法依賴的package包/類
public ModelData[] getModel() {
	List<ModelData> temp = new ArrayList<ModelData>();

	TableItem[] items = tableViewer.getTable().getItems();
	for (int i = 0; i < items.length; i++) {
		TableItem ti = items[i];
		ModelData data = (ModelData) ti.getData();
		temp.add(data);
	}
	ModelData[] ret = new ModelData[temp.size()];
	temp.toArray(ret);
	return ret;
}
 
開發者ID:gw4e,項目名稱:gw4e.project,代碼行數:14,代碼來源:ModelPathGenerator.java

示例13: setProperties

import org.eclipse.swt.widgets.TableItem; //導入方法依賴的package包/類
private void
setProperties(
	ChatParticipant		p )
{
	for ( TableItem ti: buddy_table.getItems()){

		if ( ti.getData() == p ){

			setProperties( ti, p );
		}
	}
}
 
開發者ID:BiglySoftware,項目名稱:BiglyBT,代碼行數:13,代碼來源:BuddyPluginViewBetaChat.java

示例14: getGroupCheckCellProvider

import org.eclipse.swt.widgets.TableItem; //導入方法依賴的package包/類
private CellLabelProvider getGroupCheckCellProvider(final TableViewer tableViewer, final List<Condition> conditionsList, 
		final Button btnAddGrp) {
	return new CellLabelProvider() {
		
		@Override
		public void update(ViewerCell cell) {
			final TableItem item = (TableItem) cell.getItem();
			// DO NOT REMOVE THIS CONDITION. The condition is return to
			// prevent multiple updates on single item
			if (item.getData("UPDATED3") == null) {
				item.setData("UPDATED3", TRUE);
			} else {
				return;
			}
			addCheckButtonInTable(tableViewer, item, GROUP_CHECKBOX, GROUP_CHECKBOX_PANE, GROUP_EDITOR, cell.getColumnIndex(), 
					FilterHelper.INSTANCE.checkButtonListener(tableViewer, conditionsList,btnAddGrp));
			item.addDisposeListener(new DisposeListener() {
				
				@Override
				public void widgetDisposed(DisposeEvent e) {
					Button groupButton = (Button) item.getData(GROUP_CHECKBOX);
					((TableEditor)groupButton.getData(GROUP_EDITOR)).dispose();
					groupButton.dispose();
					
					Composite composite = (Composite)item.getData(GROUP_CHECKBOX_PANE);
					composite.dispose();
				}
			});
		}
	};
}
 
開發者ID:capitalone,項目名稱:Hydrograph,代碼行數:32,代碼來源:FilterConditionsDialog.java

示例15: getRemoveButtonCellProvider

import org.eclipse.swt.widgets.TableItem; //導入方法依賴的package包/類
private CellLabelProvider getRemoveButtonCellProvider(final TableViewer tableViewer, final List<Condition> conditionsList, 
		final Button btnAddGrp, final TreeMap<Integer, List<List<Integer>>> groupSelectionMap, final boolean isRemote) {
	return new CellLabelProvider() {
		
		@Override
		public void update(ViewerCell cell) {
			final TableItem item = (TableItem) cell.getItem();
			// DO NOT REMOVE THIS CONDITION. The condition is return to
			// prevent multiple updates on single item
			if (item.getData("UPDATED2") == null) {
				item.setData("UPDATED2", TRUE);
			} else {
				return;
			}
			if(OSValidator.isMac()){
				addButtonInTable(tableViewer, item, REMOVE, REMOVE_BUTTON_PANE, REMOVE_EDITOR, cell.getColumnIndex(), 
						removeButtonListener(tableViewer, conditionsList, dummyList,groupSelectionMap, btnAddGrp,isRemote), 
						ImagePathConstant.MAC_DELETE_BUTTON);
			}else{
				addButtonInTable(tableViewer, item, REMOVE, REMOVE_BUTTON_PANE, REMOVE_EDITOR, cell.getColumnIndex(), 
						removeButtonListener(tableViewer, conditionsList, dummyList,groupSelectionMap, btnAddGrp,isRemote), 
						ImagePathConstant.DELETE_BUTTON);
			}
			item.addDisposeListener(new DisposeListener() {
				
				@Override
				public void widgetDisposed(DisposeEvent e) {
					Button removeButton = (Button) item.getData(REMOVE);
					((TableEditor)removeButton.getData(REMOVE_EDITOR)).dispose();
					removeButton.dispose();
					
					Composite composite = (Composite)item.getData(REMOVE_BUTTON_PANE);
					composite.dispose();
				}
			});
		}
	};
}
 
開發者ID:capitalone,項目名稱:Hydrograph,代碼行數:39,代碼來源:FilterConditionsDialog.java


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