Bug 324602

Summary: [Preferences] [FieldEditors] TableFieldEditor as a new type of FieldEditor
Product: [Eclipse Project] Platform Reporter: Sandip Chitale <sandipchitale>
Component: UIAssignee: Platform UI Triaged <platform-ui-triaged>
Status: NEW --- QA Contact:
Severity: enhancement    
Priority: P3 CC: eclipse.felipe, remy.suen
Version: 4.0   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:
Attachments:
Description Flags
patch for TableFieldEditor
none
TableFieldEditor example usage. none

Description Sandip Chitale CLA 2010-09-06 18:25:23 EDT
Build Identifier: I20100608-0911

There is a ListEditor to support preferences to support editing of list of preference values. There is a need for a table based field editor for list of records with multiples fields in each record.

A patch for a TableFieldEditor is attached.

Sample usage:

	@Override
	protected void createFieldEditors() {
		TableFieldEditor folderCommandsTableEditor = new CommandTableEditor(
				"foldersKey", "Folder", getFieldEditorParent());
		addField(folderCommandsTableEditor);
	}
	
	private static class CommandTableEditor extends TableFieldEditor {
		CommandTableEditor(String key, String item, Composite parent) {
			super(key, "Custom " + item + " commands:",
					new String[] {"Name", "Pattern", "Command"},
					new int[] {150, 100, 300},
					parent);
		}
		
		@Override
		protected String createList(String[][] items) {
			// code to join records and fields into a string goes here
			return ""; 
		}

		@Override
		protected String[][] parseString(String stringList) {
			// code to split a persisted string value of the preference into records and fields
			return new String[0][0];
		}

		@Override
		protected String[] getNewInputObject() {
			return new String[] {"", "*", ""};
		}
		
	}



Reproducible: Always

Steps to Reproduce:
N/A
Comment 1 Sandip Chitale CLA 2010-09-06 18:26:33 EDT
Created attachment 178282 [details]
patch for TableFieldEditor
Comment 2 Sandip Chitale CLA 2010-09-06 18:27:56 EDT
Created attachment 178283 [details]
TableFieldEditor example usage.
Comment 3 Sandip Chitale CLA 2010-09-06 18:30:15 EDT
I originally developed the TableFieldEditor for use in the Path Tools plug-in. Details at:

http://code.google.com/p/pathtools/
Comment 4 Eclipse Webmaster CLA 2019-09-06 16:18:13 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.