Package org.pentaho.openformula.ui

Examples of org.pentaho.openformula.ui.ParameterUpdateEvent


    assertEquals(21, editResult.caretPositionAfterEdit);
  }

  public void testNestedParameterReplacement()
  {
    final ParameterUpdateEvent event = new ParameterUpdateEvent(this, 1, "AND(1; (1 + 1))", true);
    final FormulaDocument doc = new FormulaDocument();
    doc.setText("=IF(;SUM();)");
    final FunctionInformation fn = doc.getFunctionForPosition(9);
    assertEquals("SUM", fn.getCanonicalName());
View Full Code Here


    assertEquals(25, editResult.caretPositionAfterEdit);
  }

  public void testNestedParameterReplacement2()
  {
    final ParameterUpdateEvent event = new ParameterUpdateEvent(this, 0, "AND(1; (1 + 1))", true);
    final FormulaDocument doc = new FormulaDocument();
    doc.setText("=IF(;SUM();)");
    final FunctionInformation fn = doc.getFunctionForPosition(9);
    assertEquals("SUM", fn.getCanonicalName());
View Full Code Here

  {
    final FormulaDocument doc = new FormulaDocument();
    doc.setText("=MESSAGE(\"Test\"; 1 ; 2)");
    final FunctionInformation fn = doc.getFunctionForPosition(1);

    final ParameterUpdateEvent event = new ParameterUpdateEvent(this, 0, "[Some parameter]", true);
    final FunctionParameterEditHelper.EditResult editResult =
        FunctionParameterEditHelper.buildFormulaText(event, fn, doc.getText());

    assertEquals("=MESSAGE([Some parameter]; 1 ; 2)", editResult.text);
    assertEquals(25, editResult.caretPositionAfterEdit);
View Full Code Here

  {
    final FormulaDocument doc = new FormulaDocument();
    doc.setText("=MESSAGE(\"Test\"; 1 ; 2)");
    final FunctionInformation fn = doc.getFunctionForPosition(1);

    final ParameterUpdateEvent event = new ParameterUpdateEvent(this, 2, "[Some parameter]", true);
    final FunctionParameterEditHelper.EditResult editResult =
        FunctionParameterEditHelper.buildFormulaText(event, fn, doc.getText());

    assertEquals("=MESSAGE(\"Test\"; 1 ;[Some parameter])", editResult.text);
    assertEquals(36, editResult.caretPositionAfterEdit);
View Full Code Here

  {
    final FormulaDocument doc = new FormulaDocument();
    doc.setText("=MESSAGE(\"Test\"; 1 ; 2)");
    final FunctionInformation fn = doc.getFunctionForPosition(1);

    final ParameterUpdateEvent event = new ParameterUpdateEvent(this, 3, "[Some parameter]", true);
    final FunctionParameterEditHelper.EditResult editResult =
        FunctionParameterEditHelper.buildFormulaText(event, fn, doc.getText());

    assertEquals("=MESSAGE(\"Test\"; 1 ; 2;[Some parameter])", editResult.text);
    assertEquals(39, editResult.caretPositionAfterEdit);
View Full Code Here

  {
    final FormulaDocument doc = new FormulaDocument();
    doc.setText("=MESSAGE(\"Test\";;;;)");
    final FunctionInformation fn = doc.getFunctionForPosition(1);

    final ParameterUpdateEvent event = new ParameterUpdateEvent(this, 3, "[Some parameter]", true);
    String text = doc.getText();
    final FunctionParameterEditHelper.EditResult editResult =
        FunctionParameterEditHelper.buildFormulaText(event, fn, text);

    assertEquals("=MESSAGE(\"Test\";;;[Some parameter])", editResult.text);
View Full Code Here

  {
    final FormulaDocument doc = new FormulaDocument();
    doc.setText("=MESSAGE(\"Test\";;;;;;)");
    final FunctionInformation fn = doc.getFunctionForPosition(1);

    final ParameterUpdateEvent event = new ParameterUpdateEvent(this, 3, "[Some parameter]", true);
    String text = doc.getText();
    final FunctionParameterEditHelper.EditResult editResult =
        FunctionParameterEditHelper.buildFormulaText(event, fn, text);

    assertEquals("=MESSAGE(\"Test\";;;[Some parameter])", editResult.text);
View Full Code Here

          formula = "DRILLDOWN()";
        }
        for (int i = 0; i < parameterUpdateListeners.length; i++)
        {
          final ParameterUpdateListener listener = parameterUpdateListeners[i];
          listener.parameterUpdated(new ParameterUpdateEvent(DrillDownFunctionParameterEditor.this, -1, formula, true));
        }
      }
      finally
      {
        inParameterUpdate = false;
View Full Code Here

TOP

Related Classes of org.pentaho.openformula.ui.ParameterUpdateEvent

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.