Package org.pentaho.reporting.designer.core.util

Examples of org.pentaho.reporting.designer.core.util.GroupSelectorDialog


        }
      }
      else if (GROUP_VALUE_ROLE.equals(valueRole))
      {
        final Window window = LibSwingUtil.getWindowAncestor(AbstractStringValueCellEditor.this);
        final GroupSelectorDialog editorDialog;
        if (window instanceof Frame)
        {
          editorDialog = new GroupSelectorDialog((Frame) window);
        }
        else if (window instanceof Dialog)
        {
          editorDialog = new GroupSelectorDialog((Dialog) window);
        }
        else
        {
          editorDialog = new GroupSelectorDialog();
        }

        final String originalGroup = (String) comboBox.getSelectedItem();
        final String selectedGroup = editorDialog.performEdit(getGroups(), originalGroup);
        if (editorDialog.isConfirmed())
        {
          comboBox.setSelectedItem(selectedGroup);
        }
      }
      else if (FORMULA_VALUE_ROLE.equals(valueRole))
      {
        final FormulaEditorDialog editorDialog =
            GUIUtils.createFormulaEditorDialog(getReportDesignerContext(), AbstractStringValueCellEditor.this);

        final String originalFormula = (String) comboBox.getSelectedItem();
        final String formula = editorDialog.editFormula(originalFormula, getFields());
        if (formula != null)
        {
          comboBox.setSelectedItem(formula);
        }
      }
      else if (NUMBER_FORMAT_VALUE_ROLE.equals(valueRole) || DATE_FORMAT_VALUE_ROLE.equals(valueRole))
      {
        final Window window = LibSwingUtil.getWindowAncestor(AbstractStringValueCellEditor.this);
        final TextAreaPropertyEditorDialog editorDialog;
        if (window instanceof Frame)
        {
          editorDialog = new TextAreaPropertyEditorDialog((Frame) window);
        }
        else if (window instanceof Dialog)
        {
          editorDialog = new TextAreaPropertyEditorDialog((Dialog) window);
        }
        else
        {
          editorDialog = new TextAreaPropertyEditorDialog();
        }
        final String originalFormula = (String) comboBox.getSelectedItem();
        final String text = editorDialog.performEdit(originalFormula);
        if (editorDialog.isConfirmed())
        {
          comboBox.setSelectedItem(text);
        }
      }
      else
      {
        final Window window = LibSwingUtil.getWindowAncestor(AbstractStringValueCellEditor.this);
        final TextAreaPropertyEditorDialog editorDialog;
        if (window instanceof Frame)
        {
          editorDialog = new TextAreaPropertyEditorDialog((Frame) window);
        }
        else if (window instanceof Dialog)
        {
          editorDialog = new TextAreaPropertyEditorDialog((Dialog) window);
        }
        else
        {
          editorDialog = new TextAreaPropertyEditorDialog();
        }

        final JTextComponent textField = getTextField();
        final String originalValue = textField.getText();
        final String text = editorDialog.performEdit(originalValue);
        if (editorDialog.isConfirmed())
        {
          textField.setText(text);
        }
      }
View Full Code Here


        }
      }
      else if (GROUP_VALUE_ROLE.equals(valueRole))
      {
        final Window window = SwingUtil.getWindowAncestor(AbstractStringValueCellEditor.this);
        final GroupSelectorDialog editorDialog;
        if (window instanceof Frame)
        {
          editorDialog = new GroupSelectorDialog((Frame) window);
        }
        else if (window instanceof Dialog)
        {
          editorDialog = new GroupSelectorDialog((Dialog) window);
        }
        else
        {
          editorDialog = new GroupSelectorDialog();
        }
        editorDialog.pack();
        SwingUtil.centerDialogInParent(editorDialog);
        final String originalGroup = (String) comboBox.getSelectedItem();
        final String selectedGroup = editorDialog.performEdit(getGroups(), originalGroup);
        if (editorDialog.isConfirmed())
        {
          comboBox.setSelectedItem(selectedGroup);
        }
      }
      else if (FORMULA_VALUE_ROLE.equals(valueRole))
      {
        final FormulaEditorDialog editorDialog =
            GUIUtils.createFormulaEditorDialog(getReportDesignerContext(), AbstractStringValueCellEditor.this);

        final String originalFormula = (String) comboBox.getSelectedItem();
        final String formula = editorDialog.editFormula(originalFormula, getFields());
        if (formula != null)
        {
          comboBox.setSelectedItem(formula);
        }
      }
      else if (NUMBER_FORMAT_VALUE_ROLE.equals(valueRole) || DATE_FORMAT_VALUE_ROLE.equals(valueRole))
      {
        final Window window = SwingUtil.getWindowAncestor(AbstractStringValueCellEditor.this);
        final TextAreaPropertyEditorDialog editorDialog;
        if (window instanceof Frame)
        {
          editorDialog = new TextAreaPropertyEditorDialog((Frame) window);
        }
        else if (window instanceof Dialog)
        {
          editorDialog = new TextAreaPropertyEditorDialog((Dialog) window);
        }
        else
        {
          editorDialog = new TextAreaPropertyEditorDialog();
        }
        final String originalFormula = (String) comboBox.getSelectedItem();
        final String text = editorDialog.performEdit(originalFormula);
        if (editorDialog.isConfirmed())
        {
          comboBox.setSelectedItem(text);
        }
      }
      else
      {
        final Window window = SwingUtil.getWindowAncestor(AbstractStringValueCellEditor.this);
        final TextAreaPropertyEditorDialog editorDialog;
        if (window instanceof Frame)
        {
          editorDialog = new TextAreaPropertyEditorDialog((Frame) window);
        }
        else if (window instanceof Dialog)
        {
          editorDialog = new TextAreaPropertyEditorDialog((Dialog) window);
        }
        else
        {
          editorDialog = new TextAreaPropertyEditorDialog();
        }

        final JTextComponent textField = getTextField();
        final String originalValue = textField.getText();
        final String text = editorDialog.performEdit(originalValue);
        if (editorDialog.isConfirmed())
        {
          textField.setText(text);
        }
      }
View Full Code Here

TOP

Related Classes of org.pentaho.reporting.designer.core.util.GroupSelectorDialog

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.