use of org.freeplane.core.ui.menubuilders.generic.Entry in project freeplane by freeplane.
the class MenuBuildProcessFactoryTest method ifProcessOnPopupIsSet_buildsWhenItBecomesVisible.
@Test
public void ifProcessOnPopupIsSet_buildsWhenItBecomesVisible() throws Exception {
final Entry menuStructure = XmlEntryStructureBuilder.buildMenuStructure("<Entry builder='main_menu'>" + "<Entry name='submenu'>" + "<Entry name='submenu' processOnPopup='true'>" + "<Entry name='action'/>" + "</Entry>" + "</Entry>" + "</Entry>");
phaseProcessor.build(menuStructure);
final Entry openedEntry = menuStructure.getChild(0, 0, 0);
JMenu menu = (JMenu) new EntryAccessor().getComponent(openedEntry);
menu.getPopupMenu().setVisible(true);
verify(freeplaneActions).getAction("action");
}
use of org.freeplane.core.ui.menubuilders.generic.Entry in project freeplane by freeplane.
the class ToolbarComponentProviderTest method testName.
@Test
public void testName() throws Exception {
final ToolbarComponentProvider toolbarComponentProvider = new ToolbarComponentProvider();
final Entry entry = new Entry();
final EntryAccessor entryAccessor = new EntryAccessor();
final Object testComponent = new JPanel();
entryAccessor.setComponent(entry, testComponent);
Assert.assertThat(toolbarComponentProvider.createComponent(entry), equalTo(testComponent));
}
use of org.freeplane.core.ui.menubuilders.generic.Entry in project freeplane by freeplane.
the class JMenuRadioGroupBuilder method visit.
@Override
public void visit(Entry target) {
ButtonGroup buttonGroup = new ButtonGroup();
final MenuRadioActionComponentProvider menuActionComponentProvider = new MenuRadioActionComponentProvider(accelerators, acceleratebleActionProvider, resourceAccessor, buttonGroup);
JMenuItemBuilder menuItemBuilder = new JMenuItemBuilder(popupListener, menuActionComponentProvider, resourceAccessor);
menuItemBuilder.visit(target);
for (Entry childEntry : target.children()) {
menuItemBuilder.visit(childEntry);
}
}
use of org.freeplane.core.ui.menubuilders.generic.Entry 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.Entry 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);
}
}
Aggregations