Search in sources :

Example 1 with TextEditor

use of main.swing.generic.components.editors.TextEditor in project Eidolons by IDemiurge.

the class HT_View method editDefaultProp.

private void editDefaultProp(ObjType type) {
    String value = new TextEditor().launch(type.getProperty(getDefaultEditProp()));
    if (value != null) {
        type.setProperty(getDefaultEditProp(), value);
        rebuildAndSetTree();
    }
}
Also used : TextEditor(main.swing.generic.components.editors.TextEditor)

Example 2 with TextEditor

use of main.swing.generic.components.editors.TextEditor in project Eidolons by IDemiurge.

the class TreeControlPanel method setProperty.

// private static void setProp(boolean alt, ObjType selectedType) {
// 
// }
private static boolean setProperty(boolean alt, ObjType selectedType) {
    String name;
    String containerString = "Lore;Description;Flavor;Image;Actives;Passives;Attribute Bonuses;Parameter Bonuses;";
    // TODO v-flow buttons one-click!
    List<String> listData = StringMaster.openContainer(containerString);
    name = new ListChooser(SELECTION_MODE.SINGLE, listData, true).choose();
    if (name == null) {
        return false;
    }
    // name = new ButtonChoicePanel(SELECTION_MODE.SINGLE,
    // listData).choose();
    PROPERTY prop = ContentManager.getPROP(name);
    String value = null;
    if (alt) {
        value = new TextEditor().launch(selectedType.getProperty(prop));
    } else if (DC_ContentManager.getEditorMap() != null) {
        if (DC_ContentManager.getEditorMap().get(name) != null) {
            value = DC_ContentManager.getEditorMap().get(name).launch(value, name);
        }
    } else if (prop == G_PROPS.IMAGE) {
        value = new ImageChooser().launch(selectedType.getImagePath(), "");
    // tableMouse.getEditor(prop)
    } else {
        value = new TextEditor().launch(selectedType.getProperty(prop));
    }
    if (value != null) {
        selectedType.setProperty(prop, value);
    }
    return true;
// TableMouseListener
// if ()
}
Also used : TextEditor(main.swing.generic.components.editors.TextEditor) ImageChooser(main.swing.generic.components.editors.ImageChooser) PROPERTY(main.content.values.properties.PROPERTY) ListChooser(main.swing.generic.components.editors.lists.ListChooser)

Aggregations

TextEditor (main.swing.generic.components.editors.TextEditor)2 PROPERTY (main.content.values.properties.PROPERTY)1 ImageChooser (main.swing.generic.components.editors.ImageChooser)1 ListChooser (main.swing.generic.components.editors.lists.ListChooser)1