Skip to content
This repository has been archived by the owner on May 17, 2018. It is now read-only.

Commit

Permalink
Fix renaming of elements with dimensions. Fixes #262.
Browse files Browse the repository at this point in the history
  • Loading branch information
philip-alldredge committed Dec 13, 2017
1 parent d8f5e39 commit de70f00
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
Expand Up @@ -45,6 +45,7 @@
import org.osate.ge.di.Create;
import org.osate.ge.di.GetGraphicalConfiguration;
import org.osate.ge.di.GetName;
import org.osate.ge.di.GetNameForEditing;
import org.osate.ge.di.GetPaletteEntries;
import org.osate.ge.di.IsApplicable;
import org.osate.ge.di.Names;
Expand Down Expand Up @@ -245,6 +246,11 @@ public String getName(final @Named(Names.BUSINESS_OBJECT) NamedElement feature)
return name;
}

@GetNameForEditing
public String getNameForEditing(final @Named(Names.BUSINESS_OBJECT) NamedElement feature) {
return feature.getName();
}

@ValidateName
public String validateName(final @Named(Names.BUSINESS_OBJECT) NamedElement feature,
final @Named(Names.NAME) String value, final NamingService namingService) {
Expand Down
Expand Up @@ -22,6 +22,7 @@
import org.osate.ge.di.Create;
import org.osate.ge.di.GetGraphicalConfiguration;
import org.osate.ge.di.GetName;
import org.osate.ge.di.GetNameForEditing;
import org.osate.ge.di.GetPaletteEntries;
import org.osate.ge.di.IsApplicable;
import org.osate.ge.di.Names;
Expand Down Expand Up @@ -86,6 +87,11 @@ public String getName(final @Named(Names.BUSINESS_OBJECT) Subcomponent sc) {
return getSubcomponentName(sc) + AadlArrayUtil.getDimensionUserString(sc);
}

@GetNameForEditing
public String getNameForEditing(final @Named(Names.BUSINESS_OBJECT) Subcomponent sc) {
return getSubcomponentName(sc);
}

private String getSubcomponentName(final Subcomponent sc) {
return sc.getName() == null ? "" : sc.getName();
}
Expand Down

0 comments on commit de70f00

Please sign in to comment.