author | Eugene Ostroukhov <eugeneo@symbian.org> |
Fri, 23 Apr 2010 15:44:39 -0700 | |
changeset 319 | 40387cc658b4 |
parent 301 | a908b05787d1 |
child 348 | 4cd68ab4c1f2 |
permissions | -rw-r--r-- |
39
eb7d9e33e288
Integration with previewer code
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
1 |
package org.symbian.tools.wrttools.previewer.preview; |
eb7d9e33e288
Integration with previewer code
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
2 |
|
eb7d9e33e288
Integration with previewer code
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
3 |
import java.io.BufferedOutputStream; |
eb7d9e33e288
Integration with previewer code
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
4 |
import java.io.File; |
eb7d9e33e288
Integration with previewer code
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
5 |
import java.io.FileInputStream; |
eb7d9e33e288
Integration with previewer code
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
6 |
import java.io.FileOutputStream; |
eb7d9e33e288
Integration with previewer code
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
7 |
import java.io.IOException; |
eb7d9e33e288
Integration with previewer code
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
8 |
import java.io.InputStream; |
eb7d9e33e288
Integration with previewer code
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
9 |
import java.io.OutputStream; |
eb7d9e33e288
Integration with previewer code
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
10 |
import java.util.Collection; |
eb7d9e33e288
Integration with previewer code
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
11 |
import java.util.HashMap; |
eb7d9e33e288
Integration with previewer code
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
12 |
import java.util.Map; |
eb7d9e33e288
Integration with previewer code
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
13 |
import java.util.Properties; |
eb7d9e33e288
Integration with previewer code
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
14 |
import java.util.Map.Entry; |
eb7d9e33e288
Integration with previewer code
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
15 |
|
eb7d9e33e288
Integration with previewer code
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
16 |
import org.eclipse.core.resources.IFile; |
eb7d9e33e288
Integration with previewer code
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
17 |
import org.eclipse.core.resources.IProject; |
eb7d9e33e288
Integration with previewer code
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
18 |
import org.eclipse.core.resources.IResource; |
eb7d9e33e288
Integration with previewer code
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
19 |
import org.eclipse.core.resources.IResourceChangeEvent; |
eb7d9e33e288
Integration with previewer code
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
20 |
import org.eclipse.core.resources.IResourceChangeListener; |
eb7d9e33e288
Integration with previewer code
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
21 |
import org.eclipse.core.resources.IWorkspaceRoot; |
eb7d9e33e288
Integration with previewer code
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
22 |
import org.eclipse.core.resources.ResourcesPlugin; |
301
a908b05787d1
Bug 2444 - Rename project creates bad state
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
300
diff
changeset
|
23 |
import org.eclipse.core.runtime.IPath; |
55
bb6160d0b6f2
Added fallback to default browser if platform is Mac or XULRunner is not available
Eugene Ostroukhov <eostroukhov@gmail.com>
parents:
54
diff
changeset
|
24 |
import org.eclipse.core.runtime.Platform; |
39
eb7d9e33e288
Integration with previewer code
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
25 |
import org.eclipse.jface.dialogs.IDialogConstants; |
eb7d9e33e288
Integration with previewer code
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
26 |
import org.eclipse.jface.dialogs.MessageDialogWithToggle; |
eb7d9e33e288
Integration with previewer code
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
27 |
import org.eclipse.jface.preference.IPreferenceStore; |
138
f66df1e99ba5
Fixed Bug 1886 - Prompt to autorefresh preview after first refresh request
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
105
diff
changeset
|
28 |
import org.eclipse.swt.SWT; |
39
eb7d9e33e288
Integration with previewer code
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
29 |
import org.eclipse.swt.widgets.Composite; |
eb7d9e33e288
Integration with previewer code
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
30 |
import org.eclipse.ui.IEditorPart; |
eb7d9e33e288
Integration with previewer code
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
31 |
import org.eclipse.ui.IWorkbenchPart; |
eb7d9e33e288
Integration with previewer code
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
32 |
import org.eclipse.ui.part.IPage; |
eb7d9e33e288
Integration with previewer code
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
33 |
import org.eclipse.ui.part.MessagePage; |
eb7d9e33e288
Integration with previewer code
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
34 |
import org.eclipse.ui.part.PageBook; |
eb7d9e33e288
Integration with previewer code
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
35 |
import org.eclipse.ui.part.PageBookView; |
eb7d9e33e288
Integration with previewer code
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
36 |
import org.symbian.tools.wrttools.previewer.IWrtEditingPreferences; |
84
b24e6a27768d
Integrating WRTKit libraries
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
82
diff
changeset
|
37 |
import org.symbian.tools.wrttools.previewer.PreviewerPlugin; |
54
5a2cfa9bc743
Nature is used for UI
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
45
diff
changeset
|
38 |
import org.symbian.tools.wrttools.util.ProjectUtils; |
39
eb7d9e33e288
Integration with previewer code
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
39 |
|
eb7d9e33e288
Integration with previewer code
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
40 |
public class PreviewView extends PageBookView { |
eb7d9e33e288
Integration with previewer code
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
41 |
private final IResourceChangeListener resourceListener = new IResourceChangeListener() { |
eb7d9e33e288
Integration with previewer code
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
42 |
public void resourceChanged(IResourceChangeEvent event) { |
82 | 43 |
if (event.getDelta() != null) { |
300
9505af44d7bf
Bug 2480 and bug 2430
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
155
diff
changeset
|
44 |
new RefreshJob(event.getDelta(), PreviewView.this).schedule(); |
39
eb7d9e33e288
Integration with previewer code
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
45 |
} |
eb7d9e33e288
Integration with previewer code
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
46 |
} |
eb7d9e33e288
Integration with previewer code
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
47 |
}; |
eb7d9e33e288
Integration with previewer code
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
48 |
|
300
9505af44d7bf
Bug 2480 and bug 2430
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
155
diff
changeset
|
49 |
private final Map<IProject, IPreviewPage> projectToPage = new HashMap<IProject, IPreviewPage>(); |
39
eb7d9e33e288
Integration with previewer code
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
50 |
private boolean preferencesLoaded = false; |
eb7d9e33e288
Integration with previewer code
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
51 |
private final Map<IProject, Boolean> autorefresh = new HashMap<IProject, Boolean>(); |
eb7d9e33e288
Integration with previewer code
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
52 |
|
eb7d9e33e288
Integration with previewer code
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
53 |
@Override |
eb7d9e33e288
Integration with previewer code
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
54 |
protected IPage createDefaultPage(PageBook book) { |
eb7d9e33e288
Integration with previewer code
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
55 |
MessagePage messagePage = new MessagePage(); |
eb7d9e33e288
Integration with previewer code
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
56 |
messagePage.setMessage("Open an editor to preview WRT widget"); |
eb7d9e33e288
Integration with previewer code
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
57 |
initPage(messagePage); |
eb7d9e33e288
Integration with previewer code
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
58 |
messagePage.createControl(book); |
eb7d9e33e288
Integration with previewer code
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
59 |
return messagePage; |
eb7d9e33e288
Integration with previewer code
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
60 |
} |
eb7d9e33e288
Integration with previewer code
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
61 |
|
eb7d9e33e288
Integration with previewer code
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
62 |
@Override |
eb7d9e33e288
Integration with previewer code
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
63 |
public void createPartControl(Composite parent) { |
eb7d9e33e288
Integration with previewer code
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
64 |
super.createPartControl(parent); |
eb7d9e33e288
Integration with previewer code
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
65 |
ResourcesPlugin.getWorkspace().addResourceChangeListener( |
eb7d9e33e288
Integration with previewer code
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
66 |
resourceListener); |
eb7d9e33e288
Integration with previewer code
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
67 |
} |
eb7d9e33e288
Integration with previewer code
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
68 |
|
eb7d9e33e288
Integration with previewer code
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
69 |
@Override |
eb7d9e33e288
Integration with previewer code
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
70 |
public void dispose() { |
eb7d9e33e288
Integration with previewer code
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
71 |
ResourcesPlugin.getWorkspace().removeResourceChangeListener( |
eb7d9e33e288
Integration with previewer code
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
72 |
resourceListener); |
eb7d9e33e288
Integration with previewer code
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
73 |
super.dispose(); |
eb7d9e33e288
Integration with previewer code
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
74 |
} |
eb7d9e33e288
Integration with previewer code
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
75 |
|
eb7d9e33e288
Integration with previewer code
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
76 |
@Override |
eb7d9e33e288
Integration with previewer code
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
77 |
protected PageRec doCreatePage(IWorkbenchPart part) { |
eb7d9e33e288
Integration with previewer code
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
78 |
// All checks we need were done in isImportant method |
eb7d9e33e288
Integration with previewer code
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
79 |
IResource resource = (IResource) ((IEditorPart) part).getEditorInput() |
eb7d9e33e288
Integration with previewer code
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
80 |
.getAdapter(IResource.class); |
eb7d9e33e288
Integration with previewer code
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
81 |
|
eb7d9e33e288
Integration with previewer code
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
82 |
IProject project = resource.getProject(); |
55
bb6160d0b6f2
Added fallback to default browser if platform is Mac or XULRunner is not available
Eugene Ostroukhov <eostroukhov@gmail.com>
parents:
54
diff
changeset
|
83 |
IPreviewPage page = projectToPage.get(project); |
39
eb7d9e33e288
Integration with previewer code
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
84 |
|
71
3b6f16a76732
More project templates were introduced. Several bugs were fixed.
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
56
diff
changeset
|
85 |
if (page == null || page.isDisposed()) { |
55
bb6160d0b6f2
Added fallback to default browser if platform is Mac or XULRunner is not available
Eugene Ostroukhov <eostroukhov@gmail.com>
parents:
54
diff
changeset
|
86 |
page = createPreviewPage(project); |
39
eb7d9e33e288
Integration with previewer code
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
87 |
initPage(page); |
eb7d9e33e288
Integration with previewer code
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
88 |
page.createControl(getPageBook()); |
eb7d9e33e288
Integration with previewer code
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
89 |
projectToPage.put(project, page); |
eb7d9e33e288
Integration with previewer code
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
90 |
} |
eb7d9e33e288
Integration with previewer code
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
91 |
|
eb7d9e33e288
Integration with previewer code
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
92 |
return new PageRec(part, page); |
eb7d9e33e288
Integration with previewer code
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
93 |
} |
eb7d9e33e288
Integration with previewer code
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
94 |
|
55
bb6160d0b6f2
Added fallback to default browser if platform is Mac or XULRunner is not available
Eugene Ostroukhov <eostroukhov@gmail.com>
parents:
54
diff
changeset
|
95 |
private IPreviewPage createPreviewPage(IProject project) { |
56
22f918ed49f7
Java5 is now supported
Eugene Ostroukhov <eostroukhov@gmail.com>
parents:
55
diff
changeset
|
96 |
if (Platform.getBundle(MozillaPreviewPage.XUL_RUNNER_BUNDLE) != null) { |
55
bb6160d0b6f2
Added fallback to default browser if platform is Mac or XULRunner is not available
Eugene Ostroukhov <eostroukhov@gmail.com>
parents:
54
diff
changeset
|
97 |
return new MozillaPreviewPage(project, this); |
bb6160d0b6f2
Added fallback to default browser if platform is Mac or XULRunner is not available
Eugene Ostroukhov <eostroukhov@gmail.com>
parents:
54
diff
changeset
|
98 |
} else { |
bb6160d0b6f2
Added fallback to default browser if platform is Mac or XULRunner is not available
Eugene Ostroukhov <eostroukhov@gmail.com>
parents:
54
diff
changeset
|
99 |
return new SwtBrowserPreviewPage(project, this); |
bb6160d0b6f2
Added fallback to default browser if platform is Mac or XULRunner is not available
Eugene Ostroukhov <eostroukhov@gmail.com>
parents:
54
diff
changeset
|
100 |
} |
bb6160d0b6f2
Added fallback to default browser if platform is Mac or XULRunner is not available
Eugene Ostroukhov <eostroukhov@gmail.com>
parents:
54
diff
changeset
|
101 |
} |
bb6160d0b6f2
Added fallback to default browser if platform is Mac or XULRunner is not available
Eugene Ostroukhov <eostroukhov@gmail.com>
parents:
54
diff
changeset
|
102 |
|
39
eb7d9e33e288
Integration with previewer code
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
103 |
@Override |
eb7d9e33e288
Integration with previewer code
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
104 |
protected void doDestroyPage(IWorkbenchPart part, PageRec pageRecord) { |
eb7d9e33e288
Integration with previewer code
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
105 |
// We do not need to delete the page |
eb7d9e33e288
Integration with previewer code
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
106 |
} |
eb7d9e33e288
Integration with previewer code
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
107 |
|
eb7d9e33e288
Integration with previewer code
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
108 |
@Override |
eb7d9e33e288
Integration with previewer code
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
109 |
protected IWorkbenchPart getBootstrapPart() { |
eb7d9e33e288
Integration with previewer code
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
110 |
IEditorPart activeEditor = getSite().getPage().getActiveEditor(); |
eb7d9e33e288
Integration with previewer code
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
111 |
if (activeEditor != null) { |
eb7d9e33e288
Integration with previewer code
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
112 |
if (isImportant(activeEditor)) { |
eb7d9e33e288
Integration with previewer code
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
113 |
return activeEditor; |
eb7d9e33e288
Integration with previewer code
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
114 |
} |
eb7d9e33e288
Integration with previewer code
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
115 |
} |
eb7d9e33e288
Integration with previewer code
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
116 |
return null; |
eb7d9e33e288
Integration with previewer code
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
117 |
} |
eb7d9e33e288
Integration with previewer code
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
118 |
|
eb7d9e33e288
Integration with previewer code
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
119 |
private boolean getDefaultAutorefresh(IProject project) { |
41
fc4a1d68260a
Preview is now feeded from the embedded HTML server
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
39
diff
changeset
|
120 |
IPreferenceStore preferenceStore = PreviewerPlugin.getDefault() |
39
eb7d9e33e288
Integration with previewer code
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
121 |
.getPreferenceStore(); |
eb7d9e33e288
Integration with previewer code
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
122 |
String value = preferenceStore |
eb7d9e33e288
Integration with previewer code
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
123 |
.getString(IWrtEditingPreferences.PREF_AUTO_REFRESH); |
138
f66df1e99ba5
Fixed Bug 1886 - Prompt to autorefresh preview after first refresh request
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
105
diff
changeset
|
124 |
boolean toggle = !MessageDialogWithToggle.NEVER.equals(value); |
f66df1e99ba5
Fixed Bug 1886 - Prompt to autorefresh preview after first refresh request
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
105
diff
changeset
|
125 |
if (MessageDialogWithToggle.NEVER.equals(value) |
f66df1e99ba5
Fixed Bug 1886 - Prompt to autorefresh preview after first refresh request
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
105
diff
changeset
|
126 |
|| MessageDialogWithToggle.ALWAYS.equals(value)) { |
f66df1e99ba5
Fixed Bug 1886 - Prompt to autorefresh preview after first refresh request
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
105
diff
changeset
|
127 |
setProjectAutorefresh(project, toggle); |
39
eb7d9e33e288
Integration with previewer code
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
128 |
} |
138
f66df1e99ba5
Fixed Bug 1886 - Prompt to autorefresh preview after first refresh request
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
105
diff
changeset
|
129 |
return toggle; |
39
eb7d9e33e288
Integration with previewer code
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
130 |
} |
eb7d9e33e288
Integration with previewer code
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
131 |
|
eb7d9e33e288
Integration with previewer code
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
132 |
private File getPreferencesFile() { |
41
fc4a1d68260a
Preview is now feeded from the embedded HTML server
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
39
diff
changeset
|
133 |
return PreviewerPlugin.getDefault().getStateLocation().append( |
39
eb7d9e33e288
Integration with previewer code
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
134 |
"autorefreshState.xml").toFile(); |
eb7d9e33e288
Integration with previewer code
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
135 |
} |
eb7d9e33e288
Integration with previewer code
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
136 |
|
eb7d9e33e288
Integration with previewer code
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
137 |
public boolean getProjectAutorefresh(IProject project) { |
eb7d9e33e288
Integration with previewer code
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
138 |
synchronized (autorefresh) { |
eb7d9e33e288
Integration with previewer code
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
139 |
loadPreferences(); |
eb7d9e33e288
Integration with previewer code
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
140 |
if (autorefresh.containsKey(project)) { |
eb7d9e33e288
Integration with previewer code
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
141 |
return autorefresh.get(project); |
eb7d9e33e288
Integration with previewer code
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
142 |
} else { |
eb7d9e33e288
Integration with previewer code
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
143 |
boolean value = getDefaultAutorefresh(project); |
eb7d9e33e288
Integration with previewer code
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
144 |
return value; |
eb7d9e33e288
Integration with previewer code
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
145 |
} |
eb7d9e33e288
Integration with previewer code
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
146 |
} |
eb7d9e33e288
Integration with previewer code
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
147 |
} |
eb7d9e33e288
Integration with previewer code
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
148 |
|
eb7d9e33e288
Integration with previewer code
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
149 |
@Override |
eb7d9e33e288
Integration with previewer code
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
150 |
protected boolean isImportant(IWorkbenchPart part) { |
eb7d9e33e288
Integration with previewer code
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
151 |
if (part instanceof IEditorPart) { |
eb7d9e33e288
Integration with previewer code
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
152 |
IResource resource = (IResource) ((IEditorPart) part) |
eb7d9e33e288
Integration with previewer code
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
153 |
.getEditorInput().getAdapter(IResource.class); |
eb7d9e33e288
Integration with previewer code
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
154 |
if (resource != null) { |
54
5a2cfa9bc743
Nature is used for UI
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
45
diff
changeset
|
155 |
return ProjectUtils.hasWrtNature(resource.getProject()); |
39
eb7d9e33e288
Integration with previewer code
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
156 |
} |
eb7d9e33e288
Integration with previewer code
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
157 |
} |
eb7d9e33e288
Integration with previewer code
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
158 |
return false; |
eb7d9e33e288
Integration with previewer code
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
159 |
} |
eb7d9e33e288
Integration with previewer code
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
160 |
|
eb7d9e33e288
Integration with previewer code
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
161 |
private void loadPreferences() { |
eb7d9e33e288
Integration with previewer code
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
162 |
synchronized (autorefresh) { |
eb7d9e33e288
Integration with previewer code
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
163 |
if (preferencesLoaded) { |
eb7d9e33e288
Integration with previewer code
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
164 |
return; |
eb7d9e33e288
Integration with previewer code
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
165 |
} |
eb7d9e33e288
Integration with previewer code
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
166 |
preferencesLoaded = true; |
eb7d9e33e288
Integration with previewer code
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
167 |
File preferencesFile = getPreferencesFile(); |
eb7d9e33e288
Integration with previewer code
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
168 |
Properties properties = new Properties(); |
eb7d9e33e288
Integration with previewer code
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
169 |
if (preferencesFile.exists()) { |
eb7d9e33e288
Integration with previewer code
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
170 |
InputStream inputStream = null; |
eb7d9e33e288
Integration with previewer code
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
171 |
try { |
eb7d9e33e288
Integration with previewer code
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
172 |
inputStream = new FileInputStream(preferencesFile); |
eb7d9e33e288
Integration with previewer code
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
173 |
properties.loadFromXML(inputStream); |
eb7d9e33e288
Integration with previewer code
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
174 |
} catch (IOException e) { |
41
fc4a1d68260a
Preview is now feeded from the embedded HTML server
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
39
diff
changeset
|
175 |
PreviewerPlugin.log(e); |
39
eb7d9e33e288
Integration with previewer code
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
176 |
} finally { |
eb7d9e33e288
Integration with previewer code
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
177 |
if (inputStream != null) { |
eb7d9e33e288
Integration with previewer code
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
178 |
try { |
eb7d9e33e288
Integration with previewer code
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
179 |
inputStream.close(); |
eb7d9e33e288
Integration with previewer code
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
180 |
} catch (IOException e) { |
41
fc4a1d68260a
Preview is now feeded from the embedded HTML server
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
39
diff
changeset
|
181 |
PreviewerPlugin.log(e); |
39
eb7d9e33e288
Integration with previewer code
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
182 |
} |
eb7d9e33e288
Integration with previewer code
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
183 |
} |
eb7d9e33e288
Integration with previewer code
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
184 |
} |
eb7d9e33e288
Integration with previewer code
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
185 |
IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot(); |
eb7d9e33e288
Integration with previewer code
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
186 |
for (Entry<Object, Object> entry : properties.entrySet()) { |
eb7d9e33e288
Integration with previewer code
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
187 |
String projectName = entry.getKey().toString(); |
eb7d9e33e288
Integration with previewer code
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
188 |
String value = entry.getValue().toString(); |
eb7d9e33e288
Integration with previewer code
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
189 |
IProject project = root.getProject(projectName); |
eb7d9e33e288
Integration with previewer code
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
190 |
if (project.exists()) { |
eb7d9e33e288
Integration with previewer code
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
191 |
autorefresh.put(project, Boolean.valueOf(value)); |
eb7d9e33e288
Integration with previewer code
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
192 |
} |
eb7d9e33e288
Integration with previewer code
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
193 |
} |
eb7d9e33e288
Integration with previewer code
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
194 |
} |
eb7d9e33e288
Integration with previewer code
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
195 |
} |
eb7d9e33e288
Integration with previewer code
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
196 |
} |
eb7d9e33e288
Integration with previewer code
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
197 |
|
eb7d9e33e288
Integration with previewer code
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
198 |
protected void refreshPages(Collection<IFile> files) { |
55
bb6160d0b6f2
Added fallback to default browser if platform is Mac or XULRunner is not available
Eugene Ostroukhov <eostroukhov@gmail.com>
parents:
54
diff
changeset
|
199 |
Collection<IPreviewPage> values = projectToPage.values(); |
bb6160d0b6f2
Added fallback to default browser if platform is Mac or XULRunner is not available
Eugene Ostroukhov <eostroukhov@gmail.com>
parents:
54
diff
changeset
|
200 |
for (IPreviewPage page : values) { |
39
eb7d9e33e288
Integration with previewer code
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
201 |
page.process(files); |
eb7d9e33e288
Integration with previewer code
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
202 |
} |
eb7d9e33e288
Integration with previewer code
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
203 |
} |
eb7d9e33e288
Integration with previewer code
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
204 |
|
eb7d9e33e288
Integration with previewer code
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
205 |
public void setProjectAutorefresh(IProject project, boolean refresh) { |
eb7d9e33e288
Integration with previewer code
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
206 |
synchronized (autorefresh) { |
eb7d9e33e288
Integration with previewer code
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
207 |
autorefresh.put(project, refresh); |
eb7d9e33e288
Integration with previewer code
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
208 |
Properties properties = new Properties(); |
eb7d9e33e288
Integration with previewer code
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
209 |
for (Entry<IProject, Boolean> entry : autorefresh.entrySet()) { |
eb7d9e33e288
Integration with previewer code
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
210 |
properties.setProperty(entry.getKey().getName(), entry |
eb7d9e33e288
Integration with previewer code
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
211 |
.getValue().toString()); |
eb7d9e33e288
Integration with previewer code
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
212 |
} |
eb7d9e33e288
Integration with previewer code
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
213 |
File path = getPreferencesFile(); |
eb7d9e33e288
Integration with previewer code
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
214 |
OutputStream outputStream = null; |
eb7d9e33e288
Integration with previewer code
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
215 |
try { |
eb7d9e33e288
Integration with previewer code
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
216 |
outputStream = new BufferedOutputStream(new FileOutputStream( |
eb7d9e33e288
Integration with previewer code
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
217 |
path)); |
eb7d9e33e288
Integration with previewer code
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
218 |
properties.storeToXML(outputStream, null); |
eb7d9e33e288
Integration with previewer code
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
219 |
} catch (IOException e) { |
41
fc4a1d68260a
Preview is now feeded from the embedded HTML server
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
39
diff
changeset
|
220 |
PreviewerPlugin.log(e); |
39
eb7d9e33e288
Integration with previewer code
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
221 |
} finally { |
eb7d9e33e288
Integration with previewer code
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
222 |
if (outputStream != null) { |
eb7d9e33e288
Integration with previewer code
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
223 |
try { |
eb7d9e33e288
Integration with previewer code
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
224 |
outputStream.close(); |
eb7d9e33e288
Integration with previewer code
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
225 |
} catch (IOException e) { |
41
fc4a1d68260a
Preview is now feeded from the embedded HTML server
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
39
diff
changeset
|
226 |
PreviewerPlugin.log(e); |
39
eb7d9e33e288
Integration with previewer code
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
227 |
} |
eb7d9e33e288
Integration with previewer code
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
228 |
} |
eb7d9e33e288
Integration with previewer code
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
229 |
} |
eb7d9e33e288
Integration with previewer code
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
230 |
} |
eb7d9e33e288
Integration with previewer code
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
231 |
} |
eb7d9e33e288
Integration with previewer code
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
232 |
|
138
f66df1e99ba5
Fixed Bug 1886 - Prompt to autorefresh preview after first refresh request
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
105
diff
changeset
|
233 |
public boolean promptUserToToggle(IProject project, boolean toggle) { |
f66df1e99ba5
Fixed Bug 1886 - Prompt to autorefresh preview after first refresh request
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
105
diff
changeset
|
234 |
IPreferenceStore preferenceStore = PreviewerPlugin.getDefault() |
f66df1e99ba5
Fixed Bug 1886 - Prompt to autorefresh preview after first refresh request
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
105
diff
changeset
|
235 |
.getPreferenceStore(); |
f66df1e99ba5
Fixed Bug 1886 - Prompt to autorefresh preview after first refresh request
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
105
diff
changeset
|
236 |
String value = preferenceStore |
f66df1e99ba5
Fixed Bug 1886 - Prompt to autorefresh preview after first refresh request
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
105
diff
changeset
|
237 |
.getString(IWrtEditingPreferences.PREF_AUTO_REFRESH); |
f66df1e99ba5
Fixed Bug 1886 - Prompt to autorefresh preview after first refresh request
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
105
diff
changeset
|
238 |
synchronized (autorefresh) { |
f66df1e99ba5
Fixed Bug 1886 - Prompt to autorefresh preview after first refresh request
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
105
diff
changeset
|
239 |
if (!autorefresh.containsKey(project)) { |
f66df1e99ba5
Fixed Bug 1886 - Prompt to autorefresh preview after first refresh request
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
105
diff
changeset
|
240 |
if (value == null || value.trim().length() == 0 |
f66df1e99ba5
Fixed Bug 1886 - Prompt to autorefresh preview after first refresh request
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
105
diff
changeset
|
241 |
|| MessageDialogWithToggle.PROMPT.equals(value)) { |
f66df1e99ba5
Fixed Bug 1886 - Prompt to autorefresh preview after first refresh request
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
105
diff
changeset
|
242 |
boolean setting = MessageDialogWithToggle |
f66df1e99ba5
Fixed Bug 1886 - Prompt to autorefresh preview after first refresh request
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
105
diff
changeset
|
243 |
.open( |
f66df1e99ba5
Fixed Bug 1886 - Prompt to autorefresh preview after first refresh request
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
105
diff
changeset
|
244 |
MessageDialogWithToggle.QUESTION, |
f66df1e99ba5
Fixed Bug 1886 - Prompt to autorefresh preview after first refresh request
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
105
diff
changeset
|
245 |
getSite().getShell(), |
f66df1e99ba5
Fixed Bug 1886 - Prompt to autorefresh preview after first refresh request
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
105
diff
changeset
|
246 |
"WRT Preview", |
155
9f61ecb49625
Fixed Bug 1903 - Text Update for Refresh popup (and some other messages)
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
138
diff
changeset
|
247 |
"The preview window can refresh (reinitialize and restart) whenever a project file is saved.\n" + |
9f61ecb49625
Fixed Bug 1903 - Text Update for Refresh popup (and some other messages)
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
138
diff
changeset
|
248 |
"This setting for each project can be toggled from the preview toolbar.\n\n" + |
9f61ecb49625
Fixed Bug 1903 - Text Update for Refresh popup (and some other messages)
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
138
diff
changeset
|
249 |
"Do you want to enable automatic refresh for this project?", |
9f61ecb49625
Fixed Bug 1903 - Text Update for Refresh popup (and some other messages)
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
138
diff
changeset
|
250 |
"Keep this setting for new projects", |
138
f66df1e99ba5
Fixed Bug 1886 - Prompt to autorefresh preview after first refresh request
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
105
diff
changeset
|
251 |
false, preferenceStore, |
f66df1e99ba5
Fixed Bug 1886 - Prompt to autorefresh preview after first refresh request
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
105
diff
changeset
|
252 |
IWrtEditingPreferences.PREF_AUTO_REFRESH, |
f66df1e99ba5
Fixed Bug 1886 - Prompt to autorefresh preview after first refresh request
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
105
diff
changeset
|
253 |
SWT.SHEET).getReturnCode() == IDialogConstants.YES_ID; |
f66df1e99ba5
Fixed Bug 1886 - Prompt to autorefresh preview after first refresh request
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
105
diff
changeset
|
254 |
setProjectAutorefresh(project, setting); |
f66df1e99ba5
Fixed Bug 1886 - Prompt to autorefresh preview after first refresh request
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
105
diff
changeset
|
255 |
return setting; |
f66df1e99ba5
Fixed Bug 1886 - Prompt to autorefresh preview after first refresh request
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
105
diff
changeset
|
256 |
} |
f66df1e99ba5
Fixed Bug 1886 - Prompt to autorefresh preview after first refresh request
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
105
diff
changeset
|
257 |
} |
f66df1e99ba5
Fixed Bug 1886 - Prompt to autorefresh preview after first refresh request
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
105
diff
changeset
|
258 |
} |
f66df1e99ba5
Fixed Bug 1886 - Prompt to autorefresh preview after first refresh request
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
105
diff
changeset
|
259 |
return toggle; |
f66df1e99ba5
Fixed Bug 1886 - Prompt to autorefresh preview after first refresh request
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
105
diff
changeset
|
260 |
} |
f66df1e99ba5
Fixed Bug 1886 - Prompt to autorefresh preview after first refresh request
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
105
diff
changeset
|
261 |
|
301
a908b05787d1
Bug 2444 - Rename project creates bad state
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
300
diff
changeset
|
262 |
public synchronized void projectRenamed(IProject project, IPath newPath) { |
a908b05787d1
Bug 2444 - Rename project creates bad state
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
300
diff
changeset
|
263 |
IPreviewPage page = projectToPage.remove(project); |
a908b05787d1
Bug 2444 - Rename project creates bad state
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
300
diff
changeset
|
264 |
Boolean refresh = autorefresh.remove(project); |
a908b05787d1
Bug 2444 - Rename project creates bad state
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
300
diff
changeset
|
265 |
page.projectRenamed(newPath); |
a908b05787d1
Bug 2444 - Rename project creates bad state
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
300
diff
changeset
|
266 |
projectToPage.put(page.getProject(), page); |
a908b05787d1
Bug 2444 - Rename project creates bad state
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
300
diff
changeset
|
267 |
autorefresh.put(page.getProject(), refresh); |
a908b05787d1
Bug 2444 - Rename project creates bad state
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
300
diff
changeset
|
268 |
} |
a908b05787d1
Bug 2444 - Rename project creates bad state
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
300
diff
changeset
|
269 |
|
39
eb7d9e33e288
Integration with previewer code
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff
changeset
|
270 |
} |