コード例 #1
0
ファイル: Project.java プロジェクト: DanielRough/Jeeves
  public void setData(Data data) {
    super.setData(data);
    // JeevesMain.currentGUI.currentproject = this; //I DON'T THINK THIS WILL WORK AT ALL BUT LET'S
    // SEE
    List<Data> uidesign = (List) data.getInnerDataList("uidesign");
    if (uidesign != null)
      uidesign.forEach(
          element -> {
            UIElement s = (UIElement) Element.create(element);
            uielements.add(s);
          });
    List<Data> trigs = (List) data.getInnerDataList("triggers");
    if (trigs != null)
      trigs.forEach(
          trig -> {
            Trigger t = (Trigger) Element.create(trig);
            t.setReadOnly(false);
            triggers.add(t);
          });
    List<Data> exprs = (List) data.getInnerDataList("expressions");
    if (exprs != null)
      exprs.forEach(
          expr -> {
            Expression e = (Expression) Element.create(expr);
            e.setReadOnly(false);
            expressions.add(e);
          });
    List<Data> vars = (List) data.getInnerDataList("variables");
    if (vars != null)
      vars.forEach(
          var -> {
            UserVariable v = (UserVariable) Element.create(var);
            v.setReadOnly(false);
            variables.add(v);
          });
    List<Data> surs = (List) data.getInnerDataList("surveys");
    if (surs != null)
      surs.forEach(
          survey -> {
            if (survey != null) {
              Survey s = (Survey) Element.create(survey);
              surveys.add(s);
            }
          });

    //	data.get(")
    elementData.add("description", getDescription());
    elementData.add("triggers", getTriggerData());
    elementData.add("expressions", getExpressionData());
    elementData.add("variables", getVariableData());
    elementData.add("surveys", getSurveyData());
    elementData.add("uidesign", getUIElementData());
  }