Examples of PropertyTable


Examples of org.apache.poi.poifs.property.PropertyTable

        // need to initialize the block list with a block allocation
        // table
        new BlockAllocationTableReader(1, bat_array, 0, -2, data_blocks);

        // get property table from the document
        PropertyTable properties = new PropertyTable(0, data_blocks);
        RootProperty  root       = properties.getRoot();
        BlockList     bl         =
            SmallBlockTableReader.getSmallDocumentBlocks(data_blocks, root,
                14);
    }
View Full Code Here

Examples of org.apache.poi.poifs.property.PropertyTable

            .add(new POIFSDocument("doc8",
                                   new ByteArrayInputStream(new byte[ 8 ])));
        documents
            .add(new POIFSDocument("doc9",
                                   new ByteArrayInputStream(new byte[ 9 ])));
        RootProperty               root = new PropertyTable().getRoot();
        SmallBlockTableWriter      sbtw = new SmallBlockTableWriter(documents,
                                              root);
        BlockAllocationTableWriter bat  = sbtw.getSBAT();

        // 15 small blocks: 6 for doc340, 0 for doc5000 (too big), 0
View Full Code Here

Examples of org.apache.poi.poifs.property.PropertyTable

    // need to initialize the block list with a block allocation
    // table
    new BlockAllocationTableReader(1, bat_array, 0, -2, data_blocks);

    // get property table from the document
    PropertyTable properties = new PropertyTable(0, data_blocks);
    RootProperty root = properties.getRoot();
    BlockList bl = SmallBlockTableReader.getSmallDocumentBlocks(data_blocks, root, 14);
    assertNotNull(bl);
  }
View Full Code Here

Examples of org.apache.poi.poifs.property.PropertyTable

                                       header_block_reader.getXBATCount(),
                                       header_block_reader.getXBATIndex(),
                                       data_blocks);

        // get property table from the document
        PropertyTable properties =
            new PropertyTable(header_block_reader.getPropertyStart(),
                              data_blocks);

        // process documents
        processProperties(SmallBlockTableReader
            .getSmallDocumentBlocks(data_blocks, properties
                .getRoot(), header_block_reader
                    .getSBATStart()), data_blocks, properties.getRoot()
                        .getChildren(), new POIFSDocumentPath());
    }
View Full Code Here

Examples of org.apache.poi.poifs.property.PropertyTable

    /**
     * Constructor, intended for writing
     */
    public POIFSFileSystem()
    {
        _property_table = new PropertyTable();
        _documents      = new ArrayList();
        _root           = null;
    }
View Full Code Here

Examples of org.apache.poi.poifs.property.PropertyTable

                                       header_block_reader.getXBATCount(),
                                       header_block_reader.getXBATIndex(),
                                       data_blocks);

        // get property table from the document
        PropertyTable properties =
            new PropertyTable(header_block_reader.getPropertyStart(),
                              data_blocks);

        // init documents
        processProperties(
            SmallBlockTableReader.getSmallDocumentBlocks(
                data_blocks, properties.getRoot(),
                header_block_reader.getSBATStart()
            ),
            data_blocks,
            properties.getRoot().getChildren(),
            null,
            header_block_reader.getPropertyStart()
        );

        // For whatever reason CLSID of root is always 0.
        getRoot().setStorageClsid(properties.getRoot().getStorageClsid());
    }
View Full Code Here

Examples of org.eclipse.wb.internal.core.model.property.table.PropertyTable

  //
  // Animate in PropertyTable
  //
  ////////////////////////////////////////////////////////////////////////////
  public void test_withPropertyTable_selectFromDropDown() throws Exception {
    PropertyTable propertyTable = new PropertyTable(TEST_COMBO_SHELL, SWT.NONE);
    try {
      Property property = getStyleProperty("setStyleName('second')");
      PropertyEditor propertyEditor = property.getEditor();
      // activate
      propertyTable.setInput(new Property[]{property});
      propertyTable.setActiveProperty(property);
      propertyTable.activateEditor(property, null);
      CComboBox combo = (CComboBox) getFieldValue(propertyEditor, "m_combo");
      Text comboText = (Text) getFieldValue(combo, "m_text");
      Table comboTable = ((TableViewer) getFieldValue(combo, "m_table")).getTable();
      // has items
      assertEquals(3, combo.getItemCount());
      assertFalse(combo.isDroppedDown());
      // drop-down in async
      waitEventLoop(0);
      assertTrue(combo.isDroppedDown());
      // "second" selected
      assertEquals(1, comboTable.getSelectionIndex());
      // move selection up/down
      {
        EventSender eventSender = new EventSender(comboText);
        // 0
        eventSender.keyDown(SWT.ARROW_UP);
        assertEquals(0, comboTable.getSelectionIndex());
        // 2
        eventSender.keyDown(SWT.ARROW_UP);
        assertEquals(2, comboTable.getSelectionIndex());
        // 0
        eventSender.keyDown(SWT.ARROW_DOWN);
        assertEquals(0, comboTable.getSelectionIndex());
        // done
        eventSender.keyDown('\r');
      }
      // "first" was selected
      assertEditor(getStyleSource("setStyleName('first')"));
    } finally {
      propertyTable.dispose();
    }
  }
View Full Code Here

Examples of org.eclipse.wb.internal.core.model.property.table.PropertyTable

      propertyTable.dispose();
    }
  }

  public void test_withPropertyTable_useText() throws Exception {
    PropertyTable propertyTable = new PropertyTable(TEST_COMBO_SHELL, SWT.NONE);
    try {
      Property property = getStyleProperty("setStyleName('second')");
      PropertyEditor propertyEditor = property.getEditor();
      // activate
      propertyTable.setInput(new Property[]{property});
      propertyTable.setActiveProperty(property);
      propertyTable.activateEditor(property, null);
      CComboBox combo = (CComboBox) getFieldValue(propertyEditor, "m_combo");
      Text comboText = (Text) getFieldValue(combo, "m_text");
      EventSender eventSender = new EventSender(comboText);
      // has items
      assertEquals(3, combo.getItemCount());
      assertFalse(combo.isDroppedDown());
      // drop-down in async
      waitEventLoop(0);
      assertTrue(combo.isDroppedDown());
      // send ESC, close
      {
        eventSender.keyDown(SWT.ESC);
        assertFalse(combo.isDroppedDown());
      }
      // set text
      combo.setSelectionText("myStyle");
      // apply text
      eventSender.keyDown('\r');
      assertEditor(getStyleSource("setStyleName('myStyle')"));
    } finally {
      propertyTable.dispose();
    }
  }
View Full Code Here

Examples of org.eclipse.wb.internal.core.model.property.table.PropertyTable

      propertyTable.dispose();
    }
  }

  public void test_withPropertyTable_useEscape() throws Exception {
    PropertyTable propertyTable = new PropertyTable(TEST_COMBO_SHELL, SWT.NONE);
    try {
      Property property = getStyleProperty("setStyleName('second')");
      PropertyEditor propertyEditor = property.getEditor();
      // activate
      propertyTable.setInput(new Property[]{property});
      propertyTable.setActiveProperty(property);
      propertyTable.activateEditor(property, null);
      CComboBox combo = (CComboBox) getFieldValue(propertyEditor, "m_combo");
      Text comboText = (Text) getFieldValue(combo, "m_text");
      EventSender eventSender = new EventSender(comboText);
      // active
      assertSame(propertyEditor, propertyTable.forTests_getActiveEditor());
      // drop-down in async
      waitEventLoop(0);
      assertTrue(combo.isDroppedDown());
      // send ESC, close
      {
        eventSender.keyDown(SWT.ESC);
        assertFalse(combo.isDroppedDown());
      }
      // send ESC, deactivate
      {
        eventSender.keyDown(SWT.ESC);
        assertSame(null, propertyTable.forTests_getActiveEditor());
      }
    } finally {
      propertyTable.dispose();
    }
  }
View Full Code Here

Examples of org.eclipse.wb.internal.core.model.property.table.PropertyTable

  }

  public void test_withPropertyTable_quickSearch() throws Exception {
    dontUseSharedGWTState();
    setFileContent("war/Module.css", getSource(".aaa {}", ".bb1 {}", ".bb2 {}", ".ccc {}"));
    PropertyTable propertyTable = new PropertyTable(TEST_COMBO_SHELL, SWT.NONE);
    try {
      Property property = getStyleProperty(null);
      PropertyEditor propertyEditor = property.getEditor();
      // activate
      propertyTable.setInput(new Property[]{property});
      propertyTable.setActiveProperty(property);
      // send "b", activate editor
      new EventSender(propertyTable).keyDown(0, 'b');
      // prepare controls
      CComboBox combo = (CComboBox) getFieldValue(propertyEditor, "m_combo");
      Text comboText = (Text) getFieldValue(combo, "m_text");
      Table comboTable = ((TableViewer) getFieldValue(combo, "m_table")).getTable();
      EventSender eventSender = new EventSender(comboText);
      // drop-down in async
      waitEventLoop(0);
      assertTrue(combo.isDroppedDown());
      // state after sending "b"
      assertEquals(2, comboTable.getItemCount());
      assertEquals(-1, comboTable.getSelectionIndex());
      // send DOWN, select "bb2"
      {
        eventSender.keyDown(SWT.ARROW_DOWN);
        assertEquals(0, comboTable.getSelectionIndex());
        eventSender.keyDown(SWT.ARROW_DOWN);
        assertEquals(1, comboTable.getSelectionIndex());
      }
      // apply selection
      eventSender.keyDown('\r');
      assertEditor(getStyleSource("setStyleName('bb2')"));
    } finally {
      propertyTable.dispose();
    }
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.