author | Eugene Ostroukhov <eugeneo@symbian.org> |
Thu, 19 Aug 2010 16:13:44 -0700 | |
changeset 468 | a05c6e5cc7d9 |
parent 304 | d92630dec325 |
permissions | -rw-r--r-- |
300 | 1 |
/** |
2 |
* Copyright (c) 2010 Symbian Foundation and/or its subsidiary(-ies). |
|
3 |
* All rights reserved. |
|
4 |
* This component and the accompanying materials are made available |
|
5 |
* under the terms of the License "Eclipse Public License v1.0" |
|
6 |
* which accompanies this distribution, and is available |
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 |
* |
|
9 |
* Initial Contributors: |
|
10 |
* Symbian Foundation - initial contribution. |
|
11 |
* Contributors: |
|
12 |
* Description: |
|
13 |
* Overview: |
|
14 |
* Details: |
|
15 |
* Platforms/Drives/Compatibility: |
|
16 |
* Assumptions/Requirement/Pre-requisites: |
|
17 |
* Failures and causes: |
|
18 |
*/ |
|
19 |
package org.symbian.tools.wrttools.previewer.preview; |
|
20 |
||
301
a908b05787d1
Bug 2444 - Rename project creates bad state
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
300
diff
changeset
|
21 |
import java.util.Map.Entry; |
300 | 22 |
|
301
a908b05787d1
Bug 2444 - Rename project creates bad state
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
300
diff
changeset
|
23 |
import org.eclipse.core.resources.IProject; |
300 | 24 |
import org.eclipse.core.resources.IResourceDelta; |
25 |
import org.eclipse.core.resources.ResourcesPlugin; |
|
301
a908b05787d1
Bug 2444 - Rename project creates bad state
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
300
diff
changeset
|
26 |
import org.eclipse.core.runtime.IPath; |
300 | 27 |
import org.eclipse.core.runtime.IProgressMonitor; |
28 |
import org.eclipse.core.runtime.IStatus; |
|
29 |
import org.eclipse.core.runtime.Status; |
|
30 |
import org.eclipse.core.runtime.jobs.Job; |
|
468
a05c6e5cc7d9
Previewer now is TMWed (can support projects with different natures). Note: this commit does not compile. This previewer still only supports WRT libraries
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
304
diff
changeset
|
31 |
import org.symbian.tools.tmw.previewer.internal.PreviewerUtil; |
a05c6e5cc7d9
Previewer now is TMWed (can support projects with different natures). Note: this commit does not compile. This previewer still only supports WRT libraries
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
304
diff
changeset
|
32 |
import org.symbian.tools.tmw.previewer.internal.PreviewerUtil.ChangedResourcesCollector; |
300 | 33 |
|
34 |
public class RefreshJob extends Job { |
|
35 |
private final IResourceDelta delta; |
|
36 |
private final PreviewView view; |
|
37 |
||
38 |
public RefreshJob(IResourceDelta delta, PreviewView view) { |
|
39 |
super("Refresh preview browser"); |
|
40 |
this.delta = delta; |
|
41 |
this.view = view; |
|
42 |
setRule(ResourcesPlugin.getWorkspace().getRoot()); |
|
43 |
setSystem(true); |
|
44 |
} |
|
45 |
||
46 |
@Override |
|
47 |
protected IStatus run(IProgressMonitor monitor) { |
|
304
d92630dec325
Refactoring server-side preview code
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
303
diff
changeset
|
48 |
final ChangedResourcesCollector visitor = PreviewerUtil.collectResourceChanges(delta); |
301
a908b05787d1
Bug 2444 - Rename project creates bad state
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
300
diff
changeset
|
49 |
for (Entry<IProject, IPath> entry : visitor.renamed.entrySet()) { |
a908b05787d1
Bug 2444 - Rename project creates bad state
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
300
diff
changeset
|
50 |
view.projectRenamed(entry.getKey(), entry.getValue()); |
a908b05787d1
Bug 2444 - Rename project creates bad state
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
300
diff
changeset
|
51 |
} |
300 | 52 |
if (visitor.files.size() > 0) { |
53 |
view.refreshPages(visitor.files); |
|
54 |
} |
|
55 |
return Status.OK_STATUS; |
|
56 |
} |
|
57 |
||
58 |
} |