org.symbian.tools.wrttools.previewer/src/org/symbian/tools/wrttools/previewer/preview/PreviewView.java
equal
deleted
inserted
replaced
34 import org.eclipse.ui.part.MessagePage; |
34 import org.eclipse.ui.part.MessagePage; |
35 import org.eclipse.ui.part.PageBook; |
35 import org.eclipse.ui.part.PageBook; |
36 import org.eclipse.ui.part.PageBookView; |
36 import org.eclipse.ui.part.PageBookView; |
37 import org.symbian.tools.wrttools.previewer.PreviewerPlugin; |
37 import org.symbian.tools.wrttools.previewer.PreviewerPlugin; |
38 import org.symbian.tools.wrttools.previewer.IWrtEditingPreferences; |
38 import org.symbian.tools.wrttools.previewer.IWrtEditingPreferences; |
|
39 import org.symbian.tools.wrttools.util.ProjectUtils; |
39 |
40 |
40 public class PreviewView extends PageBookView { |
41 public class PreviewView extends PageBookView { |
41 private static final class ChangedResourcesCollector implements |
42 private static final class ChangedResourcesCollector implements |
42 IResourceDeltaVisitor { |
43 IResourceDeltaVisitor { |
43 public final Collection<IFile> files = new HashSet<IFile>(); |
44 public final Collection<IFile> files = new HashSet<IFile>(); |
174 protected boolean isImportant(IWorkbenchPart part) { |
175 protected boolean isImportant(IWorkbenchPart part) { |
175 if (part instanceof IEditorPart) { |
176 if (part instanceof IEditorPart) { |
176 IResource resource = (IResource) ((IEditorPart) part) |
177 IResource resource = (IResource) ((IEditorPart) part) |
177 .getEditorInput().getAdapter(IResource.class); |
178 .getEditorInput().getAdapter(IResource.class); |
178 if (resource != null) { |
179 if (resource != null) { |
179 return isWrtProject(resource.getProject()); |
180 return ProjectUtils.hasWrtNature(resource.getProject()); |
180 } |
181 } |
181 } |
182 } |
182 return false; |
183 return false; |
183 } |
|
184 |
|
185 private boolean isWrtProject(IProject project) { |
|
186 return project.getFile("wrt_preview_frame.html").exists(); |
|
187 } |
184 } |
188 |
185 |
189 private void loadPreferences() { |
186 private void loadPreferences() { |
190 synchronized (autorefresh) { |
187 synchronized (autorefresh) { |
191 if (preferencesLoaded) { |
188 if (preferencesLoaded) { |