Package org.docx4j.wml

Examples of org.docx4j.wml.R$Tab


        final int yPosStartDrowdown = p5GuiYOffset+36;

        cp5.getWindow().setPositionOfTabs(GENERIC_X_OFS, this.getHeight()-20);

        //there a default tab which is present all the time. rename this tab
        Tab generatorTab = cp5.getTab("default"); //$NON-NLS-1$
        allTabs.add(generatorTab);
        generatorTab.setLabel(messages.getString("GeneratorGui.TAB_GENERATOR_EFFECT"));     //$NON-NLS-1$
        Tab outputTab = cp5.addTab(messages.getString("GeneratorGui.TAB_SINGLE_OUTPUT_MAPPING")); //$NON-NLS-1$
        allTabs.add(outputTab);
        Tab allOutputTab = null;
       
        //add all output mapping only if multiple output panels exist
        if (nrOfVisuals>2) {
            allOutputTab = cp5.addTab(messages.getString("GeneratorGui.TAB_ALL_OUTPUT_MAPPING"));     //$NON-NLS-1$
            allOutputTab.setColorForeground(0xffff0000);
            allTabs.add(allOutputTab);
        }

        Tab randomTab = cp5.addTab(messages.getString("GeneratorGui.TAB_RANDOMIZE"));     //$NON-NLS-1$
        allTabs.add(randomTab);
        Tab presetTab = cp5.addTab(messages.getString("GeneratorGui.TAB_PRESETS")); //$NON-NLS-1$
        allTabs.add(presetTab);
        Tab infoTab = cp5.addTab(messages.getString("GeneratorGui.TAB_INFO")); //$NON-NLS-1$
        allTabs.add(infoTab);
        Tab helpTab = cp5.addTab(messages.getString("GeneratorGui.TAB_HELP")); //$NON-NLS-1$
        allTabs.add(helpTab);
       
        generatorTab.setColorForeground(0xffff0000);
        outputTab.setColorForeground(0xffff0000);
        randomTab.setColorForeground(0xffff0000);
        presetTab.setColorForeground(0xffff0000);
        helpTab.setColorForeground(0xffff0000);
       
        generatorTab.bringToFront();
       
        //-------------
        //Generic Options
View Full Code Here


      return textGenerator.isFocus() || presetName.isFocus();
    }


  public void selectPreviousTab() {
    Tab currentTab = cp5.getWindow().getCurrentTab();
    Tab lastTab=null;
    for (Tab t: allTabs) {
      if (t==currentTab && lastTab!=null) {
        lastTab.bringToFront();
        return;
      }
      lastTab = t;
    }
    //activate the last tab
View Full Code Here

  }
 

  public void selectNextTab() {
    boolean activateNextTab = false;   
    Tab currentTab = cp5.getWindow().getCurrentTab();   
   
    for (Tab t: allTabs) {
      if (activateNextTab) {
        //active next tab and return
        t.bringToFront();
View Full Code Here

            // Create object for pStyle
            PPrBase.PStyle pprbasepstyle = wmlObjectFactory.createPPrBasePStyle();
            ppr.setPStyle(pprbasepstyle);
                pprbasepstyle.setVal( style);
        // Create object for r
        R r = wmlObjectFactory.createR();
        p.getContent().add( r);
            // Create object for t (wrapped in JAXBElement)
            Text text = wmlObjectFactory.createText();
            JAXBElement<org.docx4j.wml.Text> textWrapped = wmlObjectFactory.createRT(text);
            r.getContent().add( textWrapped);
                text.setValue( style + "; list " + numId + ", ilvl " + ilvl);

    return p;
    }
View Full Code Here

    }
 
  protected P createUnnumberedP() {
   
    P p = wmlObjectFactory.createP();
        R r = wmlObjectFactory.createR();
        p.getContent().add( r);
            // Create object for t (wrapped in JAXBElement)
            Text text = wmlObjectFactory.createText();
            JAXBElement<org.docx4j.wml.Text> textWrapped = wmlObjectFactory.createRT(text);
            r.getContent().add( textWrapped);
                text.setValue( "UnnumberedP");

    return p;
   
View Full Code Here

      // will ensure that the style is activated 

    // Example 3b: bold text
      // Well, actually you can use addParagraphOfText:
    P p3b = mdp.addParagraphOfText("Example 3b (bold)");
    R r3b = (R)p3b.getContent().get(0);
      // .. now set rPr (I'll just reuse the above object)
    r3b.setRPr(rpr);

     
      // Example 4: Here is an easier way:
      String str = "<w:p xmlns:w=\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\" ><w:r><w:rPr><w:b /></w:rPr><w:t>Example 4</w:t></w:r></w:p>";
     
View Full Code Here

    ctDataBinding.setStoreItemID(storeItemID);
         
    CTSdtContentRun sdtContent = Context.getWmlObjectFactory().createCTSdtContentRun();     
    sdtRun.setSdtContent(sdtContent);

    R rnew = new R();
    rnew.setRPr( rPr ); // point at old rPr, if any
    Text text = Context.getWmlObjectFactory().createText();
    text.setValue(key);
    rnew.getContent().add(text);
   
    sdtContent.getContent().add(rnew);
  }
View Full Code Here

  public static void joinupRuns(P p) {

    List<Object> existingContents = p.getContent();
    List<Object> newContents = new ArrayList<Object>();
   
    R currentR = null;
    String currentRPrString = null;
   
    // First join up runs with same run properties
    for (Object o : existingContents) {
     
      if (o instanceof R) {
       
        if (currentR==null) { // first object, or after something not a run
          currentR=(R)o;
          if (currentR.getRPr()!=null) {
            currentRPrString = XmlUtils.marshaltoString(currentR.getRPr(), true);
          }
          newContents.add(currentR);
        } else {
          RPr other = ((R)o).getRPr();
         
          boolean makeNewRun = true; // unless proven otherwise
         
          if (currentRPrString==null && other==null) makeNewRun=false;
          if (currentRPrString!=null && other!=null) {
            // Simple minded notion of equality
            if ( XmlUtils.marshaltoString(other, true).equals(currentRPrString) )  makeNewRun=false;
          }
         
          if (makeNewRun) {
            currentR=(R)o;
            if (currentR.getRPr()==null) {
              currentRPrString = null;
            } else {
              currentRPrString = XmlUtils.marshaltoString(currentR.getRPr(), true);
            }
            newContents.add(currentR);
          } else {
            currentR.getContent().addAll( ((R)o).getContent() );
          }
        }
       
      } else {
        // not a run (eg w:ins) .. just add it and move on
View Full Code Here

               
                if ( o2 instanceof Text ) {
                  handle((R)o, ((Text)o2).getValue(), 0, replacementContent);
                } else {
                  // Just add this bit
                  R rnew = new R();
                  rnew.setRPr( ((R)o).getRPr() ); // point at old rPr, if any
                  rnew.getContent().add(o2);
                  replacementContent.add(rnew);
                }               
              }
            } else {
              replacementContent.add(o);
View Full Code Here

 
 
   private void addTextRun(R r, String val, List<Object> replacementContent) {
    
      R rnew = new R();
      rnew.setRPr( r.getRPr() ); // point at old rPr, if any
     
      Text text = Context.getWmlObjectFactory().createText();
      text.setValue(val);
      if (val.startsWith(" ")
          || val.endsWith(" ") ) {
        text.setSpace("preserve");
      }
     
      rnew.getContent().add(text);
      replacementContent.add(rnew);
    
   }
View Full Code Here

TOP

Related Classes of org.docx4j.wml.R$Tab

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.