本文整理匯總了Java中org.eclipse.jface.viewers.CellEditor類的典型用法代碼示例。如果您正苦於以下問題:Java CellEditor類的具體用法?Java CellEditor怎麽用?Java CellEditor使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
CellEditor類屬於org.eclipse.jface.viewers包,在下文中一共展示了CellEditor類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: createTableViewer
import org.eclipse.jface.viewers.CellEditor; //導入依賴的package包/類
private void createTableViewer() {
ArrayEditor arrayEditor = ((ArrayEditor) cellEditor);
tableViewer = new TableViewer(table);
tableViewer.setUseHashlookup(true);
tableViewer.setColumnProperties(arrayEditor.columnNames);
// Assign the cell editors to the viewer
CellEditor[] editors = arrayEditor.getColumnEditors(table);
tableViewer.setCellEditors(editors);
// Set the cell modifier for the viewer
tableViewer.setCellModifier(new ArrayEditorCellModifier(this, tableViewer));
// Set the label provider for the viewer
tableViewer.setLabelProvider(new ArrayEditorLabelProvider(cellEditor.getStyle()));
// Set the content provider
tableViewer.setContentProvider(new ArrayEditorContentProvider());
}
示例2: okPressed
import org.eclipse.jface.viewers.CellEditor; //導入依賴的package包/類
@Override
protected void okPressed() {
if(OSValidator.isMac()){
for(CellEditor cellEditor : nameValueTableViewer.getCellEditors())
{
if(cellEditor !=null){
cellEditor.getControl().setEnabled(false); //Saves the existing value of CellEditor
cellEditor.getControl().setEnabled(false);
}
}
}
if(checkNameValueFieldBlankOrNot()){
operationClassProperty = new OperationClassProperty(operationClasses.getText(), fileName.getText(),
isParameterCheckBox.getSelection(), (String) fileName.getData(PATH),this.operationClassProperty.getNameValuePropertyList(),null,componentName);
okPressed=true;
super.okPressed();
}
}
示例3: createPropertyEditor
import org.eclipse.jface.viewers.CellEditor; //導入依賴的package包/類
@Override
public CellEditor createPropertyEditor(Composite parent) {
if (dataOrNullCellEditorClass != null) {
try {
Constructor<?> constructor = dataOrNullCellEditorClass.getConstructor(new Class[] { Composite.class, int.class });
editor = (CellEditor)constructor.newInstance(new Object[] { parent, style });
} catch (Exception e) {
ConvertigoPlugin.logException(e, "Unexpected exception");
}
if (editor != null) {
((INullEditor)editor).setNullProperty(isNull);
if (getValidator() != null) {
editor.setValidator(getValidator());
}
}
}
return editor;
}
示例4: getValue
import org.eclipse.jface.viewers.CellEditor; //導入依賴的package包/類
public Object getValue(Object element, String property) {
int columnIndex = Arrays.asList(tableViewer.getColumnProperties()).indexOf(property);
CellEditor[] cellEditors = tableViewer.getCellEditors();
CellEditor cellEditor = cellEditors[columnIndex];
boolean isComboBoxEditor = cellEditor instanceof ComboBoxCellEditor;
if (element instanceof Item) {
element = ((Item) element).getData();
}
ArrayEditorRow row = (ArrayEditorRow) element;
Object object = row.getValue(columnIndex);
if (isComboBoxEditor) {
int index = Arrays.asList(((ComboBoxCellEditor)cellEditor).getItems()).indexOf(object.toString());
object = new Integer(index);
}
return object;
}
示例5: createTableViewer
import org.eclipse.jface.viewers.CellEditor; //導入依賴的package包/類
private void createTableViewer() {
TableEditor tableEditor = ((TableEditor) cellEditor);
tableViewer = new TableViewer(table);
tableViewer.setUseHashlookup(true);
tableViewer.setColumnProperties(tableEditor.columnNames);
// Assign the cell editors to the viewer
CellEditor[] editors = tableEditor.getColumnEditors(table);
tableViewer.setCellEditors(editors);
// Set the cell modifier for the viewer
tableViewer.setCellModifier(new TableEditorCellModifier(this, tableViewer));
// Set the label provider for the viewer
tableViewer.setLabelProvider(new TableEditorLabelProvider());
// Set the content provider
tableViewer.setContentProvider(new TableEditorContentProvider());
}
示例6: getValue
import org.eclipse.jface.viewers.CellEditor; //導入依賴的package包/類
public Object getValue(Object element, String property) {
int columnIndex = Arrays.asList(tableViewer.getColumnProperties()).indexOf(property);
CellEditor[] cellEditors = tableViewer.getCellEditors();
CellEditor cellEditor = cellEditors[columnIndex];
boolean isComboBoxEditor = cellEditor instanceof ComboBoxCellEditor;
boolean isTextCellEditor = cellEditor instanceof TextCellEditor;
if (element instanceof Item) {
element = ((Item) element).getData();
}
TableEditorRow row = (TableEditorRow) element;
Object object = row.getValue(columnIndex);
if (isComboBoxEditor) {
int index = Arrays.asList(((ComboBoxCellEditor)cellEditor).getItems()).indexOf(object.toString());
object = new Integer(index);
}
if (isTextCellEditor && (!(object instanceof String))) {
object = object.toString();
}
return object;
}
示例7: createCellEditorList
import org.eclipse.jface.viewers.CellEditor; //導入依賴的package包/類
@Override
public CellEditor[] createCellEditorList(Table table,
Map<String, Integer> columns) {
CellEditor[] cellEditor = createCellEditor(columns.size());
addTextEditor(table, cellEditor, columns, (Messages.FIELDNAME));
addComboBox(table, cellEditor, getDataTypeKey(), 1);
addTextEditor(table, cellEditor, columns, Messages.DATEFORMAT);
addTextEditor(table, cellEditor, columns, Messages.PRECISION);
addTextEditor(table, cellEditor, columns, Messages.SCALE);
addComboBox(table, cellEditor, getScaleTypeKey(), 5);
addTextEditor(table, cellEditor, columns, Messages.FIELD_DESCRIPTION);
addTextEditor(table, cellEditor, columns, Messages.LENGTH);
addTextEditor(table, cellEditor, columns, Messages.RANGE_FROM);
addTextEditor(table, cellEditor, columns, Messages.RANGE_TO);
addTextEditor(table, cellEditor, columns, Messages.DEFAULT_VALUE);
return cellEditor;
}
示例8: getColumnEditor
import org.eclipse.jface.viewers.CellEditor; //導入依賴的package包/類
static public CellEditor[] getColumnEditor(Composite parent) {
CellEditor[] columnEditors = new CellEditor[9];
columnEditors[0] = new TextCellEditor(parent);
columnEditors[1] = new TextCellEditor(parent);
columnEditors[2] = new TextCellEditor(parent);
columnEditors[3] = new ComboBoxCellEditor(parent, new String[]{"true","false"});
columnEditors[4] = new ComboBoxCellEditor(parent, new String[]{"true","false"});
columnEditors[5] = new ComboBoxCellEditor(parent, new String[]{"true","false"});
columnEditors[6] = new ComboBoxCellEditor(parent, new String[]{"true","false"});
columnEditors[7] = new ComboBoxCellEditor(parent, new String[]{"","GET","POST"});
columnEditors[8] = new TextCellEditor(parent);
return columnEditors;
}
示例9: getCellEditor
import org.eclipse.jface.viewers.CellEditor; //導入依賴的package包/類
@Override
protected CellEditor getCellEditor(Object element) {
try {
if (element instanceof ControlNode) {
return factory.getDeviceEditor(DeviceType.SCANNABLE, (Composite)getViewer().getControl());
}
} catch (Exception ne) {
logger.error("Cannot get a proper scannable editor!", ne);
}
return new TextCellEditor((Composite)getViewer().getControl()) {
@Override
protected void doSetValue(Object value) {
if (value instanceof INamedNode) value = ((INamedNode)value).getDisplayName();
String string = value!=null ? value.toString() : "";
super.doSetValue(string);
}
};
}
示例10: okPressed
import org.eclipse.jface.viewers.CellEditor; //導入依賴的package包/類
@Override
protected void okPressed() {
if(OSValidator.isMac()){
for(CellEditor cellEditor : nameValueTableViewer.getCellEditors()){
if(cellEditor !=null){
cellEditor.getControl().setEnabled(false); //Saves the existing value of CellEditor
cellEditor.getControl().setEnabled(true);
}
}
}
if(checkNameValueFieldBlankOrNot())
{
mappingSheetRow = new MappingSheetRow(mappingSheetRow.getInputFields(), mappingSheetRow.getOutputList(),
mappingSheetRow.getOperationID(), operationClasses.getText(), fileName.getText(),
mappingSheetRow.getNameValueProperty(), isParameterCheckBox.getSelection(),
mappingSheetRow.getWholeOperationParameterValue(),
mappingSheetRow.isWholeOperationParameter(),
(String)fileName.getData(PATH),mappingSheetRow.isExpression(),null,null,mappingSheetRow.isActive());
isOkPressed=true;
super.okPressed();
}
}
示例11: getNumberEditor
import org.eclipse.jface.viewers.CellEditor; //導入依賴的package包/類
private CellEditor getNumberEditor(FieldValue field, final Class<? extends Object> clazz, Composite parent) {
FieldDescriptor anot = field.getAnnotation();
NumberCellEditor textEd = null;
if (anot!=null) {
textEd = new NumberCellEditor(parent, clazz, getMinimum(field, anot), getMaximum(field, anot), getUnit(field, anot), SWT.NONE);
if (anot.numberFormat()!=null && !"".equals(anot.numberFormat())) {
textEd.setDecimalFormat(anot.numberFormat());
}
} else {
textEd = new NumberCellEditor(parent, clazz, SWT.NONE);
}
//textEd.setAllowInvalidValues(true);
if (anot!=null && anot.validif().length()>0) {
final ValidIfDecorator deco = new ValidIfDecorator(field.getName(), field.getModel(), anot.validif());
textEd.setDelegateDecorator(deco);
}
return textEd;
}
示例12: okPressed
import org.eclipse.jface.viewers.CellEditor; //導入依賴的package包/類
@Override
protected void okPressed() {
if(OSValidator.isMac()){
List<TableViewer> tableViewer = new ArrayList<TableViewer>();
tableViewer.add(mappingTableViewer);
tableViewer.add(outputFieldViewer);
tableViewer.add(operationalInputFieldTableViewer);
tableViewer.add(operationalOutputFieldTableViewer);
for(TableViewer tableView : tableViewer){
if(tableView !=null){
for(CellEditor cellEditor : tableView.getCellEditors()){
if(cellEditor !=null){
cellEditor.getControl().setEnabled(false); //Saves the existing value of CellEditor
cellEditor.getControl().setEnabled(true);
}
}
}
}
}
okPressed = true;
super.okPressed();
}
示例13: getCellEditor
import org.eclipse.jface.viewers.CellEditor; //導入依賴的package包/類
@Override
protected CellEditor getCellEditor(Object element) {
try {
util.setContainerName(containerName);
util.setFileName("");
types = util.getAllTypes();
String[] opts = new String[types.size()];
int i = 0;
for (String type : types) {
opts[i] = type;
i++;
}
return new ComboBoxCellEditor(viewer.getTable(), opts);
} catch (IOException | JAXBException e) {
return new TextCellEditor(viewer.getTable());
}
}
示例14: okPressed
import org.eclipse.jface.viewers.CellEditor; //導入依賴的package包/類
@Override
protected void okPressed() {
if(OSValidator.isMac()){
for(CellEditor cellEditor : targetTableViewer.getCellEditors()){
if(cellEditor !=null){
cellEditor.getControl().setEnabled(false); //Saves the existing value of CellEditor
cellEditor.getControl().setEnabled(true);
}
}
}
if (validate()) {
fieldNameList.clear();
for (FilterProperties temp : propertyList) {
fieldNameList.add(temp.getPropertyname());
}
if (isAnyUpdatePerformed) {
propertyDialogButtonBar.enableApplyButton(true);
}
if(!HiveFieldDialogHelper.INSTANCE.compareAndChangeColor(getTargetTableViewer(),sourceFieldsList)){
int rc=HiveFieldDialogHelper.INSTANCE.Message_Dialog();
if(rc==0){
super.okPressed();
}
else if(rc==1){
return;
}
}
okPressed=true;
super.okPressed();
} else {
return;
}
}
示例15: createPropertyEditor
import org.eclipse.jface.viewers.CellEditor; //導入依賴的package包/類
@Override
public CellEditor createPropertyEditor ( final Composite composite )
{
if ( this.itemPropertyDescriptor instanceof IItemPropertyDescriptor2 )
{
final CellEditor editor = ( (IItemPropertyDescriptor2)this.itemPropertyDescriptor ).createPropertyEditor ( composite, this.object );
if ( editor != null )
{
return editor;
}
}
return super.createPropertyEditor ( composite );
}