1 11 12 package org.eclipse.ui.internal.menus; 13 14 15 28 final class LegacyLocationInfo { 29 30 35 private final String part; 36 37 41 private final boolean popupMenu; 42 43 48 LegacyLocationInfo() { 49 this(null, true); 50 } 51 52 61 LegacyLocationInfo(final String part) { 62 this(part, false); 63 } 64 65 77 LegacyLocationInfo(final String part, final boolean popupMenu) { 78 this.part = part; 79 this.popupMenu = popupMenu; 80 } 81 82 90 final LocationElement append(final LeafLocationElement leafElement) { 91 if ((popupMenu) && (leafElement instanceof SBar)) { 92 final SBar bar = (SBar) leafElement; 93 final String path = bar.getPath(); 94 final SPopup popup = new SPopup(null, path); 95 if (part == null) { 96 return popup; } 98 99 return new SPart(part, SPart.TYPE_ID, popup); } 101 102 if (part != null) { 103 return new SPart(part, SPart.TYPE_ID, leafElement); } 105 106 return leafElement; } 108 } 109 | Popular Tags |