예제 #1
0
  /** Textual description of key */
  public String getKeyDesc() {
    if (types.isEmpty()) return "";
    else return types.get(0).getKeyDesc();

    // TODO: GUI need to handle several keys

  }
예제 #2
0
  public boolean load() {
    try {
      if (new File(FILE_PATH).exists()) {
        FileInputStream FIS = new FileInputStream(FILE_PATH);
        JXMLBaseObject cobjXmlObj = new JXMLBaseObject();
        cobjXmlObj.InitXMLStream(FIS);
        FIS.close();

        Vector exps = new Vector();
        Element rootElmt = cobjXmlObj.GetElementByName(JCStoreTableModel.ROOT_NAME);
        for (Iterator i = rootElmt.getChildren().iterator(); i.hasNext(); ) {
          Element crtElmt = (Element) i.next();
          JCExpression exp = new JCExpression();
          exp.mId = crtElmt.getAttributeValue("id", "");
          exp.mName = crtElmt.getAttributeValue("name", "");
          exp.mShowValue = crtElmt.getAttributeValue("show", "");
          exp.mStoreValue = crtElmt.getAttributeValue("store", "");
          exps.add(exp);
        }
        if (mModel != null) {
          mModel.setExpression(exps);
        }
      }
    } catch (Exception e) {
      e.printStackTrace();
      return false;
    }
    return true;
  }
예제 #3
0
 /** Key binding for special call */
 public KeyBinding(String plugin, String description, int keyCode, int modifierEx) {
   this.pluginName = plugin;
   this.description = description;
   TypeKeycode kb = new TypeKeycode(keyCode, modifierEx);
   types.add(kb);
 }
예제 #4
0
 /** Key binding for special call */
 public KeyBinding(String plugin, String description, char key) {
   this.pluginName = plugin;
   this.description = description;
   TypeChar kb = new TypeChar(key);
   types.add(kb);
 }
예제 #5
0
 /** Key binding */
 public KeyBinding(String plugin, String description, KeyBindingType kb) {
   this.pluginName = plugin;
   this.description = description;
   if (kb != null) types.add(kb);
 }