Bug 324602 - [Preferences] [FieldEditors] TableFieldEditor as a new type of FieldEditor
Summary: [Preferences] [FieldEditors] TableFieldEditor as a new type of FieldEditor
Status: NEW
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.0   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Platform UI Triaged CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-09-06 18:25 EDT by Sandip Chitale CLA
Modified: 2019-09-06 16:18 EDT (History)
2 users (show)

See Also:


Attachments
patch for TableFieldEditor (18.71 KB, text/plain)
2010-09-06 18:26 EDT, Sandip Chitale CLA
no flags Details
TableFieldEditor example usage. (25.48 KB, image/png)
2010-09-06 18:27 EDT, Sandip Chitale CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
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.