Project

General

Profile

Actions

Bug #3361

open

parameters lose their Display Name when copy and pasted

Added by Derik Barseghian almost 16 years ago. Updated about 15 years ago.

Status:
In Progress
Priority:
Normal
Category:
general
Target version:
Start date:
06/03/2008
Due date:
% Done:

0%

Estimated time:
Bugzilla-Id:
3361

Description

It may be this is the 'proper' behavior, but it doesn't seem so to me (cxh?).

steps to reproduce:
- Drag Parameter to canvas
- Right click, Customize Name
- type in a New Name: new_name, and a Display Name: display_name
- Commit
- copy and paste the Parameter

The second Parameter has New name: new_name2, and Display name: new_name2, but I think Display name should be: display_name2.

This affects:

GriddlesParameter
ColorParameter
FileParameter
Parameter
PortParameter
RequireVersion
SemanticTypeParameter
StringParameter

Actions #1

Updated by Derik Barseghian almost 16 years ago

Also, why "New name" ? It seems like it should just be Name and Display Name.

Actions #2

Updated by Christopher Brooks almost 16 years ago

I've partially fixed this.
1) NamedObj._exportMoMLContents() now exports the value of _displayName
if it is non-null. Formerly, NamedObj.exportMoML() was doing the export
of _displayName, but this was causing problems when Parameter.exportMoML()
was called because NamedObj.exportMoML() was not being called,
NamedObj.exportMoMLContents() was instead being called.

NamedObj now looks like:

protected void _exportMoMLContents(Writer output, int depth)
throws IOException {
// If the display name has been set, then include a display element.
// Note that copying parameters that have _displayName set need
// to export _displayName.
// See: http://bugzilla.ecoinformatics.org/show_bug.cgi?id=3361
if (_displayName != null) {
output.write("<display name=\"");
output.write(StringUtilities.escapeForXML(_displayName));
output.write("\"/>");
}

// Callers of this method should hold read access 
// so as to avoid ConcurrentModificationException.
if (_attributes != null) {
Iterator attributes = _attributes.elementList().iterator();
while (attributes.hasNext()) {
Attribute attribute = (Attribute) attributes.next();
attribute.exportMoML(output, depth);
}
}
}

2) I changed actor.gui.RenameConfigurer so that we now say "Name"
instead of "New Name". This fits better with the other dialogs.
For example, Edit Parameters does not say "New foo", it says "foo".

3) I'm not so sure if the copy of a Parameter should update the Display Name
or not. The reason is that if we start messing with the internals of
a Parameter, we are sort of violating some sort of existing contract.
This could be done, perhaps by having MoMLParser.attribute() properly
handle the _displayName, but this seems hacky. Further discussion
is warranted.
I'm moving this to an enhancement request.

Actions #3

Updated by Redmine Admin about 11 years ago

Original Bugzilla ID was 3361

Actions

Also available in: Atom PDF