Package org.pentaho.reporting.engine.classic.core.style.css

Examples of org.pentaho.reporting.engine.classic.core.style.css.ElementStyleDefinition


  }

  public void actionPerformed(final ActionEvent e)
  {
    final MasterReport masterReportElement = getActiveContext().getContextRoot();
    ElementStyleDefinition styleDefinition = masterReportElement.getStyleDefinition();
    if(styleDefinition != null)
    {
      styleDefinition = styleDefinition.clone();
    }

    final ReportDesignerContext context = getReportDesignerContext();
    final StyleDefinitionEditorDialog dialog = StyleDefinitionEditorDialog.createDialog(context.getView().getParent(), context);
    final ElementStyleDefinition elementStyleDefinition = dialog.performEdit(styleDefinition);
    if (elementStyleDefinition == styleDefinition)
    {
      return;
    }
View Full Code Here


      final LoadStyleDefinitionTask target = new LoadStyleDefinitionTask(selectedFile);
      final Thread loadThread = new Thread(target);
      loadThread.setDaemon(true);
      BackgroundCancellableProcessHelper.executeProcessWithCancelDialog
          (loadThread, null, context.getParent(), Messages.getString("StyleDefinitionUtilities.LoadMessage"));
      final ElementStyleDefinition report = target.getStyleDefinition();
      if (report != null)
      {
        context.setStyleDefinition(report);
        context.setSource(selectedFile);
      }
View Full Code Here

    public void styleChanged(final ElementStyleSheet source, final StyleKey key, final Object value)
    {
      dataModel.setData(source);

      final ElementStyleDefinition editorStyleDefinition = editorContext.getStyleDefinition();
      editorStyleDefinition.updateRule(source);
    }
View Full Code Here

  }

  protected void init(final ReportDesignerContext designerContext)
  {
    this.taskPanes = new HashMap<ElementStyleRule, JXTaskPane>();
    this.editorContext = new StyleDefinitionEditorContext(designerContext, this, new ElementStyleDefinition());
    this.editorContext.addPropertyChangeListener("source", new FileSourceChangeHandler());

    setTitle(Messages.getString("StyleDefinitionEditorDialog.InlineTitle"));

    final JMenu fileMenu = new JMenu(Messages.getString("StyleDefinitionEditorDialog.Menu.File.Label"));
View Full Code Here

  {
    this.taskPanes.clear();
    this.taskPaneContainer.removeAll();
    this.taskPaneContainer.add(taskPane);

    final ElementStyleDefinition existing = editorContext.getStyleDefinition();
    for (int i = 0; i < existing.getRuleCount(); i += 1)
    {
      final ElementStyleSheet maybeRule = existing.getRule(i);
      if (maybeRule instanceof ElementStyleRule == false)
      {
        continue;
      }
View Full Code Here

        report.addExpression(expression);
      }
    }
    if (styleDefinitionReadHandler != null)
    {
      final ElementStyleDefinition styleDefinition = styleDefinitionReadHandler.getObject();
      if (report instanceof MasterReport && styleDefinition != null)
      {
        final MasterReport master = (MasterReport) report;
        master.setStyleDefinition(styleDefinition);
      }
View Full Code Here

  public StyleDefinitionReadHandler()
  {
    styleDefinitionReadHandlers = new ArrayList<StyleDefinitionReadHandler>();
    styleRuleReadHandler= new ArrayList<StyleDefinitionRuleReadHandler>();
    result = new ElementStyleDefinition();
  }
View Full Code Here

      // only the master report can carry page-definitions ..
      final PageDefinition definition = report.getPageDefinition();
      writePageDefinition(writer, definition);

      final MasterReport master = (MasterReport) report;
      final ElementStyleDefinition styleDefinition = master.getStyleDefinition();
      if (styleDefinition != null)
      {
        writer.writeTag(BundleNamespaces.STYLE, "style-definition", XmlWriter.OPEN);
        writeStyleDefinition(writer, styleDefinition);
        writer.writeCloseTag();
View Full Code Here

                                          final ElementStyleDefinition styleDefinition) throws IOException
  {
    final int styleSheetCount = styleDefinition.getStyleSheetCount();
    for (int s = 0; s < styleSheetCount; s += 1)
    {
      final ElementStyleDefinition child = styleDefinition.getStyleSheet(s);
      writer.writeTag(BundleNamespaces.STYLE, "style-definition", XmlWriter.OPEN);
      writeStyleDefinition(writer, child);
      writer.writeCloseTag();
    }
View Full Code Here

    assertNotNull(resource);

    final ResourceManager mgr = new ResourceManager();
    mgr.registerDefaults();
    final Resource loaded = mgr.createDirectly(resource, ElementStyleDefinition.class);
    final ElementStyleDefinition style = (ElementStyleDefinition) loaded.getResource();
    assertEquals(1, style.getRuleCount());
    final ElementStyleSheet rule = style.getRule(0);
    assertNotNull(rule);

    assertEquals("Arial", rule.getStyleProperty(TextStyleKeys.FONT));
  }
View Full Code Here

TOP

Related Classes of org.pentaho.reporting.engine.classic.core.style.css.ElementStyleDefinition

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.