use of org.freeplane.core.ui.menubuilders.generic.EntryAccessor in project freeplane by freeplane.
the class FilterMenuBuilder method visit.
@Override
public void visit(Entry target) {
final DefaultComboBoxModel filterConditions = filterController.getFilterConditions();
final HashSet<String> usedNames = new HashSet<String>();
for (int i = 0; i < filterConditions.getSize(); i++) {
final ASelectableCondition condition = (ASelectableCondition) filterConditions.getElementAt(i);
final String conditionName = condition.getUserName();
if (conditionName != null && usedNames.add(conditionName)) {
final ApplyNamedFilterAction action = new ApplyNamedFilterAction(filterController, condition);
controller.addActionIfNotAlreadySet(action);
new EntryAccessor().addChildAction(target, action);
}
}
}
use of org.freeplane.core.ui.menubuilders.generic.EntryAccessor in project freeplane by freeplane.
the class LastOpenedList method updateMenus.
private void updateMenus(ModeController modeController, Entry target) {
List<AFreeplaneAction> openMapActions = createOpenLastMapActionList();
for (AFreeplaneAction openMapAction : openMapActions) {
modeController.addActionIfNotAlreadySet(openMapAction);
new EntryAccessor().addChildAction(target, openMapAction);
}
}
use of org.freeplane.core.ui.menubuilders.generic.EntryAccessor in project freeplane by freeplane.
the class BToolbarContributor method visit.
@Override
public void visit(Entry target) {
final EntryAccessor entryAccessor = new EntryAccessor();
final Entry label = new Entry();
target.addChild(label);
entryAccessor.setComponent(label, new JLabel("URL:"));
final Entry field = new Entry();
target.addChild(field);
entryAccessor.setComponent(field, urlfield);
}
use of org.freeplane.core.ui.menubuilders.generic.EntryAccessor in project freeplane by freeplane.
the class UserInputListenerFactory method createMapActions.
private void createMapActions(final Entry mapsMenuEntry) {
final IMapViewManager mapViewManager = Controller.getCurrentController().getMapViewManager();
final ViewController viewController = Controller.getCurrentController().getViewController();
final List<? extends Component> mapViewVector = viewController.getMapViewVector();
if (mapViewVector == null) {
return;
}
EntryAccessor entryAccessor = new EntryAccessor();
for (final Component mapView : mapViewVector) {
final String displayName = mapView.getName();
Entry actionEntry = new Entry();
final MapsMenuAction action = new MapsMenuAction(displayName);
actionEntry.setName(action.getKey());
modeController.addActionIfNotAlreadySet(action);
entryAccessor.setAction(actionEntry, action);
final MapView currentMapView = (MapView) mapViewManager.getMapViewComponent();
if (currentMapView != null) {
if (mapView == currentMapView) {
actionEntry.setAttribute("selected", true);
}
}
mapsMenuEntry.addChild(actionEntry);
}
}
use of org.freeplane.core.ui.menubuilders.generic.EntryAccessor in project freeplane by freeplane.
the class MenuBuilderIntegrationTest method createsEmptyToolbarComponent.
@Test
public void createsEmptyToolbarComponent() {
String content = "<FreeplaneUIEntries>" + "<Entry name='home' builder='toolbar'/>" + "</FreeplaneUIEntries>";
Entry builtMenuStructure = buildJMenu(content);
assertThat(new EntryAccessor().getComponent(builtMenuStructure.getChild(0)), CoreMatchers.<Object>is(toolbar));
}
Aggregations