plugins/org.symbian.tools.tmw.previewer/src/org/symbian/tools/tmw/previewer/http/handlers/WorkspaceResourceProvider.java
author Eugene Ostroukhov <eugeneo@symbian.org>
Tue, 24 Aug 2010 17:21:16 -0700
changeset 478 6c07c755d0c7
parent 470 d4809db37847
child 479 518afa7c6d2f
permissions -rw-r--r--
PhoneGap template will use proper screen size
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
470
d4809db37847 Changed repository layout and renamed project files. This revision is untested and may not run.
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
     1
/**
d4809db37847 Changed repository layout and renamed project files. This revision is untested and may not run.
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
     2
 * Copyright (c) 2010 Symbian Foundation and/or its subsidiary(-ies).
d4809db37847 Changed repository layout and renamed project files. This revision is untested and may not run.
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
     3
 * All rights reserved.
d4809db37847 Changed repository layout and renamed project files. This revision is untested and may not run.
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
     4
 * This component and the accompanying materials are made available
d4809db37847 Changed repository layout and renamed project files. This revision is untested and may not run.
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
     5
 * under the terms of the License "Eclipse Public License v1.0"
d4809db37847 Changed repository layout and renamed project files. This revision is untested and may not run.
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
     6
 * which accompanies this distribution, and is available
d4809db37847 Changed repository layout and renamed project files. This revision is untested and may not run.
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
     7
 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
d4809db37847 Changed repository layout and renamed project files. This revision is untested and may not run.
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
     8
 *
d4809db37847 Changed repository layout and renamed project files. This revision is untested and may not run.
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
     9
 * Initial Contributors:
d4809db37847 Changed repository layout and renamed project files. This revision is untested and may not run.
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    10
 * Symbian Foundation - initial contribution.
d4809db37847 Changed repository layout and renamed project files. This revision is untested and may not run.
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    11
 * Contributors:
d4809db37847 Changed repository layout and renamed project files. This revision is untested and may not run.
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    12
 * Description:
d4809db37847 Changed repository layout and renamed project files. This revision is untested and may not run.
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    13
 * Overview:
d4809db37847 Changed repository layout and renamed project files. This revision is untested and may not run.
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    14
 * Details:
d4809db37847 Changed repository layout and renamed project files. This revision is untested and may not run.
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    15
 * Platforms/Drives/Compatibility:
d4809db37847 Changed repository layout and renamed project files. This revision is untested and may not run.
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    16
 * Assumptions/Requirement/Pre-requisites:
d4809db37847 Changed repository layout and renamed project files. This revision is untested and may not run.
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    17
 * Failures and causes:
d4809db37847 Changed repository layout and renamed project files. This revision is untested and may not run.
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    18
 */
d4809db37847 Changed repository layout and renamed project files. This revision is untested and may not run.
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    19
package org.symbian.tools.tmw.previewer.http.handlers;
d4809db37847 Changed repository layout and renamed project files. This revision is untested and may not run.
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    20
d4809db37847 Changed repository layout and renamed project files. This revision is untested and may not run.
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    21
import java.io.IOException;
d4809db37847 Changed repository layout and renamed project files. This revision is untested and may not run.
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    22
import java.io.InputStream;
d4809db37847 Changed repository layout and renamed project files. This revision is untested and may not run.
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    23
import java.util.Map;
d4809db37847 Changed repository layout and renamed project files. This revision is untested and may not run.
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    24
d4809db37847 Changed repository layout and renamed project files. This revision is untested and may not run.
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    25
import org.eclipse.core.resources.IProject;
d4809db37847 Changed repository layout and renamed project files. This revision is untested and may not run.
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    26
import org.eclipse.core.runtime.CoreException;
d4809db37847 Changed repository layout and renamed project files. This revision is untested and may not run.
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    27
import org.eclipse.core.runtime.IPath;
d4809db37847 Changed repository layout and renamed project files. This revision is untested and may not run.
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    28
import org.json.simple.JSONObject;
d4809db37847 Changed repository layout and renamed project files. This revision is untested and may not run.
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    29
import org.symbian.tools.tmw.previewer.PreviewerPlugin;
d4809db37847 Changed repository layout and renamed project files. This revision is untested and may not run.
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    30
d4809db37847 Changed repository layout and renamed project files. This revision is untested and may not run.
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    31
public class WorkspaceResourceProvider implements IResourceProvider {
d4809db37847 Changed repository layout and renamed project files. This revision is untested and may not run.
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    32
    public String[] getPaths() {
d4809db37847 Changed repository layout and renamed project files. This revision is untested and may not run.
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    33
        return null;
d4809db37847 Changed repository layout and renamed project files. This revision is untested and may not run.
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    34
    }
d4809db37847 Changed repository layout and renamed project files. This revision is untested and may not run.
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    35
d4809db37847 Changed repository layout and renamed project files. This revision is untested and may not run.
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    36
    public InputStream getResourceStream(IProject project, IPath resource, Map<String, String[]> parameters,
d4809db37847 Changed repository layout and renamed project files. This revision is untested and may not run.
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    37
            String sessionId) throws CoreException {
d4809db37847 Changed repository layout and renamed project files. This revision is untested and may not run.
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    38
        return PreviewerPlugin.getExtensionsManager().getLayoutProvider(project).getResourceFromPath(project, resource);
d4809db37847 Changed repository layout and renamed project files. This revision is untested and may not run.
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    39
    }
d4809db37847 Changed repository layout and renamed project files. This revision is untested and may not run.
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    40
d4809db37847 Changed repository layout and renamed project files. This revision is untested and may not run.
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    41
    public void post(IProject project, IPath resource, Map<String, String[]> parameterMap, JSONObject object,
d4809db37847 Changed repository layout and renamed project files. This revision is untested and may not run.
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    42
            String sessionId) throws IOException, CoreException {
d4809db37847 Changed repository layout and renamed project files. This revision is untested and may not run.
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    43
        // Do nothing
d4809db37847 Changed repository layout and renamed project files. This revision is untested and may not run.
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    44
    }
d4809db37847 Changed repository layout and renamed project files. This revision is untested and may not run.
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    45
}