Skip to content

Commit a663512

Browse files
authored
Merge pull request #3602 from katysaintin/pv-tango
Pv-tango improvment and corrections
2 parents ded1e0b + 8bd812a commit a663512

19 files changed

+4282
-0
lines changed

core/pv-tango/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
/.project
2+
/.classpath
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
package org.phoebus.pv.tango;
2+
3+
import java.util.List;
4+
5+
import org.epics.vtype.Display;
6+
import org.epics.vtype.DisplayProvider;
7+
import org.epics.vtype.EnumDisplay;
8+
9+
public class AdvancedEnumDisplay extends EnumDisplay implements DisplayProvider {
10+
11+
private EnumDisplay source ;
12+
private Display display ;
13+
14+
private AdvancedEnumDisplay(Display display,EnumDisplay source) {
15+
this.source = source;
16+
this.display = display;
17+
}
18+
19+
@Override
20+
public List<String> getChoices() {
21+
return source != null ? source.getChoices() : null;
22+
}
23+
24+
@Override
25+
public Display getDisplay() {
26+
return display;
27+
}
28+
29+
30+
/**
31+
* New EnumDisplay with the given choices.
32+
*
33+
* @param choices the enum choices
34+
* @return the new display
35+
*/
36+
public static EnumDisplay of(final Display display, final String... choices) {
37+
EnumDisplay enumDisp = choices != null ? EnumDisplay.of(choices) : null;
38+
return new AdvancedEnumDisplay(display,enumDisp);
39+
}
40+
41+
42+
43+
}

0 commit comments

Comments
 (0)