Bug 2367 - add bookmark accepts empty string but does nothing (1GEUL6T)
Summary: add bookmark accepts empty string but does nothing (1GEUL6T)
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 2.0   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Knut Radloff CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2001-10-10 22:35 EDT by Kevin Haaland CLA
Modified: 2002-02-04 12:19 EST (History)
0 users

See Also:


Attachments
Proposed fix (11.21 KB, text/plain)
2002-01-31 18:49 EST, Knut Radloff CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Kevin Haaland CLA 2001-10-10 22:35:02 EDT
AK (6/5/01 2:35:19 PM)
	you can put an empty string as a bookmark name - but the action does nothing then.
	emoty string should not be allowed.

NOTES:

GDA (6/5/01 12:08:06 PM)
	Defer. Not clear this is a JUI issue?
	Move to ui for kh to handle.
Comment 1 DJ Houghton CLA 2001-10-29 18:23:10 EST
PRODUCT VERSION:
	118

Comment 2 Knut Radloff CLA 2002-01-31 18:48:41 EST
Add Task dialog had the same problem.
Both now disable the ok button unless text is entered.
Comment 3 Knut Radloff CLA 2002-01-31 18:49:36 EST
Created attachment 293 [details]
Proposed fix
Comment 4 Tod Creasey CLA 2002-02-01 10:58:26 EST
Verified and released into HEAD stream
Comment 5 Knut Radloff CLA 2002-02-01 15:23:28 EST
The same IInputValidator needs to be added to the InputDialog in 
AddMarkerAction.askForLabel
That method is called when adding a marker on the text selection in an editor.
Also, please remove the final I added to "String message" in 
MarkerRulerAction.askForLabel as well as add //$NON-NLS-1$ behind the 
return " " (as shown below). The intent here is to disable the OK button by 
return a message/non-empty string. An actual error message should not be 
necessary as the input dialog is very simple and straightforward.

IInputValidator inputValidator = new IInputValidator() {
	public String isValid(String newText) {
		if (newText == null || newText.length() == 0) {
			return " "; //$NON-NLS-1$
		}
		return null;
	}
};
Comment 6 Knut Radloff CLA 2002-02-01 15:27:35 EST
Sent mail to Kai asking him to incorporate the changes I outline above.
Comment 7 Kai-Uwe Maetzel CLA 2002-02-04 12:19:13 EST
Integrated changes into MarkerRulerAction & AddMarkerAction.