Package com.google.gdata.data.spreadsheet

Examples of com.google.gdata.data.spreadsheet.SpreadsheetEntry


     */
    public String getColumnText(Object element, int columnIndex)
    {
      if (element instanceof SpreadsheetEntry)
      {
        SpreadsheetEntry spreadsheet = (SpreadsheetEntry)element;
       
        if (columnIndex == 0)
          return spreadsheet.getTitle().getPlainText();
        else if (columnIndex == 1)
          return ((Person)spreadsheet.getAuthors().get(0)).getEmail();
        else if (columnIndex == 2)
          return spreadsheet.getUpdated().toUiString();
      }
      else if (element instanceof DocumentListEntry)
      {
        DocumentListEntry entry = (DocumentListEntry)element;
       
View Full Code Here


  {
    DocsOpenDocDialog dialog = new DocsOpenDocDialog(window.getShell(), true);
   
    if (dialog.open() == Window.OK && dialog.getResultAsSpreadSheet() != null)
    {
      SpreadsheetEntry spreadsheet = dialog.getResultAsSpreadSheet();
     
      DocsEditorInput editorInput = new DocsEditorInput(spreadsheet);
     
      try
      {
        window.getActivePage().openEditor(editorInput, SpreadsheetEditor.EDITOR_ID, true, IWorkbenchPage.MATCH_INPUT);
      }
      catch (PartInitException exception)
      {
        ErrorDialog.openError(window.getShell(),
          "Error Opening Spreadsheet",
          "Unable to open " + spreadsheet.getTitle().getPlainText() + ".\n"
            + exception.toString(),
          new Status(IStatus.ERROR, DocsPlugin.PLUGIN_ID, exception.getMessage(), exception));
       
        DocsPlugin.log(exception);
      }     
View Full Code Here

  {
    DocsEditorInput editorInput = (DocsEditorInput)getEditorInput();
   
    if (editorInput.getSpreadsheet() != null)
    {
      SpreadsheetEntry spreadsheet = editorInput.getSpreadsheet();
     
      String href = spreadsheet.getSpreadsheetLink().getHref();
     
      if (!webBrowser.isDisposed())
        webBrowser.setURL(href);
    }
    else
View Full Code Here

    return new WorkbenchAdapter() {
      public ImageDescriptor getImageDescriptor(Object object) {
        return DocsPlugin.getImageDescriptor("icons/properties.gif");
      }
      public String getLabel(Object object) {
        SpreadsheetEntry spreadsheet = (SpreadsheetEntry)object;
       
        return spreadsheet.getTitle().getPlainText();
      }
    };
  }
View Full Code Here

    throws IOException, ServiceException
  {
    if (!isServiceInitialized())
      initializeService();
   
    SpreadsheetEntry spreadsheet = new SpreadsheetEntry();
   
    spreadsheet.setService(spreadsheetService);
    spreadsheet.setId(spreadsheetID);
   
    return (SpreadsheetEntry)spreadsheet.getSelf();
  }
View Full Code Here

  @Test
  public void runTest() throws Exception {

    String[] kinds = { "TestKind1" };
    SpreadsheetEntry ssEntry = SpreadsheetUtil.createSpreadsheet(authSubToken, kinds);
    try {
      Key controlKey =
        TaskQueueUtil.prepareRestoreControlKey("TestKind1", ssEntry.getKey(), authSubToken);

      ControllerTester tester = new ControllerTester();
      tester.request.setParameter("controlKey", KeyFactory.keyToString(controlKey));

      String run = tester.start("/tasks/restoreEnd");
View Full Code Here

    List<Entity> bulkData = TestDataUtil.bulkData("TestKind1", 5);
    DatastoreService datastore = DatastoreServiceFactory.getDatastoreService();
    datastore.put(bulkData);

    String[] kinds = { "TestKind1" };
    SpreadsheetEntry ssEntry = SpreadsheetUtil.createBlunkSpreadsheet(authSubToken, kinds);
    try {
      ControllerTester tester = new ControllerTester();
      Key controlKey =
        TaskQueueUtil.prepareDumpControlKey("TestKind1", ssEntry.getKey(), authSubToken);
      tester.request.setParameter("controlKey", KeyFactory.keyToString(controlKey));
      String run = tester.start("/tasks/dump");
      assertNull(run);

      LocalTaskQueue ltq = LocalTaskQueueTestConfig.getLocalTaskQueue();
View Full Code Here

    List<Entity> bulkData = TestDataUtil.bulkData("TestKind1", 10);
    DatastoreService datastore = DatastoreServiceFactory.getDatastoreService();
    datastore.put(bulkData);

    String[] kinds = { "TestKind1" };
    SpreadsheetEntry ssEntry = SpreadsheetUtil.createSpreadsheet(authSubToken, kinds);

    try {
      ControllerTester tester = new ControllerTester();
      Key controlKey =
        TaskQueueUtil.prepareDumpControlKey("TestKind1", ssEntry.getKey(), authSubToken);
      tester.request.setParameter("controlKey", KeyFactory.keyToString(controlKey));
      String run = tester.start("/tasks/dump");
      assertNull(run);

      LocalTaskQueue ltq = LocalTaskQueueTestConfig.getLocalTaskQueue();
View Full Code Here

  @Test
  public void runTest() throws Exception {

    String[] kinds = { "TestKind1" };
    SpreadsheetEntry ssEntry = SpreadsheetUtil.createSpreadsheet(authSubToken, kinds);
    try {
      Key controlKey =
        TaskQueueUtil.prepareDumpControlKey("TestKind1", ssEntry.getKey(), authSubToken);

      ControllerTester tester = new ControllerTester();
      tester.request.setParameter("controlKey", KeyFactory.keyToString(controlKey));

      String run = tester.start("/tasks/dumpEnd");
View Full Code Here

    final String[] kinds = { KIND_NAME };

    // Create Spreadsheet
    GbSpreadsheetService gss = new GbSpreadsheetService(authSubToken);
    SpreadsheetEntry spreadsheet = gss.createSpreadsheet(Arrays.asList(kinds));
    try {

      // Get Data from Datastore.
      final List<GbEntity> srcData = GbDatastoreService.getData(null, KIND_NAME, COUNT);

      // Dump Data to Spreadsheet.
      List<GbProperty> properties = GbDatastoreService.getProperties(KIND_NAME);
      final String tableId = gss.prepareWorksheet(spreadsheet.getKey(), KIND_NAME, properties);
      gss.dumpData(spreadsheet.getKey(), KIND_NAME, tableId, srcData, false);

      // (Retry) Dump Data to Spreadsheet.
      gss.dumpData(spreadsheet.getKey(), KIND_NAME, tableId, srcData, true);

      // Get Data from Spreadsheet
      final List<GbEntity> midData =
        gss.getDataOrNull(spreadsheet.getKey(), KIND_NAME, 3, COUNT);

      // Compare
      for (int i = 0; i < srcData.size(); i++) {
        final GbEntity src = srcData.get(i);
        for (int j = 0; j < midData.size(); j++) {
View Full Code Here

TOP

Related Classes of com.google.gdata.data.spreadsheet.SpreadsheetEntry

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.