Author: scabanovich
Date: 2009-10-06 09:47:35 -0400 (Tue, 06 Oct 2009)
New Revision: 17931
Added:
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/PalettePageImpl.java
Modified:
trunk/jst/plugins/org.jboss.tools.jst.jsp/META-INF/MANIFEST.MF
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/JSPMultiPageEditor.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-4976
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/META-INF/MANIFEST.MF
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/META-INF/MANIFEST.MF 2009-10-06 13:42:23 UTC
(rev 17930)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/META-INF/MANIFEST.MF 2009-10-06 13:47:35 UTC
(rev 17931)
@@ -31,6 +31,7 @@
Require-Bundle: org.jboss.tools.common.el.core,
org.jboss.tools.common.model.ui,
org.jboss.tools.jst.web,
+ org.eclipse.gef,
org.eclipse.jface.text,
org.eclipse.ui.workbench.texteditor,
org.eclipse.ui.ide,
Modified:
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/JSPMultiPageEditor.java
===================================================================
---
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/JSPMultiPageEditor.java 2009-10-06
13:42:23 UTC (rev 17930)
+++
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/JSPMultiPageEditor.java 2009-10-06
13:47:35 UTC (rev 17931)
@@ -25,6 +25,7 @@
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.QualifiedName;
+import org.eclipse.gef.ui.views.palette.PalettePage;
import org.eclipse.jface.action.IAction;
import org.eclipse.jface.action.IMenuListener;
import org.eclipse.jface.text.IRegion;
@@ -571,10 +572,22 @@
JspEditorPlugin.getPluginLog().logError(e);
}
}
+ if(palettePage != null) {
+ palettePage.dispose();
+ palettePage = null;
+ }
super.dispose();
}
+
+ PalettePageImpl palettePage;
public Object getAdapter(Class adapter) {
+ if(PalettePage.class == adapter) {
+ if(palettePage == null) {
+ palettePage = new PalettePageImpl();
+ }
+ return palettePage;
+ }
if (IContentOutlinePage.class.equals(adapter)) {
if (visualEditor != null) {
Added:
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/PalettePageImpl.java
===================================================================
---
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/PalettePageImpl.java
(rev 0)
+++
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/PalettePageImpl.java 2009-10-06
13:47:35 UTC (rev 17931)
@@ -0,0 +1,76 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at
http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.jst.jsp.jspeditor;
+
+import org.eclipse.gef.ui.views.palette.PalettePage;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.ui.IActionBars;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.part.IPageSite;
+import org.eclipse.ui.part.Page;
+import org.jboss.tools.common.model.XModelObject;
+import org.jboss.tools.common.model.ui.views.palette.IPalettePageAdapter;
+import org.jboss.tools.common.model.ui.views.palette.PaletteCreator;
+
+/**
+ *
+ * @author Viacheslav Kabanovich
+ *
+ */
+public class PalettePageImpl extends Page implements PalettePage, IPalettePageAdapter {
+ PaletteCreator paletteCreator = new PaletteCreator(this);
+
+ public PalettePageImpl() {}
+
+ public void init(IPageSite pageSite) {
+ super.init(pageSite);
+ paletteCreator.initActionBars();
+ }
+
+ public void createControl(Composite parent) {
+ paletteCreator.createPartControlImpl(parent);
+ }
+
+ public Control getControl() {
+ return paletteCreator.getControl();
+ }
+
+ public void setFocus() {
+ paletteCreator.setFocus();
+ }
+
+ public void insertIntoEditor(XModelObject macro) {
+ paletteCreator.insertIntoEditor(macro);
+ }
+
+ public void dispose() {
+ super.dispose();
+ paletteCreator.dispose();
+ }
+
+ public IActionBars getActionBars() {
+ return getSite() == null ? null : getSite().getActionBars();
+ }
+
+ public boolean isEnabled() {
+ return true;
+ }
+
+ public void setContentDescription(String description) {
+
+ }
+
+ public IWorkbenchPage getPage() {
+ return getSite().getPage();
+ }
+
+}
Property changes on:
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/PalettePageImpl.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain