JBoss Tools SVN: r17936 - trunk/documentation/guides/GettingStartedGuide/en/modules.
by jbosstools-commits@lists.jboss.org
Author: smukhina
Date: 2009-10-06 11:23:42 -0400 (Tue, 06 Oct 2009)
New Revision: 17936
Modified:
trunk/documentation/guides/GettingStartedGuide/en/modules/first_seam.xml
trunk/documentation/guides/GettingStartedGuide/en/modules/jsp_application.xml
trunk/documentation/guides/GettingStartedGuide/en/modules/manage.xml
Log:
https://jira.jboss.org/jira/browse/JBDS-358 - making screenshots titles more informative - done - for GSG
Modified: trunk/documentation/guides/GettingStartedGuide/en/modules/first_seam.xml
===================================================================
--- trunk/documentation/guides/GettingStartedGuide/en/modules/first_seam.xml 2009-10-06 15:20:16 UTC (rev 17935)
+++ trunk/documentation/guides/GettingStartedGuide/en/modules/first_seam.xml 2009-10-06 15:23:42 UTC (rev 17936)
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="UTF-8"?>
+<?xml version="1.0" encoding="UTF-8"?>
<chapter id="first_seam" xreflabel="first_seam">
<?dbhtml filename="first_seam.html"?>
<chapterinfo>
@@ -872,7 +872,7 @@
logic that JPA supports.</para>
<figure>
- <title>The Results</title>
+ <title>The Hibernate Query Result</title>
<mediaobject>
<imageobject>
<imagedata fileref="images/first_seam/first_seam42.png"/>
@@ -966,7 +966,7 @@
RichFaces component.</para>
<figure>
- <title>RichFaces Component Inserting</title>
+ <title>Insert RichFaces Component from Context Menu</title>
<mediaobject>
<imageobject>
<imagedata fileref="images/first_seam/first_seam47.png" scale="85"/>
@@ -981,7 +981,7 @@
value="#{orderdetailsHome.instance.quantityordered}"/>]]></programlisting>
<figure>
- <title>Adding the Source</title>
+ <title>Manually coping Source Code</title>
<mediaobject>
<imageobject>
<imagedata fileref="images/first_seam/first_seam48.png"/>
Modified: trunk/documentation/guides/GettingStartedGuide/en/modules/jsp_application.xml
===================================================================
--- trunk/documentation/guides/GettingStartedGuide/en/modules/jsp_application.xml 2009-10-06 15:20:16 UTC (rev 17935)
+++ trunk/documentation/guides/GettingStartedGuide/en/modules/jsp_application.xml 2009-10-06 15:23:42 UTC (rev 17936)
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="UTF-8"?>
+<?xml version="1.0" encoding="UTF-8"?>
<chapter id="jsp_application" xreflabel="jsp_application">
<?dbhtml filename="jsp_application.html"?>
<chapterinfo>
@@ -161,7 +161,7 @@
<property>hello.jsp</property>
</emphasis> page should look like this:</para>
<figure>
- <title>Hello.jsp Page</title>
+ <title>Hello.jsp Page Source</title>
<mediaobject>
<imageobject>
<imagedata fileref="images/jsp_application/jsp_application_5.png"/>
Modified: trunk/documentation/guides/GettingStartedGuide/en/modules/manage.xml
===================================================================
--- trunk/documentation/guides/GettingStartedGuide/en/modules/manage.xml 2009-10-06 15:20:16 UTC (rev 17935)
+++ trunk/documentation/guides/GettingStartedGuide/en/modules/manage.xml 2009-10-06 15:23:42 UTC (rev 17936)
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="UTF-8"?>
+<?xml version="1.0" encoding="UTF-8"?>
<chapter id="manage" xreflabel="manage">
<?dbhtml filename="manage.html"?>
<chapterinfo>
@@ -35,12 +35,9 @@
<imagedata fileref="images/manage/eap5runtime.png"/>
</imageobject>
</mediaobject>
- </figure>
-
- <para>To read more
- about AS plug-in, refer to the <ulink url="&aslink;">Server Manager
- guide</ulink>.</para>
-
+ </figure>
+
+ <para>To read more about AS plug-in, refer to the <ulink url="&aslink;">Server Manager guide</ulink>.</para>
<section id="StartingServer">
<?dbhtml filename="StartingServer.html"?>
<title>Starting JBoss Server</title>
@@ -216,7 +213,7 @@
</listitem>
</itemizedlist>
<figure>
- <title>Selecting Server Type</title>
+ <title>Selecting Server Name and Server Type</title>
<mediaobject>
<imageobject>
<imagedata fileref="images/manage/manage_9.png"/>
@@ -271,7 +268,7 @@
</listitem>
</itemizedlist>
<figure>
- <title>Configuring Projects</title>
+ <title>JBoss Runtime Summary</title>
<mediaobject>
<imageobject>
<imagedata fileref="images/manage/manage_15.png"/>
15 years, 1 month
JBoss Tools SVN: r17934 - in trunk/birt/docs/en: modules and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: smukhina
Date: 2009-10-06 11:06:32 -0400 (Tue, 06 Oct 2009)
New Revision: 17934
Added:
trunk/birt/docs/en/images/birt_integration_with_seam/birtDeploymentSettings.png
Modified:
trunk/birt/docs/en/modules/birt_integration_with_seam.xml
trunk/birt/docs/en/modules/birt_reports_deployment.xml
Log:
https://jira.jboss.org/jira/browse/JBDS-728 BIRT Configuration: new page wisard is implemented - described
Added: trunk/birt/docs/en/images/birt_integration_with_seam/birtDeploymentSettings.png
===================================================================
(Binary files differ)
Property changes on: trunk/birt/docs/en/images/birt_integration_with_seam/birtDeploymentSettings.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Modified: trunk/birt/docs/en/modules/birt_integration_with_seam.xml
===================================================================
--- trunk/birt/docs/en/modules/birt_integration_with_seam.xml 2009-10-06 13:53:13 UTC (rev 17933)
+++ trunk/birt/docs/en/modules/birt_integration_with_seam.xml 2009-10-06 15:06:32 UTC (rev 17934)
@@ -83,8 +83,20 @@
</mediaobject>
</figure>
- <para>Next three pages are filled out with defaults, just leave them through by pressing <emphasis>
- <property>Next</property>.</emphasis> On the <emphasis>
+ <para>Next two pages are filled out with defaults, just leave them through by pressing <emphasis>
+ <property>Next</property>.</emphasis>
+On the <emphasis><property>Birt Configuration</property></emphasis> page you can modify BIRT Deployment Settings, which also defined in web.xml. Let's keep default values.</para>
+ <figure>
+ <title>Configuring BIRT Deployment Settings</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/birt_integration_with_seam/birtDeploymentSettings.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+ <para>Next page is also filled out with default values.
+ On the <emphasis>
<property>Seam Facet</property>
</emphasis> page you should specify the Seam runtime and Connection profile.</para>
Modified: trunk/birt/docs/en/modules/birt_reports_deployment.xml
===================================================================
--- trunk/birt/docs/en/modules/birt_reports_deployment.xml 2009-10-06 13:53:13 UTC (rev 17933)
+++ trunk/birt/docs/en/modules/birt_reports_deployment.xml 2009-10-06 15:06:32 UTC (rev 17934)
@@ -1,8 +1,7 @@
-
<?xml version='1.0' encoding='UTF-8'?>
<chapter id="birt_reports_deployment" xreflabel="birt_reports_deployment">
- <?dbhtml filename="birt_reports_deployment"?>
+ <?dbhtml filename="birt_reports_deployment.html"?>
<chapterinfo>
<keywordset>
<keyword>JBoss</keyword>
15 years, 1 month
JBoss Tools SVN: r17933 - trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2009-10-06 09:53:13 -0400 (Tue, 06 Oct 2009)
New Revision: 17933
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/WebDevelopmentPerspectiveFactory.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-4976
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/WebDevelopmentPerspectiveFactory.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/WebDevelopmentPerspectiveFactory.java 2009-10-06 13:51:50 UTC (rev 17932)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/WebDevelopmentPerspectiveFactory.java 2009-10-06 13:53:13 UTC (rev 17933)
@@ -47,7 +47,8 @@
bottom.addView("org.jboss.ide.eclipse.as.ui.views.JBossServerView"); //$NON-NLS-1$
IFolderLayout rightTop = layout.createFolder("right", IPageLayout.RIGHT, (float)0.8, editorArea); //$NON-NLS-1$
- rightTop.addView("org.jboss.tools.common.model.ui.views.palette.PaletteView"); //$NON-NLS-1$
+// rightTop.addView("org.jboss.tools.common.model.ui.views.palette.PaletteView"); //$NON-NLS-1$
+ rightTop.addView("org.eclipse.gef.ui.palette_view"); //$NON-NLS-1$
IFolderLayout rightBottom = layout.createFolder("rightBottom", IPageLayout.BOTTOM, (float)0.64, "right"); //$NON-NLS-1$ //$NON-NLS-2$
rightBottom.addView(IPageLayout.ID_OUTLINE);
15 years, 1 month
JBoss Tools SVN: r17932 - trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2009-10-06 09:51:50 -0400 (Tue, 06 Oct 2009)
New Revision: 17932
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/SeamPerspectiveFactory.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-4976
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/SeamPerspectiveFactory.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/SeamPerspectiveFactory.java 2009-10-06 13:47:35 UTC (rev 17931)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/SeamPerspectiveFactory.java 2009-10-06 13:51:50 UTC (rev 17932)
@@ -37,7 +37,8 @@
bottom.addPlaceholder(WTP_SERVERS_VIEW);
IFolderLayout rightTop = layout.createFolder("right", IPageLayout.RIGHT, (float)0.8, editorArea); //$NON-NLS-1$
- rightTop.addView("org.jboss.tools.common.model.ui.views.palette.PaletteView"); //$NON-NLS-1$
+// rightTop.addView("org.jboss.tools.common.model.ui.views.palette.PaletteView"); //$NON-NLS-1$
+ rightTop.addView("org.eclipse.gef.ui.palette_view"); //$NON-NLS-1$
IFolderLayout rightBottom = layout.createFolder("rightBottom", IPageLayout.BOTTOM, (float)0.64, "right"); //$NON-NLS-1$ //$NON-NLS-2$
rightBottom.addView(IPageLayout.ID_OUTLINE);
15 years, 1 month
JBoss Tools SVN: r17931 - in trunk/jst/plugins/org.jboss.tools.jst.jsp: src/org/jboss/tools/jst/jsp/jspeditor and 1 other directory.
by jbosstools-commits@lists.jboss.org
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
15 years, 1 month
JBoss Tools SVN: r17930 - trunk/vpe/plugins/org.jboss.tools.vpe.ui.palette/src/org/jboss/tools/vpe/ui/palette.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2009-10-06 09:42:23 -0400 (Tue, 06 Oct 2009)
New Revision: 17930
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe.ui.palette/src/org/jboss/tools/vpe/ui/palette/PaletteAdapter.java
trunk/vpe/plugins/org.jboss.tools.vpe.ui.palette/src/org/jboss/tools/vpe/ui/palette/PaletteViewer.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-4976
Modified: trunk/vpe/plugins/org.jboss.tools.vpe.ui.palette/src/org/jboss/tools/vpe/ui/palette/PaletteAdapter.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe.ui.palette/src/org/jboss/tools/vpe/ui/palette/PaletteAdapter.java 2009-10-06 13:41:44 UTC (rev 17929)
+++ trunk/vpe/plugins/org.jboss.tools.vpe.ui.palette/src/org/jboss/tools/vpe/ui/palette/PaletteAdapter.java 2009-10-06 13:42:23 UTC (rev 17930)
@@ -25,6 +25,7 @@
import org.jboss.tools.common.model.util.EclipseResourceUtil;
import org.jboss.tools.common.model.ui.ModelUIPlugin;
import org.jboss.tools.common.model.ui.views.palette.IPaletteAdapter;
+import org.jboss.tools.common.model.ui.views.palette.IPalettePageAdapter;
import org.jboss.tools.common.model.ui.views.palette.PaletteContents;
import org.jboss.tools.common.model.ui.views.palette.PaletteViewPart;
import org.jboss.tools.vpe.ui.palette.model.PaletteModel;
@@ -35,7 +36,7 @@
private static final URL BASE_URL = EclipseResourceUtil.getInstallURL(Platform.getBundle(ModelUIPlugin.PLUGIN_ID));
private static final String IMAGE_PATH = "images/xstudio/palette/"; //$NON-NLS-1$
- private PaletteViewPart viewPart = null;
+ private IPalettePageAdapter viewPart = null;
private PaletteModel model = null;
private PaletteViewer viewer = null;
private Control palette = null;
@@ -44,10 +45,19 @@
private PaletteModelListener modelListener = null;
private PaletteContents paletteContents;
- public void setPaletteViewPart(PaletteViewPart viewPart) {
+ public void setPaletteViewPart(IPalettePageAdapter viewPart) {
this.viewPart = viewPart;
}
-
+
+ public void initActionBars() {
+ IActionBars bars = viewPart.getActionBars();
+ if(bars != null) {
+ bars.getToolBarManager().add(new PaletteEditAction());
+ bars.getToolBarManager().add(new ShowHideTabsAction());
+ bars.getToolBarManager().add(new ImportTLDAction());
+ }
+ }
+
public Control createControl(Composite root) {
model = PaletteModel.getInstance(paletteContents);
viewer = new PaletteViewer(viewPart);
@@ -57,11 +67,8 @@
PaletteRoot paletteRoot = model.getPaletteRoot();
viewer.setPaletteRoot(paletteRoot);
- IActionBars bars = viewPart.getViewSite().getActionBars();
- bars.getToolBarManager().add(new PaletteEditAction());
- bars.getToolBarManager().add(new ShowHideTabsAction());
- bars.getToolBarManager().add(new ImportTLDAction());
-
+// initActionBars();
+
descriptionManager = new DescriptionManager(viewer);
descriptionManager.install(palette);
@@ -86,7 +93,7 @@
model.removeModelTreeListener(modelListener);
dropManager.dispose();
descriptionManager.dispose();
- viewPart.getViewSite().getActionBars().getToolBarManager().removeAll();
+ viewPart.getActionBars().getToolBarManager().removeAll();
viewer = null;
viewPart = null;
}
@@ -206,4 +213,6 @@
return (modelObject.getPath() + "/").startsWith(root.getPath() + "/"); //$NON-NLS-1$ //$NON-NLS-2$
}
}
+
+
}
Modified: trunk/vpe/plugins/org.jboss.tools.vpe.ui.palette/src/org/jboss/tools/vpe/ui/palette/PaletteViewer.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe.ui.palette/src/org/jboss/tools/vpe/ui/palette/PaletteViewer.java 2009-10-06 13:41:44 UTC (rev 17929)
+++ trunk/vpe/plugins/org.jboss.tools.vpe.ui.palette/src/org/jboss/tools/vpe/ui/palette/PaletteViewer.java 2009-10-06 13:42:23 UTC (rev 17930)
@@ -23,18 +23,19 @@
import org.eclipse.swt.dnd.TextTransfer;
import org.eclipse.swt.dnd.Transfer;
+import org.jboss.tools.common.model.ui.views.palette.IPalettePageAdapter;
import org.jboss.tools.common.model.ui.views.palette.PaletteViewPart;
import org.jboss.tools.vpe.ui.palette.model.PaletteItem;
public class PaletteViewer extends org.eclipse.gef.ui.palette.PaletteViewer {
- private PaletteViewPart viewPart;
+ private IPalettePageAdapter viewPart;
PaletteDragSourceListener listener;
static Transfer[] transferTypes = new Transfer[] {
TextTransfer.getInstance(),ModelTransfer.getInstance() };
- public PaletteViewer(PaletteViewPart viewPart) {
+ public PaletteViewer(IPalettePageAdapter viewPart) {
this.viewPart = viewPart;
setEditPartFactory(new CustomPaletteEditPartFactory());
}
15 years, 1 month
JBoss Tools SVN: r17929 - trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/views/palette.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2009-10-06 09:41:44 -0400 (Tue, 06 Oct 2009)
New Revision: 17929
Added:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/views/palette/IPalettePageAdapter.java
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/views/palette/PaletteCreator.java
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/views/palette/IPaletteAdapter.java
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/views/palette/PaletteAdapter.java
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/views/palette/PaletteViewPart.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-4976
Modified: trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/views/palette/IPaletteAdapter.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/views/palette/IPaletteAdapter.java 2009-10-06 13:33:22 UTC (rev 17928)
+++ trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/views/palette/IPaletteAdapter.java 2009-10-06 13:41:44 UTC (rev 17929)
@@ -14,8 +14,9 @@
import org.eclipse.swt.widgets.Control;
public interface IPaletteAdapter {
- void setPaletteViewPart(PaletteViewPart viewPart);
- Control createControl(Composite composite);
+ public void setPaletteViewPart(IPalettePageAdapter viewPart);
+ public Control createControl(Composite composite);
+ public void initActionBars();
void setEnabled(boolean enabled);
void dispose();
void setPaletteContents(PaletteContents contents);
Added: trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/views/palette/IPalettePageAdapter.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/views/palette/IPalettePageAdapter.java (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/views/palette/IPalettePageAdapter.java 2009-10-06 13:41:44 UTC (rev 17929)
@@ -0,0 +1,28 @@
+/*******************************************************************************
+ * 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.common.model.ui.views.palette;
+
+import org.eclipse.ui.IActionBars;
+import org.eclipse.ui.IWorkbenchPage;
+import org.jboss.tools.common.model.XModelObject;
+
+/**
+ *
+ * @author Viacheslav Kabanovich
+ *
+ */
+public interface IPalettePageAdapter {
+ public IActionBars getActionBars();
+ public void insertIntoEditor(XModelObject macro);
+ public boolean isEnabled();
+ public void setContentDescription(String description);
+ public IWorkbenchPage getPage();
+}
Property changes on: trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/views/palette/IPalettePageAdapter.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/views/palette/PaletteAdapter.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/views/palette/PaletteAdapter.java 2009-10-06 13:33:22 UTC (rev 17928)
+++ trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/views/palette/PaletteAdapter.java 2009-10-06 13:41:44 UTC (rev 17929)
@@ -58,7 +58,7 @@
public class PaletteAdapter implements IPaletteAdapter {
private static final int TEXT_MARGIN = 4;
- private PaletteViewPart viewPart = null;
+ private IPalettePageAdapter viewPart = null;
private PaletteModel model = null;
private ScrolledComposite pane = null;
private PaletteModelListener modelListener = null;
@@ -69,10 +69,31 @@
private String selectedTab = null;
private boolean fWindowsFlag;
- public void setPaletteViewPart(PaletteViewPart viewPart) {
+ public void setPaletteViewPart(IPalettePageAdapter viewPart) {
this.viewPart = viewPart;
}
+ public void initActionBars() {
+ IActionBars bars = viewPart.getActionBars();
+ if(bars != null) {
+ IMenuManager menuManager = bars.getMenuManager();
+
+ bars.getToolBarManager().add(new PaletteEditAction());
+ bars.getToolBarManager().add(new ShowHideTabsAction());
+ if (selectedTab != null) {
+ ActionContributionItem item = (ActionContributionItem)menuManager.find(selectedTab);
+ if (item != null) {
+ item.getAction().run();
+ }
+ } else {
+ IContributionItem[] actions = menuManager.getItems();
+ if (actions.length > 0 && (actions[0] instanceof ActionContributionItem)) {
+ ((ActionContributionItem)actions[0]).getAction().run();
+ }
+ }
+ }
+ }
+
public Control createControl(Composite composite) {
String osName = System.getProperty("os.name"); //$NON-NLS-1$
fWindowsFlag = osName != null && osName.toUpperCase().indexOf("WINDOWS") != -1; //$NON-NLS-1$
@@ -94,31 +115,16 @@
model = PaletteModel.getInstance();
createPaletteTabs();
- IActionBars bars = viewPart.getViewSite().getActionBars();
- IMenuManager menuManager = bars.getMenuManager();
+// initActionBars();
- bars.getToolBarManager().add(new PaletteEditAction());
- bars.getToolBarManager().add(new ShowHideTabsAction());
-
modelListener = new PaletteModelListener();
model.addModelTreeListener(modelListener);
- if (selectedTab != null) {
- ActionContributionItem item = (ActionContributionItem)menuManager.find(selectedTab);
- if (item != null) {
- item.getAction().run();
- }
- } else {
- IContributionItem[] actions = menuManager.getItems();
- if (actions.length > 0 && (actions[0] instanceof ActionContributionItem)) {
- ((ActionContributionItem)actions[0]).getAction().run();
- }
- }
return pane;
}
private void createPaletteTabs() {
- IActionBars bars = viewPart.getViewSite().getActionBars();
+ IActionBars bars = viewPart.getActionBars();
IMenuManager menuManager = bars.getMenuManager();
IPaletteNode root = model.getRoot();
IPaletteNode[] nodes = root.getChildren();
@@ -193,7 +199,7 @@
private void reload(XModelObject xtab) {
model.reload();
- IActionBars bars = viewPart.getViewSite().getActionBars();
+ IActionBars bars = viewPart.getActionBars();
IMenuManager menuManager = bars.getMenuManager();
String oldTitle = null;
@@ -252,14 +258,14 @@
oldTabs[i].dispose();
}
- setEnabled(viewPart.idEnabled());
+ setEnabled(viewPart.isEnabled());
}
public void dispose() {
dropManager.dispose();
descriptionManager.dispose();
model.removeModelTreeListener(modelListener);
- viewPart.getViewSite().getActionBars().getToolBarManager().removeAll();
+ viewPart.getActionBars().getToolBarManager().removeAll();
try {
if (selectedTab != null) {
ModelUIPlugin.getWorkspace().getRoot().setPersistentProperty(persistentTabQualifiedName, selectedTab);
Added: trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/views/palette/PaletteCreator.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/views/palette/PaletteCreator.java (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/views/palette/PaletteCreator.java 2009-10-06 13:41:44 UTC (rev 17929)
@@ -0,0 +1,249 @@
+/*******************************************************************************
+ * 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.common.model.ui.views.palette;
+
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.util.Properties;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.FillLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.part.MultiPageEditorPart;
+import org.eclipse.ui.texteditor.ITextEditor;
+import org.osgi.framework.Bundle;
+
+import org.jboss.tools.common.meta.action.SpecialWizard;
+import org.jboss.tools.common.meta.action.SpecialWizardFactory;
+import org.jboss.tools.common.meta.action.XActionInvoker;
+import org.jboss.tools.common.model.XModelObject;
+import org.jboss.tools.common.model.ui.ModelUIPlugin;
+import org.jboss.tools.common.model.ui.dnd.ModelTransfer;
+import org.jboss.tools.common.model.ui.editor.EditorPartWrapper;
+
+public class PaletteCreator {
+
+ public static final String PALETTE_GEF_ID = "org.jboss.tools.vpe.ui.palette"; //$NON-NLS-1$
+
+ IPalettePageAdapter palettePage;
+
+ private IPaletteAdapter paletteAdapter = null;
+ private Composite root = null;
+ private Control palette = null;
+ private IWorkbenchPart lastPart = null;
+ private boolean lastPaletteEnabled = false;
+
+ public PaletteCreator(IPalettePageAdapter palettePage) {
+ this.palettePage = palettePage;
+ }
+
+ public void createPartControlImpl(Composite parent) {
+ paletteAdapter = createPaletteAdapter();
+ paletteAdapter.setPaletteContents(null);
+ paletteAdapter.setPaletteViewPart(palettePage);
+ root = new Composite(parent, SWT.NONE);
+ root.setLayout(new FillLayout());
+ palette = paletteAdapter.createControl(root);
+ }
+
+ public void initActionBars() {
+ paletteAdapter.initActionBars();
+ }
+
+ public Control getControl() {
+ return root;
+ }
+
+ private IPaletteAdapter createPaletteAdapter() {
+ try {
+ Bundle b = Platform.getBundle(PALETTE_GEF_ID);
+ Class cls = b == null ? null : b.loadClass("org.jboss.tools.vpe.ui.palette.PaletteAdapter"); //$NON-NLS-1$
+ if(cls != null) return (IPaletteAdapter)cls.newInstance();
+ } catch (ClassNotFoundException t) {
+ //ignore
+ } catch (InstantiationException e) {
+ //ignore
+ } catch (IllegalAccessException e) {
+ //ignore
+ }
+ return new PaletteAdapter();
+ }
+
+ public void dispose() {
+ if (palette != null) {
+ if (!palette.isDisposed())
+ palette.dispose();
+ palette = null;
+ }
+ if (root != null) {
+ if (!root.isDisposed())
+ root.dispose();
+ root = null;
+ }
+ //TODO
+// getSite().getPage().removePartListener(this);
+ if (paletteAdapter != null)
+ paletteAdapter.dispose();
+ paletteAdapter = null;
+ }
+
+ public void setFocus() {
+ if(palette != null && !palette.isDisposed()) palette.setFocus();
+ }
+
+ public void partActivated(IWorkbenchPart part) {
+ IEditorPart part1 = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
+ if (part1 instanceof IEditorPart) {
+ paletteAdapter.setPaletteContents(new PaletteContents((IEditorPart)part1));
+ lastPaletteEnabled = true;
+ paletteAdapter.setEnabled(lastPaletteEnabled);
+ lastPart = part1;
+ } else {
+ paletteAdapter.setEnabled(false);
+ }
+
+ }
+
+ public void partClosed(IWorkbenchPart part) {
+ if (lastPart != null && palettePage.getPage().getActiveEditor() != lastPart) {
+ lastPart = null;
+ paletteAdapter.setPaletteContents(new PaletteContents(null));
+ paletteAdapter.setEnabled(lastPaletteEnabled = false);
+ }
+ }
+
+ public void insertIntoEditor(XModelObject macro) {
+ IWorkbenchPage page = palettePage.getPage();
+ IEditorPart part = page.getActiveEditor();
+ if (part == null) return;
+ ITextEditor editor = getActiveTextEditor(part);
+
+ /// It is not a text editor
+ if(editor == null) return;
+ /// Do we need a warning here?
+ if(!editor.isEditable()) return;
+
+ if(dropIntoEditor(editor, macro)) return;
+ if(dropIntoEditor2(editor, macro)) return;
+
+ //TODO implement a service
+/**
+ String tagname = macro.getAttributeValue("name"); //$NON-NLS-1$
+ String startText = "" + macro.getAttributeValue("start text"); //$NON-NLS-1$ //$NON-NLS-2$
+ String endText = "" + macro.getAttributeValue("end text"); //$NON-NLS-1$ //$NON-NLS-2$
+ String newline = "" + macro.getAttributeValue("new line"); //$NON-NLS-1$ //$NON-NLS-2$
+ String reformat = "" + macro.getAttributeValue("automatically reformat tag body"); //$NON-NLS-1$ //$NON-NLS-2$
+ XModelObject parent = macro.getParent();
+ String uri = (parent == null) ? "" : parent.getAttributeValue(URIConstants.LIBRARY_URI); //$NON-NLS-1$
+ String libraryVersion = (parent == null) ? "" : parent.getAttributeValue(URIConstants.LIBRARY_VERSION); //$NON-NLS-1$
+ String defaultPrefix = (parent == null) ? "" : parent.getAttributeValue(URIConstants.DEFAULT_PREFIX); //$NON-NLS-1$
+ String addTaglib = (parent == null) ? "" : parent.getAttributeValue("add taglib"); //$NON-NLS-1$ //$NON-NLS-2$
+ if (editor != null) {
+ Properties properties = new Properties();
+ properties.setProperty(PaletteInsertHelper.PROPOPERTY_TAG_NAME, tagname);
+ properties.setProperty(PaletteInsertHelper.PROPOPERTY_TAGLIBRARY_URI, uri);
+ properties.setProperty(PaletteInsertHelper.PROPOPERTY_TAGLIBRARY_VERSION, libraryVersion);
+ properties.setProperty(PaletteInsertHelper.PROPOPERTY_DEFAULT_PREFIX, defaultPrefix);
+
+ if(startText != null) properties.setProperty(PaletteInsertHelper.PROPOPERTY_START_TEXT, startText);
+ if(endText != null) properties.setProperty(PaletteInsertHelper.PROPOPERTY_END_TEXT, endText);
+ properties.setProperty(PaletteInsertHelper.PROPOPERTY_REFORMAT_BODY, reformat);
+ properties.setProperty(PaletteInsertHelper.PROPOPERTY_NEW_LINE, newline);
+ properties.setProperty(PaletteInsertHelper.PROPOPERTY_ADD_TAGLIB, addTaglib);
+
+ //TODO WARNING we cannot have here correct insert helper instance!
+ PaletteInsertHelper.getInstance().insertIntoEditor(
+ editor,
+ properties
+ );
+ page.activate(part);
+ }
+*/
+ }
+
+ private boolean dropIntoEditor(ITextEditor editor, XModelObject macro) {
+ try {
+ Method m = editor.getClass().getMethod("runDropCommand", new Class[]{String.class, String.class}); //$NON-NLS-1$
+ if(m == null) return false;
+ m.setAccessible(true);
+ Properties p = new Properties();
+ p.setProperty("isDrag", "true"); //$NON-NLS-1$ //$NON-NLS-2$
+ XActionInvoker.invoke("CopyActions.Copy", macro, p); //$NON-NLS-1$
+ m.invoke(editor, new Object[]{ModelTransfer.MODEL, null});
+ return true;
+ } catch (NoSuchMethodException ne) {
+ return false;
+ } catch (IllegalAccessException e) {
+ ModelUIPlugin.getPluginLog().logError(e);
+ return false;
+ } catch (IllegalArgumentException e) {
+ ModelUIPlugin.getPluginLog().logError(e);
+ return false;
+ } catch (InvocationTargetException e) {
+ ModelUIPlugin.getPluginLog().logError(e);
+ return false;
+ }
+ }
+ private boolean dropIntoEditor2(ITextEditor editor, XModelObject macro) {
+ SpecialWizard w = SpecialWizardFactory.createSpecialWizard("org.jboss.tools.jst.jsp.outline.DefaultDropCommandRunner"); //$NON-NLS-1$
+ if(w == null) return false;
+ Properties p = new Properties();
+ p.setProperty("isDrag", "true"); //$NON-NLS-1$ //$NON-NLS-2$
+ XActionInvoker.invoke("CopyActions.Copy", macro, p); //$NON-NLS-1$
+ p.setProperty("flavor", ModelTransfer.MODEL); //$NON-NLS-1$
+ p.put("textEditor", editor); //$NON-NLS-1$
+ w.setObject(p);
+ int r = w.execute();
+ return r == 0;
+ }
+
+ public boolean isEnabled() {
+ return lastPart != null; //lastTextEditor != null;
+ }
+
+ // TODO: NLS support
+ private static final String ERROR_GETTING_ACTIVE_EDITOR = "Error while getting active text editor";
+
+ // FIXME: Rewrite without reflection
+ private ITextEditor getActiveTextEditor(IWorkbenchPart part) {
+ ITextEditor editor = null;
+ if (part instanceof EditorPartWrapper) {
+ part = ((EditorPartWrapper)part).getEditor();
+ }
+ if (part instanceof ITextEditor) {
+ editor = (ITextEditor)part;
+ } else if (part instanceof MultiPageEditorPart) {
+ try {
+ Method m = MultiPageEditorPart.class.getDeclaredMethod("getActiveEditor", new Class[0]); //$NON-NLS-1$
+ m.setAccessible(true);
+ Object o = m.invoke(part, new Object[0]);
+ if (o instanceof ITextEditor) {
+ editor = (ITextEditor)o;
+ }
+ } catch (NoSuchMethodException t) {
+ ModelUIPlugin.getPluginLog().logError(ERROR_GETTING_ACTIVE_EDITOR, t);
+ } catch (IllegalArgumentException t) {
+ ModelUIPlugin.getPluginLog().logError(ERROR_GETTING_ACTIVE_EDITOR, t);
+ } catch (IllegalAccessException t) {
+ ModelUIPlugin.getPluginLog().logError(ERROR_GETTING_ACTIVE_EDITOR, t);
+ } catch (InvocationTargetException t) {
+ ModelUIPlugin.getPluginLog().logError(ERROR_GETTING_ACTIVE_EDITOR, t);
+ }
+ }
+ return editor;
+ }
+
+}
Property changes on: trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/views/palette/PaletteCreator.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/views/palette/PaletteViewPart.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/views/palette/PaletteViewPart.java 2009-10-06 13:33:22 UTC (rev 17928)
+++ trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/views/palette/PaletteViewPart.java 2009-10-06 13:41:44 UTC (rev 17929)
@@ -10,119 +10,55 @@
******************************************************************************/
package org.jboss.tools.common.model.ui.views.palette;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-import java.util.Properties;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IActionBars;
import org.eclipse.ui.IPartListener;
import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.part.MultiPageEditorPart;
import org.eclipse.ui.part.ViewPart;
-import org.eclipse.ui.texteditor.ITextEditor;
-import org.osgi.framework.Bundle;
-import org.jboss.tools.common.meta.action.SpecialWizard;
-import org.jboss.tools.common.meta.action.SpecialWizardFactory;
-import org.jboss.tools.common.meta.action.XActionInvoker;
import org.jboss.tools.common.model.XModelObject;
-import org.jboss.tools.common.model.ui.ModelUIPlugin;
-import org.jboss.tools.common.model.ui.dnd.ModelTransfer;
-import org.jboss.tools.common.model.ui.editor.EditorPartWrapper;
-public class PaletteViewPart extends ViewPart implements IPartListener {
+public class PaletteViewPart extends ViewPart implements IPartListener, IPalettePageAdapter {
public static final String VIEW_ID = "org.jboss.tools.common.model.ui.views.palette.PaletteView"; //$NON-NLS-1$
- public static final String PALETTE_GEF_ID = "org.jboss.tools.vpe.ui.palette"; //$NON-NLS-1$
- private IPaletteAdapter paletteAdapter = null;
- private Composite root = null;
- private Control palette = null;
- private IWorkbenchPart lastPart = null;
- private boolean lastPaletteEnabled = false;
+ PaletteCreator paletteCreator = new PaletteCreator(this);
+ public PaletteViewPart() {}
+
+ public IWorkbenchPage getPage() {
+ return getSite().getPage();
+ }
+
public void createPartControl(Composite parent) {
- createPartControlImpl(parent);
+ paletteCreator.createPartControlImpl(parent);
+ paletteCreator.initActionBars();
}
- protected void setContentDescription(String description) {
+ public void setContentDescription(String description) {
super.setContentDescription(description);
}
- private void createPartControlImpl(Composite parent) {
- paletteAdapter = createPaletteAdapter();
- paletteAdapter.setPaletteContents(null);
- paletteAdapter.setPaletteViewPart(this);
- root = new Composite(parent, SWT.NONE);
- root.setLayout(new FillLayout());
- palette = paletteAdapter.createControl(root);
- }
-
- private IPaletteAdapter createPaletteAdapter() {
- try {
- Bundle b = Platform.getBundle(PALETTE_GEF_ID);
- Class cls = b == null ? null : b.loadClass("org.jboss.tools.vpe.ui.palette.PaletteAdapter"); //$NON-NLS-1$
- if(cls != null) return (IPaletteAdapter)cls.newInstance();
- } catch (ClassNotFoundException t) {
- //ignore
- } catch (InstantiationException e) {
- //ignore
- } catch (IllegalAccessException e) {
- //ignore
- }
- return new PaletteAdapter();
- }
-
public void dispose() {
super.dispose();
- if (palette != null) {
- if (!palette.isDisposed())
- palette.dispose();
- palette = null;
- }
- if (root != null) {
- if (!root.isDisposed())
- root.dispose();
- root = null;
- }
+ paletteCreator.dispose();
getSite().getPage().removePartListener(this);
- if (paletteAdapter != null)
- paletteAdapter.dispose();
- paletteAdapter = null;
}
public void setFocus() {
- if(palette != null && !palette.isDisposed()) palette.setFocus();
+ paletteCreator.setFocus();
}
public void partActivated(IWorkbenchPart part) {
- IEditorPart part1 = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
- if (part1 instanceof IEditorPart) {
- paletteAdapter.setPaletteContents(new PaletteContents((IEditorPart)part1));
- lastPaletteEnabled = true;
- paletteAdapter.setEnabled(lastPaletteEnabled);
- lastPart = part1;
- } else {
- paletteAdapter.setEnabled(false);
- }
-
+ paletteCreator.partActivated(part);
}
public void partBroughtToTop(IWorkbenchPart part) {
}
public void partClosed(IWorkbenchPart part) {
- if (lastPart != null && getSite().getPage().getActiveEditor() != lastPart) {
- lastPart = null;
- paletteAdapter.setPaletteContents(new PaletteContents(null));
- paletteAdapter.setEnabled(lastPaletteEnabled = false);
- }
+ paletteCreator.partClosed(part);
}
public void partDeactivated(IWorkbenchPart part) {}
@@ -130,124 +66,15 @@
public void partOpened(IWorkbenchPart part) {}
public void insertIntoEditor(XModelObject macro) {
- IWorkbenchPage page = getSite().getPage();
- IEditorPart part = page.getActiveEditor();
- if (part == null) return;
- ITextEditor editor = getActiveTextEditor(part);
-
- /// It is not a text editor
- if(editor == null) return;
- /// Do we need a warning here?
- if(!editor.isEditable()) return;
-
- if(dropIntoEditor(editor, macro)) return;
- if(dropIntoEditor2(editor, macro)) return;
-
- //TODO implement a service
-/**
- String tagname = macro.getAttributeValue("name"); //$NON-NLS-1$
- String startText = "" + macro.getAttributeValue("start text"); //$NON-NLS-1$ //$NON-NLS-2$
- String endText = "" + macro.getAttributeValue("end text"); //$NON-NLS-1$ //$NON-NLS-2$
- String newline = "" + macro.getAttributeValue("new line"); //$NON-NLS-1$ //$NON-NLS-2$
- String reformat = "" + macro.getAttributeValue("automatically reformat tag body"); //$NON-NLS-1$ //$NON-NLS-2$
- XModelObject parent = macro.getParent();
- String uri = (parent == null) ? "" : parent.getAttributeValue(URIConstants.LIBRARY_URI); //$NON-NLS-1$
- String libraryVersion = (parent == null) ? "" : parent.getAttributeValue(URIConstants.LIBRARY_VERSION); //$NON-NLS-1$
- String defaultPrefix = (parent == null) ? "" : parent.getAttributeValue(URIConstants.DEFAULT_PREFIX); //$NON-NLS-1$
- String addTaglib = (parent == null) ? "" : parent.getAttributeValue("add taglib"); //$NON-NLS-1$ //$NON-NLS-2$
- if (editor != null) {
- Properties properties = new Properties();
- properties.setProperty(PaletteInsertHelper.PROPOPERTY_TAG_NAME, tagname);
- properties.setProperty(PaletteInsertHelper.PROPOPERTY_TAGLIBRARY_URI, uri);
- properties.setProperty(PaletteInsertHelper.PROPOPERTY_TAGLIBRARY_VERSION, libraryVersion);
- properties.setProperty(PaletteInsertHelper.PROPOPERTY_DEFAULT_PREFIX, defaultPrefix);
-
- if(startText != null) properties.setProperty(PaletteInsertHelper.PROPOPERTY_START_TEXT, startText);
- if(endText != null) properties.setProperty(PaletteInsertHelper.PROPOPERTY_END_TEXT, endText);
- properties.setProperty(PaletteInsertHelper.PROPOPERTY_REFORMAT_BODY, reformat);
- properties.setProperty(PaletteInsertHelper.PROPOPERTY_NEW_LINE, newline);
- properties.setProperty(PaletteInsertHelper.PROPOPERTY_ADD_TAGLIB, addTaglib);
-
- //TODO WARNING we cannot have here correct insert helper instance!
- PaletteInsertHelper.getInstance().insertIntoEditor(
- editor,
- properties
- );
- page.activate(part);
- }
-*/
+ paletteCreator.insertIntoEditor(macro);
}
- private boolean dropIntoEditor(ITextEditor editor, XModelObject macro) {
- try {
- Method m = editor.getClass().getMethod("runDropCommand", new Class[]{String.class, String.class}); //$NON-NLS-1$
- if(m == null) return false;
- m.setAccessible(true);
- Properties p = new Properties();
- p.setProperty("isDrag", "true"); //$NON-NLS-1$ //$NON-NLS-2$
- XActionInvoker.invoke("CopyActions.Copy", macro, p); //$NON-NLS-1$
- m.invoke(editor, new Object[]{ModelTransfer.MODEL, null});
- return true;
- } catch (NoSuchMethodException ne) {
- return false;
- } catch (IllegalAccessException e) {
- ModelUIPlugin.getPluginLog().logError(e);
- return false;
- } catch (IllegalArgumentException e) {
- ModelUIPlugin.getPluginLog().logError(e);
- return false;
- } catch (InvocationTargetException e) {
- ModelUIPlugin.getPluginLog().logError(e);
- return false;
- }
+ public boolean isEnabled() {
+ return paletteCreator.isEnabled();
}
- private boolean dropIntoEditor2(ITextEditor editor, XModelObject macro) {
- SpecialWizard w = SpecialWizardFactory.createSpecialWizard("org.jboss.tools.jst.jsp.outline.DefaultDropCommandRunner"); //$NON-NLS-1$
- if(w == null) return false;
- Properties p = new Properties();
- p.setProperty("isDrag", "true"); //$NON-NLS-1$ //$NON-NLS-2$
- XActionInvoker.invoke("CopyActions.Copy", macro, p); //$NON-NLS-1$
- p.setProperty("flavor", ModelTransfer.MODEL); //$NON-NLS-1$
- p.put("textEditor", editor); //$NON-NLS-1$
- w.setObject(p);
- int r = w.execute();
- return r == 0;
- }
- public boolean idEnabled() {
- return lastPart != null; //lastTextEditor != null;
+ public IActionBars getActionBars() {
+ return getViewSite() == null ? null : getViewSite().getActionBars();
}
- // TODO: NLS support
- private static final String ERROR_GETTING_ACTIVE_EDITOR = "Error while getting active text editor";
-
- // FIXME: Rewrite without reflection
- private ITextEditor getActiveTextEditor(IWorkbenchPart part) {
- ITextEditor editor = null;
- if (part instanceof EditorPartWrapper) {
- part = ((EditorPartWrapper)part).getEditor();
- }
- if (part instanceof ITextEditor) {
- editor = (ITextEditor)part;
- } else if (part instanceof MultiPageEditorPart) {
- try {
- Method m = MultiPageEditorPart.class.getDeclaredMethod("getActiveEditor", new Class[0]); //$NON-NLS-1$
- m.setAccessible(true);
- Object o = m.invoke(part, new Object[0]);
- if (o instanceof ITextEditor) {
- editor = (ITextEditor)o;
- }
- } catch (NoSuchMethodException t) {
- ModelUIPlugin.getPluginLog().logError(ERROR_GETTING_ACTIVE_EDITOR, t);
- } catch (IllegalArgumentException t) {
- ModelUIPlugin.getPluginLog().logError(ERROR_GETTING_ACTIVE_EDITOR, t);
- } catch (IllegalAccessException t) {
- ModelUIPlugin.getPluginLog().logError(ERROR_GETTING_ACTIVE_EDITOR, t);
- } catch (InvocationTargetException t) {
- ModelUIPlugin.getPluginLog().logError(ERROR_GETTING_ACTIVE_EDITOR, t);
- }
- }
- return editor;
- }
-
}
15 years, 1 month
JBoss Tools SVN: r17928 - trunk/jsf/docs/userguide/en/images/editors_features.
by jbosstools-commits@lists.jboss.org
Author: ochikvina
Date: 2009-10-06 09:33:22 -0400 (Tue, 06 Oct 2009)
New Revision: 17928
Removed:
trunk/jsf/docs/userguide/en/images/editors_features/editors_features_16.png
trunk/jsf/docs/userguide/en/images/editors_features/editors_features_17.png
trunk/jsf/docs/userguide/en/images/editors_features/editors_features_18.png
trunk/jsf/docs/userguide/en/images/editors_features/editors_features_19.png
Log:
https://jira.jboss.org/jira/browse/JBDS-498 - deleting unused image;
Deleted: trunk/jsf/docs/userguide/en/images/editors_features/editors_features_16.png
===================================================================
(Binary files differ)
Deleted: trunk/jsf/docs/userguide/en/images/editors_features/editors_features_17.png
===================================================================
(Binary files differ)
Deleted: trunk/jsf/docs/userguide/en/images/editors_features/editors_features_18.png
===================================================================
(Binary files differ)
Deleted: trunk/jsf/docs/userguide/en/images/editors_features/editors_features_19.png
===================================================================
(Binary files differ)
15 years, 1 month
JBoss Tools SVN: r17927 - trunk/jsf/docs/userguide/en/images/preferences.
by jbosstools-commits@lists.jboss.org
Author: ochikvina
Date: 2009-10-06 09:23:14 -0400 (Tue, 06 Oct 2009)
New Revision: 17927
Removed:
trunk/jsf/docs/userguide/en/images/preferences/preferences_3.png
trunk/jsf/docs/userguide/en/images/preferences/preferences_4.png
trunk/jsf/docs/userguide/en/images/preferences/preferences_5.png
Log:
https://jira.jboss.org/jira/browse/JBDS-498 - deleting unused image;
Deleted: trunk/jsf/docs/userguide/en/images/preferences/preferences_3.png
===================================================================
(Binary files differ)
Deleted: trunk/jsf/docs/userguide/en/images/preferences/preferences_4.png
===================================================================
(Binary files differ)
Deleted: trunk/jsf/docs/userguide/en/images/preferences/preferences_5.png
===================================================================
(Binary files differ)
15 years, 1 month