use of org.freeplane.core.resources.components.IPropertyControlCreator in project freeplane by freeplane.
the class MIconController method createPreferences.
private void createPreferences() {
final MModeController modeController = (MModeController) Controller.getCurrentModeController();
final OptionPanelBuilder optionPanelBuilder = modeController.getOptionPanelBuilder();
final List<AFreeplaneAction> actions = new ArrayList<AFreeplaneAction>();
actions.addAll(iconActions.values());
actions.add(modeController.getAction("RemoveIcon_0_Action"));
actions.add(modeController.getAction("RemoveIconAction"));
actions.add(modeController.getAction("RemoveAllIconsAction"));
for (final AFreeplaneAction iconAction : actions) {
final IIconInformation info = (IIconInformation) iconAction;
optionPanelBuilder.addCreator("Keystrokes/icons", new IPropertyControlCreator() {
public IPropertyControl createControl() {
final KeyProperty keyProperty = new KeyProperty(info.getShortcutKey(), info.getTranslationValueLabel());
keyProperty.setIcon(info.getIcon());
keyProperty.disableModifiers();
return keyProperty;
}
}, IndexedTree.AS_CHILD);
}
}
use of org.freeplane.core.resources.components.IPropertyControlCreator in project freeplane by freeplane.
the class MFileManager method createPreferences.
private void createPreferences() {
final MModeController modeController = (MModeController) Controller.getCurrentModeController();
final OptionPanelBuilder optionPanelBuilder = modeController.getOptionPanelBuilder();
optionPanelBuilder.addCreator("Environment/load", new IPropertyControlCreator() {
@Override
public IPropertyControl createControl() {
final Set<String> charsets = Charset.availableCharsets().keySet();
final LinkedList<String> charsetList = new LinkedList<String>(charsets);
charsetList.addFirst("JVMdefault");
final LinkedList<String> charsetTranslationList = new LinkedList<String>(charsets);
charsetTranslationList.addFirst(TextUtils.getText("OptionPanel.default"));
return new ComboProperty("default_charset", charsetList, charsetTranslationList);
}
}, IndexedTree.AS_CHILD);
optionPanelBuilder.addCreator("Environment/files/skip_template_selection", new IPropertyControlCreator() {
@Override
public IPropertyControl createControl() {
final Collection<String> templates = collectAvailableMapTemplates();
ComboProperty comboProperty = new ComboProperty(STANDARD_TEMPLATE, templates, templates);
comboProperty.setEditable(true);
return comboProperty;
}
}, IndexedTree.BEFORE);
}
Aggregations