JBoss Tools SVN: r37010 - in trunk: common/plugins/org.jboss.tools.common.ui/src/org/jboss/tools/common/ui and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: max.andersen(a)jboss.com
Date: 2011-12-06 14:23:30 -0500 (Tue, 06 Dec 2011)
New Revision: 37010
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/launch/JBTWebLaunchableClient.java
trunk/common/plugins/org.jboss.tools.common.ui/src/org/jboss/tools/common/ui/BrowserUtil.java
Log:
JBIDE-10365 make both common and as browser open actually open with addresssbar
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/launch/JBTWebLaunchableClient.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/launch/JBTWebLaunchableClient.java 2011-12-06 19:11:24 UTC (rev 37009)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/launch/JBTWebLaunchableClient.java 2011-12-06 19:23:30 UTC (rev 37010)
@@ -275,7 +275,7 @@
private static final String BROWSER_COULD_NOT_OPEN_BROWSER = "Unable to open web browser"; //$NON-NLS-1$
public static void checkedCreateInternalBrowser(String url, String browserId, String pluginId, ILog log) {
try {
- openUrl(url, PlatformUI.getWorkbench().getBrowserSupport().createBrowser(browserId), pluginId, log);
+ openUrl(url, PlatformUI.getWorkbench().getBrowserSupport().createBrowser(IWorkbenchBrowserSupport.LOCATION_BAR | IWorkbenchBrowserSupport.NAVIGATION_BAR, browserId, null, null), pluginId, log);
} catch (PartInitException e) {
IStatus errorStatus = createErrorStatus(pluginId, BROWSER_COULD_NOT_OPEN_BROWSER, e, url);
log.log(errorStatus);
Modified: trunk/common/plugins/org.jboss.tools.common.ui/src/org/jboss/tools/common/ui/BrowserUtil.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.ui/src/org/jboss/tools/common/ui/BrowserUtil.java 2011-12-06 19:11:24 UTC (rev 37009)
+++ trunk/common/plugins/org.jboss.tools.common.ui/src/org/jboss/tools/common/ui/BrowserUtil.java 2011-12-06 19:23:30 UTC (rev 37010)
@@ -20,6 +20,7 @@
import org.eclipse.ui.PartInitException;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.browser.IWebBrowser;
+import org.eclipse.ui.browser.IWorkbenchBrowserSupport;
/**
* @author Andre Dietisheim
@@ -41,7 +42,7 @@
*/
public static void checkedCreateInternalBrowser(String url, String browserId, String pluginId, ILog log) {
try {
- openUrl(url, PlatformUI.getWorkbench().getBrowserSupport().createBrowser(browserId), pluginId, log);
+ openUrl(url, PlatformUI.getWorkbench().getBrowserSupport().createBrowser(IWorkbenchBrowserSupport.LOCATION_BAR | IWorkbenchBrowserSupport.NAVIGATION_BAR, browserId, null, null), pluginId, log);
} catch (PartInitException e) {
IStatus errorStatus = createErrorStatus(pluginId, CommonUIMessages.BROWSER_COULD_NOT_OPEN_BROWSER, e, url);
log.log(errorStatus);
14 years
JBoss Tools SVN: r37009 - in trunk/forge/plugins/org.jboss.tools.forge.ui: src/org/jboss/tools/forge/ui/action and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: koen.aers(a)jboss.com
Date: 2011-12-06 14:11:24 -0500 (Tue, 06 Dec 2011)
New Revision: 37009
Added:
trunk/forge/plugins/org.jboss.tools.forge.ui/src/org/jboss/tools/forge/ui/action/ShowInForgeDelegate.java
Modified:
trunk/forge/plugins/org.jboss.tools.forge.ui/plugin.xml
trunk/forge/plugins/org.jboss.tools.forge.ui/src/org/jboss/tools/forge/ui/action/StartDelegate.java
trunk/forge/plugins/org.jboss.tools.forge.ui/src/org/jboss/tools/forge/ui/console/ForgeCommandFilter.java
trunk/forge/plugins/org.jboss.tools.forge.ui/src/org/jboss/tools/forge/ui/console/ForgeTextViewer.java
trunk/forge/plugins/org.jboss.tools.forge.ui/src/org/jboss/tools/forge/ui/console/PickUpPostProcessor.java
trunk/forge/plugins/org.jboss.tools.forge.ui/src/org/jboss/tools/forge/ui/part/ForgeView.java
Log:
JBIDE-10269: Implement "Show In Forge" for Workspace Selections
Modified: trunk/forge/plugins/org.jboss.tools.forge.ui/plugin.xml
===================================================================
--- trunk/forge/plugins/org.jboss.tools.forge.ui/plugin.xml 2011-12-06 18:56:41 UTC (rev 37008)
+++ trunk/forge/plugins/org.jboss.tools.forge.ui/plugin.xml 2011-12-06 19:11:24 UTC (rev 37009)
@@ -32,7 +32,7 @@
id="org.jboss.tools.forge.menubar"
label="Forge">
</menu>
-<!-- <action
+ <action
class="org.jboss.tools.forge.ui.action.StopDelegate"
icon="icons/stop.gif"
id="org.jboss.tools.forge.stop"
@@ -49,21 +49,12 @@
menubarPath="org.jboss.tools.forge.menu"
style="push"
toolbarPath="org.jboss.tools.forge.toolbar">
- </action> -->
- <action
- class="org.jboss.tools.forge.ui.action.StopDelegate"
- icon="icons/stop.gif"
- id="org.jboss.tools.forge.stop"
- label="Stop Forge"
- menubarPath="org.jboss.tools.forge.menubar"
- style="push"
- toolbarPath="org.jboss.tools.forge.toolbar">
</action>
<action
- class="org.jboss.tools.forge.ui.action.StartDelegate"
- icon="icons/start.gif"
- id="org.jboss.tools.forge.start"
- label="Start Forge"
+ class="org.jboss.tools.forge.ui.action.ShowInForgeDelegate"
+ icon="icons/jbossforge_icon_16px.png"
+ id="org.jboss.tools.forge.show"
+ label="Show In Forge"
menubarPath="org.jboss.tools.forge.menu"
style="push"
toolbarPath="org.jboss.tools.forge.toolbar">
@@ -99,5 +90,22 @@
sequence="M1+4"
schemeId="org.eclipse.ui.defaultAcceleratorConfiguration" />
</extension>
-
+ <extension
+ point="org.eclipse.ui.perspectiveExtensions">
+ <perspectiveExtension
+ targetID = "org.eclipse.jst.j2ee.J2EEPerspective">
+ <showInPart
+ id = "org.jboss.tools.forge.console"/>
+ </perspectiveExtension>
+ <perspectiveExtension
+ targetID = "org.eclipse.jdt.ui.JavaPerspective">
+ <showInPart
+ id = "org.jboss.tools.forge.console"/>
+ </perspectiveExtension>
+ <perspectiveExtension
+ targetID = "org.jboss.tools.common.ui.JBossPerspective">
+ <showInPart
+ id = "org.jboss.tools.forge.console"/>
+ </perspectiveExtension>
+ </extension>
</plugin>
Added: trunk/forge/plugins/org.jboss.tools.forge.ui/src/org/jboss/tools/forge/ui/action/ShowInForgeDelegate.java
===================================================================
--- trunk/forge/plugins/org.jboss.tools.forge.ui/src/org/jboss/tools/forge/ui/action/ShowInForgeDelegate.java (rev 0)
+++ trunk/forge/plugins/org.jboss.tools.forge.ui/src/org/jboss/tools/forge/ui/action/ShowInForgeDelegate.java 2011-12-06 19:11:24 UTC (rev 37009)
@@ -0,0 +1,32 @@
+package org.jboss.tools.forge.ui.action;
+
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.ui.IViewActionDelegate;
+import org.eclipse.ui.IViewPart;
+import org.eclipse.ui.part.ShowInContext;
+import org.jboss.tools.forge.ui.part.ForgeView;
+
+public class ShowInForgeDelegate implements IViewActionDelegate {
+
+ private ForgeView forgeView = null;
+
+ @Override
+ public void run(IAction action) {
+ if (forgeView != null) {
+ forgeView.show(new ShowInContext(null, forgeView.getSelection()));
+ }
+ }
+
+ @Override
+ public void selectionChanged(IAction action, ISelection selection) {
+ }
+
+ @Override
+ public void init(IViewPart view) {
+ if (view != null && view instanceof ForgeView) {
+ forgeView = (ForgeView)view;
+ }
+ }
+
+}
Property changes on: trunk/forge/plugins/org.jboss.tools.forge.ui/src/org/jboss/tools/forge/ui/action/ShowInForgeDelegate.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: trunk/forge/plugins/org.jboss.tools.forge.ui/src/org/jboss/tools/forge/ui/action/StartDelegate.java
===================================================================
--- trunk/forge/plugins/org.jboss.tools.forge.ui/src/org/jboss/tools/forge/ui/action/StartDelegate.java 2011-12-06 18:56:41 UTC (rev 37008)
+++ trunk/forge/plugins/org.jboss.tools.forge.ui/src/org/jboss/tools/forge/ui/action/StartDelegate.java 2011-12-06 19:11:24 UTC (rev 37009)
@@ -19,8 +19,6 @@
@Override
public void selectionChanged(IAction action, ISelection selection) {
- // TODO Auto-generated method stub
-
}
@Override
Modified: trunk/forge/plugins/org.jboss.tools.forge.ui/src/org/jboss/tools/forge/ui/console/ForgeCommandFilter.java
===================================================================
--- trunk/forge/plugins/org.jboss.tools.forge.ui/src/org/jboss/tools/forge/ui/console/ForgeCommandFilter.java 2011-12-06 18:56:41 UTC (rev 37008)
+++ trunk/forge/plugins/org.jboss.tools.forge.ui/src/org/jboss/tools/forge/ui/console/ForgeCommandFilter.java 2011-12-06 19:11:24 UTC (rev 37009)
@@ -17,7 +17,6 @@
@Override
public void handleFilteredString(String str) {
- System.out.println("handle filtered string: " + str);
if (str.startsWith(" EC: ")) {
commandProcessor.postProcess(str);
} else if (str.startsWith("POM File Modified: ")) {
Modified: trunk/forge/plugins/org.jboss.tools.forge.ui/src/org/jboss/tools/forge/ui/console/ForgeTextViewer.java
===================================================================
--- trunk/forge/plugins/org.jboss.tools.forge.ui/src/org/jboss/tools/forge/ui/console/ForgeTextViewer.java 2011-12-06 18:56:41 UTC (rev 37008)
+++ trunk/forge/plugins/org.jboss.tools.forge.ui/src/org/jboss/tools/forge/ui/console/ForgeTextViewer.java 2011-12-06 19:11:24 UTC (rev 37009)
@@ -168,32 +168,6 @@
}
};
outputListener = new ForgeCommandFilter(ansiCommandFilter);
-// outputListener = new ForgeHiddenOutputFilter(ansiCommandFilter) {
-// @Override
-// public void handleFilteredString(String str) {
-// System.out.println("handle filtered string: " + str);
-// if (str.startsWith("Intercepted Command: ")) {
-// commandProcessor.startCommand(str.substring(21));
-// } else if (str.startsWith("Executed Command: ")) {
-// commandProcessor.stopCurrentCommand(str);
-// } else if (str.startsWith("Execute Command: ")) {
-// str = str.substring(17);
-// int index = str.indexOf("Current Resource: ");
-// String line = "";
-// String resource = "";
-// if (index != -1) {
-// line = str.substring(0, index);
-// resource = str.substring(index + 18);
-// commandProcessor.executeCommand(line, resource);
-// }
-// } else if (str.startsWith("POM File Modified: ")) {
-// IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(str.substring(19));
-// if (project != null) {
-// ProjectConfigurationUpdater.updateProject(project);
-// }
-// }
-// }
-// };
runtime.addOutputListener(outputListener);
}
Modified: trunk/forge/plugins/org.jboss.tools.forge.ui/src/org/jboss/tools/forge/ui/console/PickUpPostProcessor.java
===================================================================
--- trunk/forge/plugins/org.jboss.tools.forge.ui/src/org/jboss/tools/forge/ui/console/PickUpPostProcessor.java 2011-12-06 18:56:41 UTC (rev 37008)
+++ trunk/forge/plugins/org.jboss.tools.forge.ui/src/org/jboss/tools/forge/ui/console/PickUpPostProcessor.java 2011-12-06 19:11:24 UTC (rev 37009)
@@ -149,13 +149,15 @@
for (String name : names) {
if (input != null && input instanceof IAdaptable) {
ISystemViewElementAdapter adapter = SystemAdapterHelpers.getViewAdapter(input);
- for (Object object : adapter.getChildren((IAdaptable)input, null)) {
- if (object instanceof IAdaptable) {
- adapter = SystemAdapterHelpers.getViewAdapter(object);
- if (name.equals(adapter.getText(object))) {
- input = object;
- treeSegments.add(input);
- break;
+ if (adapter != null) {
+ for (Object object : adapter.getChildren((IAdaptable)input, null)) {
+ if (object instanceof IAdaptable) {
+ adapter = SystemAdapterHelpers.getViewAdapter(object);
+ if (adapter != null && name.equals(adapter.getText(object))) {
+ input = object;
+ treeSegments.add(input);
+ break;
+ }
}
}
}
Modified: trunk/forge/plugins/org.jboss.tools.forge.ui/src/org/jboss/tools/forge/ui/part/ForgeView.java
===================================================================
--- trunk/forge/plugins/org.jboss.tools.forge.ui/src/org/jboss/tools/forge/ui/part/ForgeView.java 2011-12-06 18:56:41 UTC (rev 37008)
+++ trunk/forge/plugins/org.jboss.tools.forge.ui/src/org/jboss/tools/forge/ui/part/ForgeView.java 2011-12-06 19:11:24 UTC (rev 37009)
@@ -3,25 +3,35 @@
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.jdt.core.IJavaElement;
+import org.eclipse.jdt.core.JavaModelException;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Display;
+import org.eclipse.ui.ISelectionListener;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.ui.part.IShowInTarget;
import org.eclipse.ui.part.MessagePage;
import org.eclipse.ui.part.Page;
import org.eclipse.ui.part.PageBook;
import org.eclipse.ui.part.PageSite;
+import org.eclipse.ui.part.ShowInContext;
import org.eclipse.ui.part.ViewPart;
import org.jboss.tools.forge.core.preferences.ForgeRuntimesPreferences;
import org.jboss.tools.forge.core.process.ForgeRuntime;
import org.jboss.tools.forge.ui.ForgeUIPlugin;
import org.jboss.tools.forge.ui.console.ForgeTextViewer;
-public class ForgeView extends ViewPart implements PropertyChangeListener {
+public class ForgeView extends ViewPart implements PropertyChangeListener, IShowInTarget {
public static final String ID = "org.jboss.tools.forge.console";
@@ -62,20 +72,25 @@
private String notRunningMessage;
private ForgeRuntime runtime;
+ private ISelection selection;
-// public ForgeView() {
-// if (INSTANCE == null) {
-// INSTANCE = this;
-// }
-// }
-//
@Override
public void createPartControl(Composite parent) {
pageBook = new PageBook(parent, SWT.NONE);
createNotRunningPage(parent);
showPage(notRunning);
+ getSite().getWorkbenchWindow().getSelectionService().addSelectionListener(new ISelectionListener() {
+ @Override
+ public void selectionChanged(IWorkbenchPart part, ISelection newSelection) {
+ selection = newSelection;
+ }
+ });
}
+ public ISelection getSelection() {
+ return selection;
+ }
+
private void createNotRunningPage(Composite parent) {
MessagePage page = new MessagePage();
page.createControl(pageBook);
@@ -229,4 +244,30 @@
return runtime;
}
-}
+ public boolean show(ShowInContext context) {
+ if (context == null) {
+ return false;
+ }
+ if (runtime != null && ForgeRuntime.STATE_RUNNING.equals(runtime.getState())) {
+ ISelection sel = context.getSelection();
+ if (sel instanceof IStructuredSelection) {
+ IStructuredSelection ss = (IStructuredSelection)sel;
+ Object first = ss.getFirstElement();
+ if (first instanceof IResource) {
+ IPath path = ((IResource)first).getLocation();
+ runtime.sendInput("pick-up " + path + "\n");
+ } else if (first instanceof IJavaElement) {
+ try {
+ IPath path = ((IJavaElement)first).getCorrespondingResource().getLocation();
+ runtime.sendInput("pick-up " + path + "\n");
+ } catch (JavaModelException e) {
+ ForgeUIPlugin.log(e);
+ }
+ }
+ return true;
+ }
+ }
+ return false;
+ }
+
+}
\ No newline at end of file
14 years
JBoss Tools SVN: r37008 - in branches/jbosstools-3.3.0.M5/forge/plugins/org.jboss.tools.forge.ui: src/org/jboss/tools/forge/ui/action and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: koen.aers(a)jboss.com
Date: 2011-12-06 13:56:41 -0500 (Tue, 06 Dec 2011)
New Revision: 37008
Added:
branches/jbosstools-3.3.0.M5/forge/plugins/org.jboss.tools.forge.ui/src/org/jboss/tools/forge/ui/action/ShowInForgeDelegate.java
Modified:
branches/jbosstools-3.3.0.M5/forge/plugins/org.jboss.tools.forge.ui/plugin.xml
branches/jbosstools-3.3.0.M5/forge/plugins/org.jboss.tools.forge.ui/src/org/jboss/tools/forge/ui/action/StartDelegate.java
branches/jbosstools-3.3.0.M5/forge/plugins/org.jboss.tools.forge.ui/src/org/jboss/tools/forge/ui/console/ForgeCommandFilter.java
branches/jbosstools-3.3.0.M5/forge/plugins/org.jboss.tools.forge.ui/src/org/jboss/tools/forge/ui/console/ForgeTextViewer.java
branches/jbosstools-3.3.0.M5/forge/plugins/org.jboss.tools.forge.ui/src/org/jboss/tools/forge/ui/console/PickUpPostProcessor.java
branches/jbosstools-3.3.0.M5/forge/plugins/org.jboss.tools.forge.ui/src/org/jboss/tools/forge/ui/part/ForgeView.java
Log:
JBIDE-10269: Implement "Show In Forge" for Workspace Selections
Modified: branches/jbosstools-3.3.0.M5/forge/plugins/org.jboss.tools.forge.ui/plugin.xml
===================================================================
--- branches/jbosstools-3.3.0.M5/forge/plugins/org.jboss.tools.forge.ui/plugin.xml 2011-12-06 18:20:04 UTC (rev 37007)
+++ branches/jbosstools-3.3.0.M5/forge/plugins/org.jboss.tools.forge.ui/plugin.xml 2011-12-06 18:56:41 UTC (rev 37008)
@@ -32,7 +32,7 @@
id="org.jboss.tools.forge.menubar"
label="Forge">
</menu>
-<!-- <action
+ <action
class="org.jboss.tools.forge.ui.action.StopDelegate"
icon="icons/stop.gif"
id="org.jboss.tools.forge.stop"
@@ -49,21 +49,12 @@
menubarPath="org.jboss.tools.forge.menu"
style="push"
toolbarPath="org.jboss.tools.forge.toolbar">
- </action> -->
- <action
- class="org.jboss.tools.forge.ui.action.StopDelegate"
- icon="icons/stop.gif"
- id="org.jboss.tools.forge.stop"
- label="Stop Forge"
- menubarPath="org.jboss.tools.forge.menubar"
- style="push"
- toolbarPath="org.jboss.tools.forge.toolbar">
</action>
<action
- class="org.jboss.tools.forge.ui.action.StartDelegate"
- icon="icons/start.gif"
- id="org.jboss.tools.forge.start"
- label="Start Forge"
+ class="org.jboss.tools.forge.ui.action.ShowInForgeDelegate"
+ icon="icons/jbossforge_icon_16px.png"
+ id="org.jboss.tools.forge.show"
+ label="Show In Forge"
menubarPath="org.jboss.tools.forge.menu"
style="push"
toolbarPath="org.jboss.tools.forge.toolbar">
@@ -99,5 +90,22 @@
sequence="M1+4"
schemeId="org.eclipse.ui.defaultAcceleratorConfiguration" />
</extension>
-
+ <extension
+ point="org.eclipse.ui.perspectiveExtensions">
+ <perspectiveExtension
+ targetID = "org.eclipse.jst.j2ee.J2EEPerspective">
+ <showInPart
+ id = "org.jboss.tools.forge.console"/>
+ </perspectiveExtension>
+ <perspectiveExtension
+ targetID = "org.eclipse.jdt.ui.JavaPerspective">
+ <showInPart
+ id = "org.jboss.tools.forge.console"/>
+ </perspectiveExtension>
+ <perspectiveExtension
+ targetID = "org.jboss.tools.common.ui.JBossPerspective">
+ <showInPart
+ id = "org.jboss.tools.forge.console"/>
+ </perspectiveExtension>
+ </extension>
</plugin>
Added: branches/jbosstools-3.3.0.M5/forge/plugins/org.jboss.tools.forge.ui/src/org/jboss/tools/forge/ui/action/ShowInForgeDelegate.java
===================================================================
--- branches/jbosstools-3.3.0.M5/forge/plugins/org.jboss.tools.forge.ui/src/org/jboss/tools/forge/ui/action/ShowInForgeDelegate.java (rev 0)
+++ branches/jbosstools-3.3.0.M5/forge/plugins/org.jboss.tools.forge.ui/src/org/jboss/tools/forge/ui/action/ShowInForgeDelegate.java 2011-12-06 18:56:41 UTC (rev 37008)
@@ -0,0 +1,32 @@
+package org.jboss.tools.forge.ui.action;
+
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.ui.IViewActionDelegate;
+import org.eclipse.ui.IViewPart;
+import org.eclipse.ui.part.ShowInContext;
+import org.jboss.tools.forge.ui.part.ForgeView;
+
+public class ShowInForgeDelegate implements IViewActionDelegate {
+
+ private ForgeView forgeView = null;
+
+ @Override
+ public void run(IAction action) {
+ if (forgeView != null) {
+ forgeView.show(new ShowInContext(null, forgeView.getSelection()));
+ }
+ }
+
+ @Override
+ public void selectionChanged(IAction action, ISelection selection) {
+ }
+
+ @Override
+ public void init(IViewPart view) {
+ if (view != null && view instanceof ForgeView) {
+ forgeView = (ForgeView)view;
+ }
+ }
+
+}
Property changes on: branches/jbosstools-3.3.0.M5/forge/plugins/org.jboss.tools.forge.ui/src/org/jboss/tools/forge/ui/action/ShowInForgeDelegate.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: branches/jbosstools-3.3.0.M5/forge/plugins/org.jboss.tools.forge.ui/src/org/jboss/tools/forge/ui/action/StartDelegate.java
===================================================================
--- branches/jbosstools-3.3.0.M5/forge/plugins/org.jboss.tools.forge.ui/src/org/jboss/tools/forge/ui/action/StartDelegate.java 2011-12-06 18:20:04 UTC (rev 37007)
+++ branches/jbosstools-3.3.0.M5/forge/plugins/org.jboss.tools.forge.ui/src/org/jboss/tools/forge/ui/action/StartDelegate.java 2011-12-06 18:56:41 UTC (rev 37008)
@@ -19,8 +19,6 @@
@Override
public void selectionChanged(IAction action, ISelection selection) {
- // TODO Auto-generated method stub
-
}
@Override
Modified: branches/jbosstools-3.3.0.M5/forge/plugins/org.jboss.tools.forge.ui/src/org/jboss/tools/forge/ui/console/ForgeCommandFilter.java
===================================================================
--- branches/jbosstools-3.3.0.M5/forge/plugins/org.jboss.tools.forge.ui/src/org/jboss/tools/forge/ui/console/ForgeCommandFilter.java 2011-12-06 18:20:04 UTC (rev 37007)
+++ branches/jbosstools-3.3.0.M5/forge/plugins/org.jboss.tools.forge.ui/src/org/jboss/tools/forge/ui/console/ForgeCommandFilter.java 2011-12-06 18:56:41 UTC (rev 37008)
@@ -17,7 +17,6 @@
@Override
public void handleFilteredString(String str) {
- System.out.println("handle filtered string: " + str);
if (str.startsWith(" EC: ")) {
commandProcessor.postProcess(str);
} else if (str.startsWith("POM File Modified: ")) {
Modified: branches/jbosstools-3.3.0.M5/forge/plugins/org.jboss.tools.forge.ui/src/org/jboss/tools/forge/ui/console/ForgeTextViewer.java
===================================================================
--- branches/jbosstools-3.3.0.M5/forge/plugins/org.jboss.tools.forge.ui/src/org/jboss/tools/forge/ui/console/ForgeTextViewer.java 2011-12-06 18:20:04 UTC (rev 37007)
+++ branches/jbosstools-3.3.0.M5/forge/plugins/org.jboss.tools.forge.ui/src/org/jboss/tools/forge/ui/console/ForgeTextViewer.java 2011-12-06 18:56:41 UTC (rev 37008)
@@ -168,32 +168,6 @@
}
};
outputListener = new ForgeCommandFilter(ansiCommandFilter);
-// outputListener = new ForgeHiddenOutputFilter(ansiCommandFilter) {
-// @Override
-// public void handleFilteredString(String str) {
-// System.out.println("handle filtered string: " + str);
-// if (str.startsWith("Intercepted Command: ")) {
-// commandProcessor.startCommand(str.substring(21));
-// } else if (str.startsWith("Executed Command: ")) {
-// commandProcessor.stopCurrentCommand(str);
-// } else if (str.startsWith("Execute Command: ")) {
-// str = str.substring(17);
-// int index = str.indexOf("Current Resource: ");
-// String line = "";
-// String resource = "";
-// if (index != -1) {
-// line = str.substring(0, index);
-// resource = str.substring(index + 18);
-// commandProcessor.executeCommand(line, resource);
-// }
-// } else if (str.startsWith("POM File Modified: ")) {
-// IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(str.substring(19));
-// if (project != null) {
-// ProjectConfigurationUpdater.updateProject(project);
-// }
-// }
-// }
-// };
runtime.addOutputListener(outputListener);
}
Modified: branches/jbosstools-3.3.0.M5/forge/plugins/org.jboss.tools.forge.ui/src/org/jboss/tools/forge/ui/console/PickUpPostProcessor.java
===================================================================
--- branches/jbosstools-3.3.0.M5/forge/plugins/org.jboss.tools.forge.ui/src/org/jboss/tools/forge/ui/console/PickUpPostProcessor.java 2011-12-06 18:20:04 UTC (rev 37007)
+++ branches/jbosstools-3.3.0.M5/forge/plugins/org.jboss.tools.forge.ui/src/org/jboss/tools/forge/ui/console/PickUpPostProcessor.java 2011-12-06 18:56:41 UTC (rev 37008)
@@ -149,13 +149,15 @@
for (String name : names) {
if (input != null && input instanceof IAdaptable) {
ISystemViewElementAdapter adapter = SystemAdapterHelpers.getViewAdapter(input);
- for (Object object : adapter.getChildren((IAdaptable)input, null)) {
- if (object instanceof IAdaptable) {
- adapter = SystemAdapterHelpers.getViewAdapter(object);
- if (name.equals(adapter.getText(object))) {
- input = object;
- treeSegments.add(input);
- break;
+ if (adapter != null) {
+ for (Object object : adapter.getChildren((IAdaptable)input, null)) {
+ if (object instanceof IAdaptable) {
+ adapter = SystemAdapterHelpers.getViewAdapter(object);
+ if (adapter != null && name.equals(adapter.getText(object))) {
+ input = object;
+ treeSegments.add(input);
+ break;
+ }
}
}
}
Modified: branches/jbosstools-3.3.0.M5/forge/plugins/org.jboss.tools.forge.ui/src/org/jboss/tools/forge/ui/part/ForgeView.java
===================================================================
--- branches/jbosstools-3.3.0.M5/forge/plugins/org.jboss.tools.forge.ui/src/org/jboss/tools/forge/ui/part/ForgeView.java 2011-12-06 18:20:04 UTC (rev 37007)
+++ branches/jbosstools-3.3.0.M5/forge/plugins/org.jboss.tools.forge.ui/src/org/jboss/tools/forge/ui/part/ForgeView.java 2011-12-06 18:56:41 UTC (rev 37008)
@@ -3,25 +3,35 @@
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.jdt.core.IJavaElement;
+import org.eclipse.jdt.core.JavaModelException;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Display;
+import org.eclipse.ui.ISelectionListener;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.ui.part.IShowInTarget;
import org.eclipse.ui.part.MessagePage;
import org.eclipse.ui.part.Page;
import org.eclipse.ui.part.PageBook;
import org.eclipse.ui.part.PageSite;
+import org.eclipse.ui.part.ShowInContext;
import org.eclipse.ui.part.ViewPart;
import org.jboss.tools.forge.core.preferences.ForgeRuntimesPreferences;
import org.jboss.tools.forge.core.process.ForgeRuntime;
import org.jboss.tools.forge.ui.ForgeUIPlugin;
import org.jboss.tools.forge.ui.console.ForgeTextViewer;
-public class ForgeView extends ViewPart implements PropertyChangeListener {
+public class ForgeView extends ViewPart implements PropertyChangeListener, IShowInTarget {
public static final String ID = "org.jboss.tools.forge.console";
@@ -62,20 +72,25 @@
private String notRunningMessage;
private ForgeRuntime runtime;
+ private ISelection selection;
-// public ForgeView() {
-// if (INSTANCE == null) {
-// INSTANCE = this;
-// }
-// }
-//
@Override
public void createPartControl(Composite parent) {
pageBook = new PageBook(parent, SWT.NONE);
createNotRunningPage(parent);
showPage(notRunning);
+ getSite().getWorkbenchWindow().getSelectionService().addSelectionListener(new ISelectionListener() {
+ @Override
+ public void selectionChanged(IWorkbenchPart part, ISelection newSelection) {
+ selection = newSelection;
+ }
+ });
}
+ public ISelection getSelection() {
+ return selection;
+ }
+
private void createNotRunningPage(Composite parent) {
MessagePage page = new MessagePage();
page.createControl(pageBook);
@@ -229,4 +244,30 @@
return runtime;
}
-}
+ public boolean show(ShowInContext context) {
+ if (context == null) {
+ return false;
+ }
+ if (runtime != null && ForgeRuntime.STATE_RUNNING.equals(runtime.getState())) {
+ ISelection sel = context.getSelection();
+ if (sel instanceof IStructuredSelection) {
+ IStructuredSelection ss = (IStructuredSelection)sel;
+ Object first = ss.getFirstElement();
+ if (first instanceof IResource) {
+ IPath path = ((IResource)first).getLocation();
+ runtime.sendInput("pick-up " + path + "\n");
+ } else if (first instanceof IJavaElement) {
+ try {
+ IPath path = ((IJavaElement)first).getCorrespondingResource().getLocation();
+ runtime.sendInput("pick-up " + path + "\n");
+ } catch (JavaModelException e) {
+ ForgeUIPlugin.log(e);
+ }
+ }
+ return true;
+ }
+ }
+ return false;
+ }
+
+}
\ No newline at end of file
14 years
JBoss Tools SVN: r37007 - trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/preferences.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2011-12-06 13:20:04 -0500 (Tue, 06 Dec 2011)
New Revision: 37007
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/preferences/JSFSeverityPreferencesMessages.java
trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/preferences/JSFSeverityPreferencesMessages.properties
trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/preferences/JSFValidationConfigurationBlock.java
Log:
JBIDE-10190
https://issues.jboss.org/browse/JBIDE-10190
Fixed 'invalid view handler' label.
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/preferences/JSFSeverityPreferencesMessages.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/preferences/JSFSeverityPreferencesMessages.java 2011-12-06 18:02:18 UTC (rev 37006)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/preferences/JSFSeverityPreferencesMessages.java 2011-12-06 18:20:04 UTC (rev 37007)
@@ -42,6 +42,7 @@
public static String JSFValidationConfigurationBlock_pb_invalidPropertyResolver_label;
public static String JSFValidationConfigurationBlock_pb_invalidStateManager_label;
public static String JSFValidationConfigurationBlock_pb_invalidVariableResolver_label;
+ public static String JSFValidationConfigurationBlock_pb_invalidViewHandler_label;
////Component
public static String JSFValidationConfigurationBlock_section_component;
public static String JSFValidationConfigurationBlock_pb_invalidComponentClass_label;
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/preferences/JSFSeverityPreferencesMessages.properties
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/preferences/JSFSeverityPreferencesMessages.properties 2011-12-06 18:02:18 UTC (rev 37006)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/preferences/JSFSeverityPreferencesMessages.properties 2011-12-06 18:20:04 UTC (rev 37007)
@@ -32,6 +32,7 @@
JSFValidationConfigurationBlock_pb_invalidPropertyResolver_label=Invalid property resolver:
JSFValidationConfigurationBlock_pb_invalidStateManager_label=Invalid state manager:
JSFValidationConfigurationBlock_pb_invalidVariableResolver_label=Invalid variable resolver:
+JSFValidationConfigurationBlock_pb_invalidViewHandler_label=Invalid view handler:
###Component
JSFValidationConfigurationBlock_section_component=Component
JSFValidationConfigurationBlock_pb_invalidComponentClass_label=Invalid component class:
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/preferences/JSFValidationConfigurationBlock.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/preferences/JSFValidationConfigurationBlock.java 2011-12-06 18:02:18 UTC (rev 37006)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/preferences/JSFValidationConfigurationBlock.java 2011-12-06 18:20:04 UTC (rev 37007)
@@ -48,7 +48,7 @@
{JSFSeverityPreferences.INVALID_PROPERTY_RESOLVER, JSFSeverityPreferencesMessages.JSFValidationConfigurationBlock_pb_invalidPropertyResolver_label},
{JSFSeverityPreferences.INVALID_STATE_MANAGER, JSFSeverityPreferencesMessages.JSFValidationConfigurationBlock_pb_invalidStateManager_label},
{JSFSeverityPreferences.INVALID_VARIABLE_RESOLVER, JSFSeverityPreferencesMessages.JSFValidationConfigurationBlock_pb_invalidVariableResolver_label},
- {JSFSeverityPreferences.INVALID_VIEW_HANDLER, JSFSeverityPreferencesMessages.JSFValidationConfigurationBlock_pb_invalidActionListener_label},
+ {JSFSeverityPreferences.INVALID_VIEW_HANDLER, JSFSeverityPreferencesMessages.JSFValidationConfigurationBlock_pb_invalidViewHandler_label},
},
JSFModelPlugin.PLUGIN_ID
);
14 years
JBoss Tools SVN: r37006 - branches/jbosstools-3.3.0.M5/maven/plugins/org.jboss.tools.maven.core/src/org/jboss/tools/maven/core/internal/profiles.
by jbosstools-commits@lists.jboss.org
Author: fbricon
Date: 2011-12-06 13:02:18 -0500 (Tue, 06 Dec 2011)
New Revision: 37006
Modified:
branches/jbosstools-3.3.0.M5/maven/plugins/org.jboss.tools.maven.core/src/org/jboss/tools/maven/core/internal/profiles/ProfileManager.java
Log:
JBIDE-10170 : fix activation detection on profiles from settings.xml
Modified: branches/jbosstools-3.3.0.M5/maven/plugins/org.jboss.tools.maven.core/src/org/jboss/tools/maven/core/internal/profiles/ProfileManager.java
===================================================================
--- branches/jbosstools-3.3.0.M5/maven/plugins/org.jboss.tools.maven.core/src/org/jboss/tools/maven/core/internal/profiles/ProfileManager.java 2011-12-06 17:10:34 UTC (rev 37005)
+++ branches/jbosstools-3.3.0.M5/maven/plugins/org.jboss.tools.maven.core/src/org/jboss/tools/maven/core/internal/profiles/ProfileManager.java 2011-12-06 18:02:18 UTC (rev 37006)
@@ -37,8 +37,6 @@
public class ProfileManager implements IProfileManager {
- private static final String ARTIFACT_SEPARATOR = ":"; //$NON-NLS-1$
-
public void updateActiveProfiles(final IMavenProjectFacade mavenProjectFacade,
final List<String> profiles,
final boolean isOffline,
@@ -90,7 +88,7 @@
for (org.apache.maven.settings.Profile sp : settings.getProfiles()) {
Profile p = SettingsUtils.convertFromSettingsProfile(sp);
- boolean isAutomaticallyActivated = isActive2(p, activeProfiles);
+ boolean isAutomaticallyActivated = isActive(sp, activeProfiles);
settingsProfiles.put(p, isAutomaticallyActivated);
}
return Collections.unmodifiableMap(settingsProfiles);
@@ -105,7 +103,10 @@
return false;
}
- private boolean isActive2(Profile p, List<String> activeProfiles) {
+ private boolean isActive(org.apache.maven.settings.Profile p, List<String> activeProfiles) {
+ if (p.getActivation() != null && p.getActivation().isActiveByDefault()){
+ return true;
+ }
for (String activeProfile : activeProfiles) {
if (activeProfile.equals(p.getId())) {
return true;
14 years
JBoss Tools SVN: r37005 - trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/computers.
by jbosstools-commits@lists.jboss.org
Author: vrubezhny
Date: 2011-12-06 12:10:34 -0500 (Tue, 06 Dec 2011)
New Revision: 37005
Modified:
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/computers/XmlELCompletionProposalComputer.java
Log:
JBIDE-10320 Code assist for #{messages['...']} does not work properly
Issue is fixed
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/computers/XmlELCompletionProposalComputer.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/computers/XmlELCompletionProposalComputer.java 2011-12-06 16:05:33 UTC (rev 37004)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/computers/XmlELCompletionProposalComputer.java 2011-12-06 17:10:34 UTC (rev 37005)
@@ -246,6 +246,14 @@
if (restOfValue.indexOf('}') == -1) {
// Add closing }-char
+
+ if (replacementString.indexOf(']') == -1 && restOfValue.indexOf(']') != -1) {
+ // Need to move chars before ']' (including this char) from restOfValue to replacementString before adding closing '}'-char
+ int shift = restOfValue.indexOf(']') + 1;
+ replacementString += restOfValue.substring(0, shift);
+ replacementLength += shift;
+ restOfValue = restOfValue.substring(shift);
+ }
replacementString += '}';
}
} else {
@@ -899,11 +907,13 @@
char quoteChar = (char)0;
if (DOMRegionContext.XML_TAG_ATTRIBUTE_VALUE.equals(request.getRegion().getType())) {
isAttributeValue = true;
+ if (text.indexOf('\n') != -1) text = text.substring(0, text.indexOf('\n'));
+ if (text.indexOf('\r') != -1) text = text.substring(0, text.indexOf('\r'));
if (text.startsWith("\"") || text.startsWith("'")) {//$NON-NLS-1$ //$NON-NLS-2$
quoteChar = text.charAt(0);
hasOpenQuote = true;
}
- if (hasOpenQuote && text.trim().endsWith(String.valueOf(quoteChar))) {
+ if (hasOpenQuote && text.substring(1).trim().endsWith(String.valueOf(quoteChar))) {
hasCloseQuote = true;
}
}
14 years
JBoss Tools SVN: r37004 - in workspace/bfitzpat/org.jboss.tools.uddi.ui: META-INF and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: bfitzpat
Date: 2011-12-06 11:05:33 -0500 (Tue, 06 Dec 2011)
New Revision: 37004
Added:
workspace/bfitzpat/org.jboss.tools.uddi.ui/src/org/jboss/tools/uddi/ui/connection/DTPUDDIObject.java
workspace/bfitzpat/org.jboss.tools.uddi.ui/src/org/jboss/tools/uddi/ui/connection/UDDIContentExtension.java
workspace/bfitzpat/org.jboss.tools.uddi.ui/src/org/jboss/tools/uddi/ui/connection/UDDIContentProviderExtension.java
workspace/bfitzpat/org.jboss.tools.uddi.ui/src/org/jboss/tools/uddi/ui/connection/UDDILabelProviderExtension.java
workspace/bfitzpat/org.jboss.tools.uddi.ui/src/org/jboss/tools/uddi/ui/connection/UDDISearchNodeContentProvider.java
workspace/bfitzpat/org.jboss.tools.uddi.ui/src/org/jboss/tools/uddi/ui/connection/UDDISearchNodeLabelProvider.java
Modified:
workspace/bfitzpat/org.jboss.tools.uddi.ui/META-INF/MANIFEST.MF
workspace/bfitzpat/org.jboss.tools.uddi.ui/plugin.xml
workspace/bfitzpat/org.jboss.tools.uddi.ui/src/org/jboss/tools/uddi/ui/connection/JUDDIConnection.java
Log:
JBIDE-6411 - Adding UDDI connection profile work
Modified: workspace/bfitzpat/org.jboss.tools.uddi.ui/META-INF/MANIFEST.MF
===================================================================
--- workspace/bfitzpat/org.jboss.tools.uddi.ui/META-INF/MANIFEST.MF 2011-12-06 15:51:48 UTC (rev 37003)
+++ workspace/bfitzpat/org.jboss.tools.uddi.ui/META-INF/MANIFEST.MF 2011-12-06 16:05:33 UTC (rev 37004)
@@ -9,6 +9,7 @@
org.jboss.tools.uddi.core;bundle-version="1.0.0",
org.eclipse.datatools.connectivity;bundle-version="1.2.3",
org.eclipse.datatools.connectivity.ui;bundle-version="1.2.1",
- org.eclipse.datatools.connectivity.ui.dse;bundle-version="1.1.4"
+ org.eclipse.datatools.connectivity.ui.dse;bundle-version="1.1.4",
+ org.eclipse.ui.navigator;bundle-version="3.5.100"
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Modified: workspace/bfitzpat/org.jboss.tools.uddi.ui/plugin.xml
===================================================================
--- workspace/bfitzpat/org.jboss.tools.uddi.ui/plugin.xml 2011-12-06 15:51:48 UTC (rev 37003)
+++ workspace/bfitzpat/org.jboss.tools.uddi.ui/plugin.xml 2011-12-06 16:05:33 UTC (rev 37004)
@@ -44,5 +44,39 @@
profile="org.jboss.tools.uddi.ui.juddi">
</newWizard>
</extension>
+ <extension
+ point="org.eclipse.ui.navigator.navigatorContent">
+ <navigatorContent
+ contentProvider="org.jboss.tools.uddi.ui.connection.UDDIContentProviderExtension"
+ id="org.jboss.tools.uddi.ui.search"
+ labelProvider="org.jboss.tools.uddi.ui.connection.UDDILabelProviderExtension"
+ name="UDDI Search Content"
+ priority="normal">
+ <enablement>
+ <or>
+ <and>
+ <instanceof value="org.eclipse.datatools.connectivity.IConnectionProfile"/>
+ <test
+ property="org.eclipse.datatools.connectivity.profile.property.id"
+ value="org.jboss.tools.uddi.ui.juddi"/>
+ </and>
+ <instanceof
+ value="org.jboss.tools.uddi.ui.connection.DTPUDDIObject">
+ </instanceof>
+ </or>
+ </enablement>
+ </navigatorContent>
+ </extension>
+ <extension
+ point="org.eclipse.ui.navigator.viewer">
+ <viewerContentBinding
+ viewerId="org.eclipse.datatools.connectivity.DataSourceExplorerNavigator">
+ <includes>
+ <contentExtension
+ pattern="org.jboss.tools.uddi.ui.search">
+ </contentExtension>
+ </includes>
+ </viewerContentBinding>
+ </extension>
</plugin>
Added: workspace/bfitzpat/org.jboss.tools.uddi.ui/src/org/jboss/tools/uddi/ui/connection/DTPUDDIObject.java
===================================================================
--- workspace/bfitzpat/org.jboss.tools.uddi.ui/src/org/jboss/tools/uddi/ui/connection/DTPUDDIObject.java (rev 0)
+++ workspace/bfitzpat/org.jboss.tools.uddi.ui/src/org/jboss/tools/uddi/ui/connection/DTPUDDIObject.java 2011-12-06 16:05:33 UTC (rev 37004)
@@ -0,0 +1,38 @@
+package org.jboss.tools.uddi.ui.connection;
+
+import org.apache.juddi.v3.client.transport.Transport;
+import org.eclipse.datatools.connectivity.IConnectionProfile;
+import org.uddi.v3_service.UDDIInquiryPortType;
+
+public class DTPUDDIObject {
+
+ private IConnectionProfile profile;
+ private Transport rawTransport = null;
+ private UDDIInquiryPortType inquiryPortType;
+
+ public DTPUDDIObject (IConnectionProfile profile, Transport inTransport, UDDIInquiryPortType inquiryPortType) {
+ this.profile = profile;
+ this.rawTransport = inTransport;
+ this.inquiryPortType = inquiryPortType;
+ }
+
+ public Transport getTransport() {
+ return rawTransport;
+ }
+
+ public void setTransport(Transport rawTransport) {
+ this.rawTransport = rawTransport;
+ }
+
+ public UDDIInquiryPortType getInquiryPortType() {
+ return inquiryPortType;
+ }
+
+ public void setInquiryPortType(UDDIInquiryPortType inquiryPortType) {
+ this.inquiryPortType = inquiryPortType;
+ }
+
+ public IConnectionProfile getProfile() {
+ return profile;
+ }
+}
Property changes on: workspace/bfitzpat/org.jboss.tools.uddi.ui/src/org/jboss/tools/uddi/ui/connection/DTPUDDIObject.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: workspace/bfitzpat/org.jboss.tools.uddi.ui/src/org/jboss/tools/uddi/ui/connection/JUDDIConnection.java
===================================================================
--- workspace/bfitzpat/org.jboss.tools.uddi.ui/src/org/jboss/tools/uddi/ui/connection/JUDDIConnection.java 2011-12-06 15:51:48 UTC (rev 37003)
+++ workspace/bfitzpat/org.jboss.tools.uddi.ui/src/org/jboss/tools/uddi/ui/connection/JUDDIConnection.java 2011-12-06 16:05:33 UTC (rev 37004)
@@ -6,23 +6,24 @@
import java.io.IOException;
import java.util.Properties;
-import org.eclipse.datatools.connectivity.IConnectionProfile;
-import org.eclipse.datatools.connectivity.Version;
-import org.eclipse.datatools.connectivity.VersionProviderConnection;
-import org.uddi.api_v3.AuthToken;
-import org.uddi.api_v3.GetAuthToken;
-import org.uddi.v3_service.UDDIInquiryPortType;
-import org.uddi.v3_service.UDDISecurityPortType;
+import org.apache.commons.configuration.ConfigurationException;
import org.apache.cxf.endpoint.Client;
import org.apache.cxf.frontend.ClientProxy;
import org.apache.cxf.interceptor.LoggingInInterceptor;
import org.apache.cxf.interceptor.LoggingOutInterceptor;
import org.apache.juddi.v3.client.ClassUtil;
import org.apache.juddi.v3.client.config.ClientConfig;
+import org.apache.juddi.v3.client.config.UDDIClerkManager;
import org.apache.juddi.v3.client.config.UDDIClientContainer;
import org.apache.juddi.v3.client.config.UDDINode;
-import org.apache.juddi.v3.client.transport.SAPRegistryJAXWSTransport;
import org.apache.juddi.v3.client.transport.Transport;
+import org.eclipse.datatools.connectivity.IConnectionProfile;
+import org.eclipse.datatools.connectivity.Version;
+import org.eclipse.datatools.connectivity.VersionProviderConnection;
+import org.uddi.api_v3.AuthToken;
+import org.uddi.api_v3.GetAuthToken;
+import org.uddi.v3_service.UDDIInquiryPortType;
+import org.uddi.v3_service.UDDISecurityPortType;
public class JUDDIConnection extends VersionProviderConnection {
@@ -30,6 +31,8 @@
private String inquiryURL;
private String securityURL;
private boolean needsAuthentication;
+ private UDDIInquiryPortType inquiryPortType;
+ private DTPUDDIObject dtpUDDI;
public JUDDIConnection(IConnectionProfile profile, Class<?> factoryClass) {
super(profile, factoryClass);
@@ -40,26 +43,44 @@
getConnectionProfile().getBaseProperties();
inquiryURL = (String) props.get("inquiry");
securityURL = (String) props.get("security");
- Boolean convert = (Boolean) props.get("needsAuthentication");
+ Boolean convert;
+ try {
+ convert = (Boolean) props.get("needsAuthentication");
+ } catch (ClassCastException cce) {
+ convert = new Boolean(true);
+ }
+
needsAuthentication = convert.booleanValue();
- String filepath = createTemporaryUDDIXMLFile();
+ String filepath = createTemporaryUDDIXMLFile(needsAuthentication);
System.out.println(filepath);
try {
// ClientConfig config = UDDIClientContainer.getUDDIClerkManager(null).
// getClientConfig();
ClientConfig config = new ClientConfig(filepath);
- String clazz = config.getUDDINode(getConnectionProfile().getName()).getProxyTransport();
- String managerName = config.getManagerName();
+ UDDINode node = config.getUDDINode(getConnectionProfile().getName());
+ String clazz = node.getProxyTransport();
+ final String managerName = config.getManagerName();
Class<?> transportClass = ClassUtil.forName(clazz, Transport.class);
+
+ UDDIClerkManager manager;
+ try {
+ manager = UDDIClientContainer.getUDDIClerkManager(managerName);
+ if (manager != null) {
+ UDDIClientContainer.removeClerkManager(managerName);
+ manager = new UDDIClerkManager(filepath);
+ UDDIClientContainer.addClerkManager(manager);
+ }
+ } catch (ConfigurationException ce) {
+ manager = new UDDIClerkManager(filepath);
+ UDDIClientContainer.addClerkManager(manager);
+ }
+
if (transportClass!=null) {
- UDDINode node = config.getUDDINode(getConnectionProfile().getName());
- SAPRegistryJAXWSTransport transport = new SAPRegistryJAXWSTransport(managerName, getConnectionProfile().getName());
-
-// Transport transport = (Transport) transportClass.
-// getConstructor(String.class, String.class).newInstance("temp-uddi", getConnectionProfile().getName());
- UDDIInquiryPortType inquiry = transport.getUDDIInquiryService();
+ Transport transport = (Transport) transportClass.
+ getConstructor(String.class, String.class).newInstance("temp-uddi", getConnectionProfile().getName());
+ inquiryPortType = transport.getUDDIInquiryService();
UDDISecurityPortType security = transport.getUDDISecurityService();
Client client = ClientProxy.getClient(security);
@@ -76,6 +97,9 @@
} catch (Exception e) {
e.printStackTrace();
}
+
+ dtpUDDI = new DTPUDDIObject(getConnectionProfile(), transport, inquiryPortType);
+
}
} catch (Exception e) {
e.printStackTrace();
@@ -84,7 +108,7 @@
System.out.println(props.toString());
}
- private String createTemporaryUDDIXMLFile() {
+ private String createTemporaryUDDIXMLFile( boolean needsAuthentication ) {
try {
// Create temp file.
File temp = File.createTempFile("udditemp", ".xml");
@@ -94,7 +118,7 @@
// Write to temp file
BufferedWriter out = new BufferedWriter(new FileWriter(temp));
- String xml = getUDDIXML();
+ String xml = getUDDIXML( needsAuthentication );
out.write(xml);
out.close();
@@ -104,7 +128,7 @@
return null;
}
- private String getUDDIXML() {
+ private String getUDDIXML( boolean needsAuthentication ) {
StringBuffer buffer = new StringBuffer();
buffer.append("<?xml version=\"1.0\" encoding=\"ISO-8859-1\" ?>");
buffer.append("<uddi>");
@@ -114,6 +138,12 @@
buffer.append("<node>");
buffer.append("<name>" + getConnectionProfile().getName() + "</name>");
buffer.append("<description>" + getConnectionProfile().getDescription() + "</description>");
+ if (needsAuthentication) {
+ buffer.append("<properties>");
+ buffer.append("<property name=\"basicAuthUsername\" value=\"sruser\" />");
+ buffer.append("<property name=\"basicAuthPassword\" value=\"eswork123\" />");
+ buffer.append("</properties>");
+ }
buffer.append("<proxyTransport>org.apache.juddi.v3.client.transport.SAPRegistryJAXWSTransport</proxyTransport>");
buffer.append("<inquiryUrl>" + inquiryURL + "</inquiryUrl>");
buffer.append("<securityUrl>" + securityURL + "</securityUrl>");
@@ -130,11 +160,14 @@
@Override
public Object getRawConnection() {
- return rawTransport;
+ return dtpUDDI;
}
@Override
public void close() {
+ if (inquiryPortType != null) {
+ inquiryPortType = null;
+ }
if (rawTransport != null) {
rawTransport = null;
}
Added: workspace/bfitzpat/org.jboss.tools.uddi.ui/src/org/jboss/tools/uddi/ui/connection/UDDIContentExtension.java
===================================================================
--- workspace/bfitzpat/org.jboss.tools.uddi.ui/src/org/jboss/tools/uddi/ui/connection/UDDIContentExtension.java (rev 0)
+++ workspace/bfitzpat/org.jboss.tools.uddi.ui/src/org/jboss/tools/uddi/ui/connection/UDDIContentExtension.java 2011-12-06 16:05:33 UTC (rev 37004)
@@ -0,0 +1,43 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Sybase, Inc.
+ *
+ * All rights reserved. This program and the accompanying materials are 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: brianf & shongxum - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.uddi.ui.connection;
+
+import org.eclipse.datatools.connectivity.IConnectionProfile;
+import org.eclipse.datatools.connectivity.ui.IContentExtension;
+import org.eclipse.datatools.connectivity.ui.ManagedContentExtensionBase;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.ui.ISharedImages;
+import org.eclipse.ui.internal.WorkbenchPlugin;
+
+/**
+ * @see IContentExtension
+ */
+@SuppressWarnings("restriction")
+public class UDDIContentExtension extends ManagedContentExtensionBase {
+
+ public UDDIContentExtension(IConnectionProfile profile) {
+ super(profile, "org.apache.juddi.v3.client.transport.Transport");
+ }
+
+ public Image getImage() {
+ return WorkbenchPlugin.getDefault().getSharedImages().getImage(
+ ISharedImages.IMG_OBJ_FILE);
+ }
+
+ public String getLabel() {
+ return "UDDI Content";
+ }
+
+ public boolean isVisible() {
+ return true;
+ }
+
+}
Property changes on: workspace/bfitzpat/org.jboss.tools.uddi.ui/src/org/jboss/tools/uddi/ui/connection/UDDIContentExtension.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: workspace/bfitzpat/org.jboss.tools.uddi.ui/src/org/jboss/tools/uddi/ui/connection/UDDIContentProviderExtension.java
===================================================================
--- workspace/bfitzpat/org.jboss.tools.uddi.ui/src/org/jboss/tools/uddi/ui/connection/UDDIContentProviderExtension.java (rev 0)
+++ workspace/bfitzpat/org.jboss.tools.uddi.ui/src/org/jboss/tools/uddi/ui/connection/UDDIContentProviderExtension.java 2011-12-06 16:05:33 UTC (rev 37004)
@@ -0,0 +1,23 @@
+package org.jboss.tools.uddi.ui.connection;
+
+import org.eclipse.datatools.connectivity.IConnectionProfile;
+import org.eclipse.datatools.connectivity.ui.CommonContentProviderBase;
+import org.eclipse.datatools.connectivity.ui.IContentExtension;
+
+/**
+ * This class implements the navigatorContent extension and supplies workspace
+ * resources.
+ *
+ */
+public class UDDIContentProviderExtension extends
+ CommonContentProviderBase {
+
+ public UDDIContentProviderExtension() {
+ super(new UDDISearchNodeContentProvider());
+ }
+
+ protected IContentExtension createContentExtension(
+ IConnectionProfile profile) {
+ return new UDDIContentExtension(profile);
+ }
+}
\ No newline at end of file
Property changes on: workspace/bfitzpat/org.jboss.tools.uddi.ui/src/org/jboss/tools/uddi/ui/connection/UDDIContentProviderExtension.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: workspace/bfitzpat/org.jboss.tools.uddi.ui/src/org/jboss/tools/uddi/ui/connection/UDDILabelProviderExtension.java
===================================================================
--- workspace/bfitzpat/org.jboss.tools.uddi.ui/src/org/jboss/tools/uddi/ui/connection/UDDILabelProviderExtension.java (rev 0)
+++ workspace/bfitzpat/org.jboss.tools.uddi.ui/src/org/jboss/tools/uddi/ui/connection/UDDILabelProviderExtension.java 2011-12-06 16:05:33 UTC (rev 37004)
@@ -0,0 +1,11 @@
+package org.jboss.tools.uddi.ui.connection;
+
+import org.eclipse.datatools.connectivity.ui.CommonLabelProviderBase;
+
+public class UDDILabelProviderExtension extends CommonLabelProviderBase {
+
+ public UDDILabelProviderExtension() {
+ super(new UDDISearchNodeLabelProvider());
+ }
+
+}
Property changes on: workspace/bfitzpat/org.jboss.tools.uddi.ui/src/org/jboss/tools/uddi/ui/connection/UDDILabelProviderExtension.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: workspace/bfitzpat/org.jboss.tools.uddi.ui/src/org/jboss/tools/uddi/ui/connection/UDDISearchNodeContentProvider.java
===================================================================
--- workspace/bfitzpat/org.jboss.tools.uddi.ui/src/org/jboss/tools/uddi/ui/connection/UDDISearchNodeContentProvider.java (rev 0)
+++ workspace/bfitzpat/org.jboss.tools.uddi.ui/src/org/jboss/tools/uddi/ui/connection/UDDISearchNodeContentProvider.java 2011-12-06 16:05:33 UTC (rev 37004)
@@ -0,0 +1,52 @@
+package org.jboss.tools.uddi.ui.connection;
+
+import org.eclipse.datatools.connectivity.IConnectionProfile;
+import org.eclipse.jface.viewers.ITreeContentProvider;
+import org.eclipse.jface.viewers.Viewer;
+
+public class UDDISearchNodeContentProvider implements ITreeContentProvider {
+
+ private IConnectionProfile profile = null;
+ private DTPUDDIObject dtpUDDI = null;
+
+ public UDDISearchNodeContentProvider() {
+ }
+
+ @Override
+ public void dispose() {
+ }
+
+ @Override
+ public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
+ if (newInput instanceof IConnectionProfile) {
+ this.profile = (IConnectionProfile) newInput;
+ } else if (newInput instanceof DTPUDDIObject) {
+ this.dtpUDDI = (DTPUDDIObject) newInput;
+ }
+ }
+
+ @Override
+ public Object[] getElements(Object inputElement) {
+ return null;
+ }
+
+ @Override
+ public Object[] getChildren(Object parentElement) {
+
+ return null;
+ }
+
+ @Override
+ public Object getParent(Object element) {
+ return null;
+ }
+
+ @Override
+ public boolean hasChildren(Object element) {
+ if (this.profile != null || this.dtpUDDI != null) {
+ return true;
+ }
+ return false;
+ }
+
+}
Property changes on: workspace/bfitzpat/org.jboss.tools.uddi.ui/src/org/jboss/tools/uddi/ui/connection/UDDISearchNodeContentProvider.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: workspace/bfitzpat/org.jboss.tools.uddi.ui/src/org/jboss/tools/uddi/ui/connection/UDDISearchNodeLabelProvider.java
===================================================================
--- workspace/bfitzpat/org.jboss.tools.uddi.ui/src/org/jboss/tools/uddi/ui/connection/UDDISearchNodeLabelProvider.java (rev 0)
+++ workspace/bfitzpat/org.jboss.tools.uddi.ui/src/org/jboss/tools/uddi/ui/connection/UDDISearchNodeLabelProvider.java 2011-12-06 16:05:33 UTC (rev 37004)
@@ -0,0 +1,46 @@
+package org.jboss.tools.uddi.ui.connection;
+
+import org.eclipse.datatools.connectivity.ui.navigator.ConnectionProfileLabelProvider;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.ui.ISharedImages;
+import org.eclipse.ui.internal.WorkbenchPlugin;
+import org.uddi.v3_service.UDDIInquiryPortType;
+
+@SuppressWarnings("restriction")
+public class UDDISearchNodeLabelProvider extends ConnectionProfileLabelProvider {
+
+ public UDDISearchNodeLabelProvider() {
+ super();
+ }
+
+ @Override
+ public Image getImage(Object element) {
+ Image image;
+ if (element instanceof DTPUDDIObject) {
+ Object inquiry = ((DTPUDDIObject) element).getInquiryPortType();
+ if (inquiry != null) {
+ image = WorkbenchPlugin.getDefault().getSharedImages()
+ .getImage(ISharedImages.IMG_OBJ_FOLDER);
+ } else {
+ image = WorkbenchPlugin.getDefault().getSharedImages()
+ .getImage(ISharedImages.IMG_OBJ_FILE);
+ }
+ } else {
+ image = super.getImage(element);
+ }
+ return image;
+ }
+
+ @Override
+ public String getText(Object element) {
+ String text;
+ if (element instanceof DTPUDDIObject) {
+ UDDIInquiryPortType inquiry = ((DTPUDDIObject) element).getInquiryPortType();
+ text = inquiry.toString();
+ } else {
+ text = super.getText(element);
+ }
+ return text;
+ }
+
+}
Property changes on: workspace/bfitzpat/org.jboss.tools.uddi.ui/src/org/jboss/tools/uddi/ui/connection/UDDISearchNodeLabelProvider.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
14 years
JBoss Tools SVN: r37003 - branches/jbosstools-3.3.0.M5/openshift/plugins/org.jboss.tools.openshift.express.ui/META-INF.
by jbosstools-commits@lists.jboss.org
Author: xcoulon
Date: 2011-12-06 10:51:48 -0500 (Tue, 06 Dec 2011)
New Revision: 37003
Modified:
branches/jbosstools-3.3.0.M5/openshift/plugins/org.jboss.tools.openshift.express.ui/META-INF/MANIFEST.MF
Log:
OPEN - issue JBIDE-10309: Invalid OpenShift Server Runtime label
https://issues.jboss.org/browse/JBIDE-10309
Modified: branches/jbosstools-3.3.0.M5/openshift/plugins/org.jboss.tools.openshift.express.ui/META-INF/MANIFEST.MF
===================================================================
--- branches/jbosstools-3.3.0.M5/openshift/plugins/org.jboss.tools.openshift.express.ui/META-INF/MANIFEST.MF 2011-12-06 15:46:09 UTC (rev 37002)
+++ branches/jbosstools-3.3.0.M5/openshift/plugins/org.jboss.tools.openshift.express.ui/META-INF/MANIFEST.MF 2011-12-06 15:51:48 UTC (rev 37003)
@@ -3,6 +3,7 @@
Bundle-Name: OpenShift UI
Bundle-SymbolicName: org.jboss.tools.openshift.express.ui;singleton:=true
Bundle-Version: 2.3.0.qualifier
+Bundle-Localization: plugin
Bundle-Activator: org.jboss.tools.openshift.express.internal.ui.OpenShiftUIActivator
Require-Bundle: org.jboss.tools.openshift.express.client;bundle-version="2.3.0",
org.eclipse.egit.ui;bundle-version="[1.0.0,2.0.0)",
14 years
JBoss Tools SVN: r37002 - in branches/jbosstools-3.3.0.M5/openshift/plugins/org.jboss.tools.openshift.express.ui: src/org/jboss/tools/openshift/express/internal/ui/console and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: xcoulon
Date: 2011-12-06 10:46:09 -0500 (Tue, 06 Dec 2011)
New Revision: 37002
Added:
branches/jbosstools-3.3.0.M5/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/console/ConsoleRemoveAction.java
branches/jbosstools-3.3.0.M5/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/console/ConsoleTypePropertyTester.java
branches/jbosstools-3.3.0.M5/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/console/TailConsolePageParticipant.java
Modified:
branches/jbosstools-3.3.0.M5/openshift/plugins/org.jboss.tools.openshift.express.ui/plugin.xml
branches/jbosstools-3.3.0.M5/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/console/ConsoleUtils.java
branches/jbosstools-3.3.0.M5/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/console/TailServerLogAction.java
branches/jbosstools-3.3.0.M5/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/console/TailServerLogWorker.java
Log:
OPEN - issue JBIDE-10152: enable console for openshift server rhc-tailfiles
https://issues.jboss.org/browse/JBIDE-10152
Applied patch
Modified: branches/jbosstools-3.3.0.M5/openshift/plugins/org.jboss.tools.openshift.express.ui/plugin.xml
===================================================================
--- branches/jbosstools-3.3.0.M5/openshift/plugins/org.jboss.tools.openshift.express.ui/plugin.xml 2011-12-06 15:35:54 UTC (rev 37001)
+++ branches/jbosstools-3.3.0.M5/openshift/plugins/org.jboss.tools.openshift.express.ui/plugin.xml 2011-12-06 15:46:09 UTC (rev 37002)
@@ -146,21 +146,20 @@
<!-- Extensions to Server View to provide 'tail' of the remote server.log file -->
- <!-- disabled for now
<extension point="org.eclipse.ui.navigator.navigatorContent">
<actionProvider
class="org.jboss.tools.openshift.express.internal.ui.console.TailServerLogActionProvider"
id="org.jboss.tools.openshift.express.ui.internal.ui.console.tailServerLogActionProvider">
<enablement>
- <and>
- <instanceof
- value="org.eclipse.wst.server.core.IServer">
- </instanceof>
- <test
- forcePluginActivation="true"
- property="org.jboss.tools.openshift.express.isOpenShiftServer">
- </test>
- </and>
+ <and>
+ <instanceof
+ value="org.eclipse.wst.server.core.IServer">
+ </instanceof>
+ <test
+ forcePluginActivation="true"
+ property="org.jboss.tools.openshift.express.isOpenShiftServer">
+ </test>
+ </and>
</enablement>
</actionProvider>
</extension>
@@ -177,6 +176,26 @@
</extension>
<extension
+ point="org.eclipse.ui.console.consolePageParticipants">
+ <consolePageParticipant
+ class="org.jboss.tools.openshift.express.internal.ui.console.TailConsolePageParticipant"
+ id="org.jboss.tools.openshift.express.ui.tailConsolePageParticipant">
+ <enablement>
+ <and>
+ <instanceof
+ value="org.eclipse.ui.console.MessageConsole">
+ </instanceof>
+ <test
+ forcePluginActivation="true"
+ property="org.jboss.tools.openshift.express.isOpenShiftConsole">
+ </test>
+ </and>
+ </enablement>
+ </consolePageParticipant>
+ </extension>
+
+
+ <extension
point="org.eclipse.core.expressions.propertyTesters">
<propertyTester
class="org.jboss.tools.openshift.express.internal.ui.console.ServerTypePropertyTester"
@@ -185,9 +204,15 @@
properties="isOpenShiftServer"
type="org.eclipse.wst.server.core.IServer">
</propertyTester>
+ <propertyTester
+ class="org.jboss.tools.openshift.express.internal.ui.console.ConsoleTypePropertyTester"
+ id="org.jboss.tools.openshift.express.ui.consoleTypePropertyTester"
+ namespace="org.jboss.tools.openshift.express"
+ properties="isOpenShiftConsole"
+ type="org.eclipse.ui.console.MessageConsole">
+ </propertyTester>
</extension>
- -->
<extension point="org.eclipse.ui.editors.templates">
<template id="org.jboss.tools.maven.editor.xml.templates.profiles.openshift"
contextTypeId="org.eclipse.m2e.editor.xml.templates.contextType.profiles"
@@ -214,4 +239,7 @@
</profile></pattern>
</template>
</extension>
+
+
+
</plugin>
Added: branches/jbosstools-3.3.0.M5/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/console/ConsoleRemoveAction.java
===================================================================
--- branches/jbosstools-3.3.0.M5/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/console/ConsoleRemoveAction.java (rev 0)
+++ branches/jbosstools-3.3.0.M5/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/console/ConsoleRemoveAction.java 2011-12-06 15:46:09 UTC (rev 37002)
@@ -0,0 +1,15 @@
+package org.jboss.tools.openshift.express.internal.ui.console;
+
+import java.security.Policy;
+
+import org.eclipse.jface.action.Action;
+
+public class ConsoleRemoveAction extends Action {
+
+ ConsoleRemoveAction() {
+ }
+
+ @Override
+ public void run() {
+ }
+}
\ No newline at end of file
Property changes on: branches/jbosstools-3.3.0.M5/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/console/ConsoleRemoveAction.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: branches/jbosstools-3.3.0.M5/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/console/ConsoleTypePropertyTester.java
===================================================================
--- branches/jbosstools-3.3.0.M5/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/console/ConsoleTypePropertyTester.java (rev 0)
+++ branches/jbosstools-3.3.0.M5/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/console/ConsoleTypePropertyTester.java 2011-12-06 15:46:09 UTC (rev 37002)
@@ -0,0 +1,33 @@
+/**
+ *
+ */
+package org.jboss.tools.openshift.express.internal.ui.console;
+
+import org.eclipse.core.expressions.PropertyTester;
+import org.eclipse.ui.console.MessageConsole;
+import static org.jboss.tools.openshift.express.internal.ui.console.ConsoleUtils.*;
+
+/**
+ * Property tester used to verify that the given instance of
+ * <code>org.eclipse.ui.console.MessageConsole</code> is an OpenShift Message
+ * Console (that is, it should contain a specific attribute set a its creation).
+ *
+ * @author Xavier Coulon
+ *
+ */
+public class ConsoleTypePropertyTester extends PropertyTester {
+
+ /**
+ * Verifies that the given receiver, a <code>MessageConsole</code> contains
+ * an attribute name <code>ConsoleUtils.CONSOLE_TYPE_KEY</code> with a value
+ * set to <code>ConsoleUtils.CONSOLE_TYPE_VALUE</code>. Using the console
+ * attributes avoids the need to create a subtype of
+ * <code>MessageCode</code>.
+ */
+ @Override
+ public boolean test(Object receiver, String property, Object[] args, Object expectedValue) {
+ MessageConsole console = (MessageConsole) receiver;
+ return (CONSOLE_TYPE_VALUE.equals(console.getAttribute(CONSOLE_TYPE_KEY)));
+ }
+
+}
Property changes on: branches/jbosstools-3.3.0.M5/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/console/ConsoleTypePropertyTester.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: branches/jbosstools-3.3.0.M5/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/console/ConsoleUtils.java
===================================================================
--- branches/jbosstools-3.3.0.M5/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/console/ConsoleUtils.java 2011-12-06 15:35:54 UTC (rev 37001)
+++ branches/jbosstools-3.3.0.M5/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/console/ConsoleUtils.java 2011-12-06 15:46:09 UTC (rev 37002)
@@ -18,14 +18,54 @@
import org.eclipse.ui.console.ConsolePlugin;
import org.eclipse.ui.console.IConsole;
import org.eclipse.ui.console.IConsoleConstants;
+import org.eclipse.ui.console.IConsoleListener;
import org.eclipse.ui.console.IConsoleManager;
import org.eclipse.ui.console.IConsoleView;
import org.eclipse.ui.console.MessageConsole;
import org.jboss.tools.openshift.express.internal.utils.Logger;
+/**
+ * A utility class to manager the message consoles creations and retrivals
+ *
+ * @author Xavier Coulon
+ *
+ */
public class ConsoleUtils {
-
+ /**
+ * Constant key set into the created message console attributes to mark the
+ * given console as an 'openshift' one.
+ */
+ public static final String CONSOLE_TYPE_KEY = "ConsoleType";
+
+ /**
+ * Constant value set into the created message console attributes to mark
+ * the given console as an 'openshift' one.
+ */
+ public static final String CONSOLE_TYPE_VALUE = "OpenShiftTailConsole";
+
+ /**
+ * Registers the given listener as a console listener.
+ *
+ * @param consoleListener
+ */
+ public static void registerConsoleListener(IConsoleListener consoleListener) {
+ ConsolePlugin plugin = ConsolePlugin.getDefault();
+ IConsoleManager consoleManager = plugin.getConsoleManager();
+ consoleManager.addConsoleListener(consoleListener);
+ }
+
+ /**
+ * Retrieve the message console given its name. If no console exists yet, a
+ * new one is created with a specifi attribute to mark it as an 'openshift'
+ * console. This attribute (or marker) is use later on by the
+ * ConsoleTypePropertyTester to add a 'remove' button on the console in the
+ * consoles view.
+ *
+ * @param name
+ * the name of the console to find
+ * @return the message console (found or created)
+ */
public static MessageConsole findMessageConsole(String name) {
ConsolePlugin plugin = ConsolePlugin.getDefault();
IConsoleManager consoleManager = plugin.getConsoleManager();
@@ -37,10 +77,17 @@
}
// no console found, so create a new one
MessageConsole console = new MessageConsole(name, null);
+ console.setAttribute(CONSOLE_TYPE_KEY, CONSOLE_TYPE_VALUE);
consoleManager.addConsoles(new IConsole[] { console });
return console;
}
-
+
+ /**
+ * Displays the given console in the consoles view which becomes visible if
+ * it was not the case before.
+ *
+ * @param console the console to display
+ */
public static void displayConsoleView(IConsole console) {
IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
if (window != null) {
Added: branches/jbosstools-3.3.0.M5/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/console/TailConsolePageParticipant.java
===================================================================
--- branches/jbosstools-3.3.0.M5/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/console/TailConsolePageParticipant.java (rev 0)
+++ branches/jbosstools-3.3.0.M5/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/console/TailConsolePageParticipant.java 2011-12-06 15:46:09 UTC (rev 37002)
@@ -0,0 +1,51 @@
+/**
+ *
+ */
+package org.jboss.tools.openshift.express.internal.ui.console;
+
+import org.eclipse.ui.IActionBars;
+import org.eclipse.ui.console.IConsole;
+import org.eclipse.ui.console.IConsoleConstants;
+import org.eclipse.ui.console.IConsolePageParticipant;
+import org.eclipse.ui.console.actions.CloseConsoleAction;
+import org.eclipse.ui.part.IPageBookViewPage;
+
+/**
+ * Console helper that allows contributing actions to the console view when the
+ * Tail console is visible. Added to the console via an extension point from
+ * org.eclipse.ui.console.
+ *
+ * @author Xavier Coulon
+ *
+ */
+public class TailConsolePageParticipant implements IConsolePageParticipant {
+
+ /** The standard Eclipse UI CloseConsoleAction.*/
+ private CloseConsoleAction closeConsoleAction;
+
+ public void init(IPageBookViewPage page, IConsole console) {
+ this.closeConsoleAction = new CloseConsoleAction(console);
+ IActionBars bars = page.getSite().getActionBars();
+ bars.getToolBarManager().appendToGroup(IConsoleConstants.LAUNCH_GROUP, closeConsoleAction);
+ }
+
+ public void dispose() {
+ this.closeConsoleAction = null;
+ }
+
+ public void activated() {
+ }
+
+ public void deactivated() {
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class)
+ */
+ public Object getAdapter(Class adapter) {
+ return null;
+ }
+
+}
Property changes on: branches/jbosstools-3.3.0.M5/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/console/TailConsolePageParticipant.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: branches/jbosstools-3.3.0.M5/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/console/TailServerLogAction.java
===================================================================
--- branches/jbosstools-3.3.0.M5/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/console/TailServerLogAction.java 2011-12-06 15:35:54 UTC (rev 37001)
+++ branches/jbosstools-3.3.0.M5/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/console/TailServerLogAction.java 2011-12-06 15:46:09 UTC (rev 37002)
@@ -16,7 +16,9 @@
import org.eclipse.jgit.transport.URIish;
import org.eclipse.jgit.util.FS;
import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.console.IConsole;
import org.eclipse.ui.console.IConsoleConstants;
+import org.eclipse.ui.console.IConsoleListener;
import org.eclipse.ui.console.MessageConsole;
import org.eclipse.ui.navigator.CommonViewer;
import org.eclipse.ui.views.IViewDescriptor;
@@ -25,20 +27,29 @@
import org.eclipse.wst.server.ui.IServerModule;
import org.jboss.tools.openshift.express.internal.client.utils.Base64Encoder;
import org.jboss.tools.openshift.express.internal.core.behaviour.ExpressServerUtils;
-import org.jboss.tools.openshift.express.internal.ui.console.TailServerLogWorker.MyLogger;
+import org.jboss.tools.openshift.express.internal.ui.console.TailServerLogWorker.JschToEclipseLogger;
import org.jboss.tools.openshift.express.internal.ui.messages.OpenShiftExpressUIMessages;
import org.jboss.tools.openshift.express.internal.utils.Logger;
import com.jcraft.jsch.JSch;
import com.jcraft.jsch.JSchException;
-public class TailServerLogAction extends Action implements ISelectionChangedListener {
+/**
+ * The action associated with the "Show In>Remote Console" menu item.
+ *
+ * @author Xavier Coulon
+ *
+ */
+public class TailServerLogAction extends Action implements ISelectionChangedListener, IConsoleListener {
/** The current selection in the view. */
private ISelection selection = null;
- /** The threads that provide the 'log tail' in the console view. */
- private Map<String, TailServerLogWorker> tailRunners = new HashMap<String, TailServerLogWorker>();
+ /**
+ * The message consoles associated with the 'tail' workers that write the
+ * output.
+ */
+ private Map<String, TailServerLogWorker> consoleWorkers = new HashMap<String, TailServerLogWorker>();
/**
* Constructor
@@ -48,26 +59,26 @@
IViewRegistry reg = PlatformUI.getWorkbench().getViewRegistry();
IViewDescriptor desc = reg.find(IConsoleConstants.ID_CONSOLE_VIEW);
setImageDescriptor(desc.getImageDescriptor());
+ ConsoleUtils.registerConsoleListener(this);
}
/**
+ * Operation called when the user clicks on 'Show In>Remote Console'. If no
+ * Console/Worker existed, a new one is created, otherwise, it is displayed.
* {@inheritDoc}
*/
@Override
public void run() {
final IServer server = getServer();
if (ExpressServerUtils.isOpenShiftRuntime(server)) {
- // start a new thread to which we delegate the remote shell
- // connection + tail command
- final String serverId = server.getId();
MessageConsole console = ConsoleUtils.findMessageConsole(server.getId());
- if (!tailRunners.containsKey(serverId)) {
- TailServerLogWorker tailServerLogRunner;
+ String consoleName = console.getName();
+ if (!this.consoleWorkers.containsKey(consoleName)) {
try {
- final Process process = startTailProcess(server);
- tailServerLogRunner = new TailServerLogWorker(server, console, process);
- tailRunners.put(serverId, tailServerLogRunner);
- Thread thread = new Thread(tailServerLogRunner);
+ final TailServerLogWorker tailServerLogWorker = startTailProcess(server, console);
+ consoleWorkers.put(consoleName, tailServerLogWorker);
+ consoleWorkers.put(console.getName(), tailServerLogWorker);
+ Thread thread = new Thread(tailServerLogWorker);
thread.start();
} catch (Exception e) {
Logger.error("Failed to retrieve remote server logs", e);
@@ -77,27 +88,51 @@
}
}
- private Process startTailProcess(IServer server) throws JSchException, IOException {
+ /**
+ * Starting the tail process on the remote OpenShift Platform. This method
+ * relies on the JGit SSH support (including JSch) to open a connection AND
+ * execute a command in a single invocation. The connection establishement
+ * requires an SSH key, and the passphrase is prompted to the user if
+ * necessary.
+ *
+ * @param server the server adapter on which the action is perforemd
+ * @param console the console into which the tail should be writtent
+ * @return the Worker that encapsulate the established RemoteSession, the tail Process and the output console
+ * @throws JSchException in case of underlying exception
+ * @throws IOException in case of underlying exception
+ */
+ private TailServerLogWorker startTailProcess(final IServer server, final MessageConsole console)
+ throws JSchException, IOException {
final String host = server.getHost();
final String appId = ExpressServerUtils.getExpressApplicationId(server);
final String appName = ExpressServerUtils.getExpressApplicationName(server);
- final String logFilePath = appName + "/logs/server.log";
- final String options = new String(Base64Encoder.encode("-f -n 100".getBytes("UTF-8")), "UTF-8");
+ final String logFilePath = appName + "/logs/*.log";
+ final String options = "-f -n 100";
-
- JSch.setLogger(new MyLogger());
+ JSch.setLogger(new JschToEclipseLogger());
final SshSessionFactory sshSessionFactory = SshSessionFactory.getInstance();
final URIish uri = new URIish().setHost(host).setUser(appId);
- final RemoteSession remoteSession = sshSessionFactory.getSession(uri, CredentialsProvider.getDefault(), FS.DETECTED, 100000);
-
+ RemoteSession remoteSession = sshSessionFactory.getSession(uri, CredentialsProvider.getDefault(), FS.DETECTED,
+ 0);
+
// the rhc-tail-files command template
// ssh_cmd =
// "ssh -t #{app_uuid}(a)#{app}-#{namespace}.#{rhc_domain} 'tail#{opt['opts'] ? ' --opts ' + Base64::encode64(opt['opts']).chomp : ''} #{file_glob}'"
final String command = buildCommand(logFilePath, options);
Process process = remoteSession.exec(command, 0);
- return process;
+ return new TailServerLogWorker(console, process, remoteSession);
+
}
+ /**
+ * Builds the 'ssh tail' command that should be executed on the remote
+ * OpenShift platform.
+ *
+ * @param filePath
+ * @param options
+ * @return
+ * @throws UnsupportedEncodingException
+ */
private String buildCommand(final String filePath, final String options) throws UnsupportedEncodingException {
StringBuilder commandBuilder = new StringBuilder("tail ");
if (options != null && !options.isEmpty()) {
@@ -106,7 +141,7 @@
}
commandBuilder.append(filePath);
final String command = commandBuilder.toString();
- System.out.println("cmd= '" + command + "'");
+ Logger.debug("ssh command to execute: " + command);
return command;
}
@@ -136,10 +171,31 @@
return null;
}
- public IServerModule getServerModule() {
- if (selection instanceof IServerModule)
- return ((IServerModule) selection);
- return null;
+ @Override
+ public void consolesAdded(IConsole[] consoles) {
+ // don't do anything special
}
+ /**
+ * Operation to perform when the console is removed (through the
+ * CloseConsoleAction that was brung by the
+ * <code>TailConsolePageParticipant</code>). In the current case, the
+ * associated worker is stopped and the console/worker are removed from the
+ * map, so that further 'Show In>Remote Console' invocation will trigger a
+ * new worker process.
+ */
+ @Override
+ public void consolesRemoved(IConsole[] consoles) {
+ // if the console is associated with a 'tail' process, stop that process
+ for (IConsole console : consoles) {
+ final String consoleName = console.getName();
+ if (consoleWorkers.containsKey(consoleName)) {
+ final TailServerLogWorker worker = consoleWorkers.get(consoleName);
+ worker.stop();
+ consoleWorkers.remove(consoleName);
+ }
+ }
+
+ }
+
}
Modified: branches/jbosstools-3.3.0.M5/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/console/TailServerLogWorker.java
===================================================================
--- branches/jbosstools-3.3.0.M5/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/console/TailServerLogWorker.java 2011-12-06 15:35:54 UTC (rev 37001)
+++ branches/jbosstools-3.3.0.M5/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/console/TailServerLogWorker.java 2011-12-06 15:46:09 UTC (rev 37002)
@@ -3,27 +3,43 @@
import java.io.BufferedReader;
import java.io.InputStream;
import java.io.InputStreamReader;
-import java.io.UnsupportedEncodingException;
+import org.eclipse.jgit.transport.RemoteSession;
import org.eclipse.ui.console.MessageConsole;
-import org.eclipse.wst.server.core.IServer;
-import com.jcraft.jsch.JSchException;
import com.jcraft.jsch.Logger;
+/**
+ * The underlying 'Tail' worker, that uses an established RemoteSession (with
+ * the help of JGit), runs in a dedicated process and displays the outputstream
+ * into a specific console. This worker is a <code>java.lang.Runnable</code> in
+ * order to run in a separate thread
+ *
+ * @author Xavier Coulon
+ *
+ */
public class TailServerLogWorker implements Runnable {
- private final IServer server;
-
+ /** the remote 'tail' process. */
private final Process process;
+ /** the output message console. */
private final MessageConsole console;
- public TailServerLogWorker(final IServer server, final MessageConsole console, final Process process) throws UnsupportedEncodingException,
- JSchException {
- this.server = server;
+ /** the SSH session. */
+ private final RemoteSession remoteSession;
+
+ /**
+ * Constructor.
+ *
+ * @param console
+ * @param process
+ * @param remoteSession
+ */
+ public TailServerLogWorker(final MessageConsole console, final Process process, final RemoteSession remoteSession) {
this.console = console;
this.process = process;
+ this.remoteSession = remoteSession;
}
@Override
@@ -41,14 +57,28 @@
org.jboss.tools.openshift.express.internal.utils.Logger.error(
"Error while receiving the remote server log", e);
} finally {
-
}
}
-
+ /**
+ * Method called when the overall 'tail' process should be stopped: the
+ * underlying ssh remote session must be disconnected and the running
+ * process must be destroyed.
+ */
+ public void stop() {
+ this.remoteSession.disconnect();
+ this.process.destroy();
+ }
- static class MyLogger implements Logger {
+ /**
+ * Bridge between the JSch logger and the Eclipse logger (to ouput results
+ * in the .log files and/or into the 'Error log' view.
+ *
+ * @author Xavier Coulon
+ *
+ */
+ static class JschToEclipseLogger implements Logger {
static java.util.Hashtable<Integer, String> name = new java.util.Hashtable<Integer, String>();
static {
@@ -59,13 +89,26 @@
name.put(new Integer(FATAL), "FATAL: ");
}
+ @Override
public boolean isEnabled(int level) {
return true;
}
+ @Override
public void log(int level, String message) {
- System.err.print(name.get(new Integer(level)));
- System.err.println(message);
+ switch (level) {
+ case DEBUG:
+ case INFO:
+ org.jboss.tools.openshift.express.internal.utils.Logger.debug(message);
+ break;
+ case WARN:
+ org.jboss.tools.openshift.express.internal.utils.Logger.warn(message);
+ break;
+ case ERROR:
+ case FATAL:
+ org.jboss.tools.openshift.express.internal.utils.Logger.error(message);
+ break;
+ }
}
}
14 years
JBoss Tools SVN: r37001 - trunk/maven/plugins/org.jboss.tools.maven.core/src/org/jboss/tools/maven/core/internal/profiles.
by jbosstools-commits@lists.jboss.org
Author: fbricon
Date: 2011-12-06 10:35:54 -0500 (Tue, 06 Dec 2011)
New Revision: 37001
Modified:
trunk/maven/plugins/org.jboss.tools.maven.core/src/org/jboss/tools/maven/core/internal/profiles/ProfileManager.java
Log:
JBIDE-10170 : fix activation detection on profiles from settings.xml
Modified: trunk/maven/plugins/org.jboss.tools.maven.core/src/org/jboss/tools/maven/core/internal/profiles/ProfileManager.java
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.core/src/org/jboss/tools/maven/core/internal/profiles/ProfileManager.java 2011-12-06 15:06:07 UTC (rev 37000)
+++ trunk/maven/plugins/org.jboss.tools.maven.core/src/org/jboss/tools/maven/core/internal/profiles/ProfileManager.java 2011-12-06 15:35:54 UTC (rev 37001)
@@ -37,8 +37,6 @@
public class ProfileManager implements IProfileManager {
- private static final String ARTIFACT_SEPARATOR = ":"; //$NON-NLS-1$
-
public void updateActiveProfiles(final IMavenProjectFacade mavenProjectFacade,
final List<String> profiles,
final boolean isOffline,
@@ -90,7 +88,7 @@
for (org.apache.maven.settings.Profile sp : settings.getProfiles()) {
Profile p = SettingsUtils.convertFromSettingsProfile(sp);
- boolean isAutomaticallyActivated = isActive2(p, activeProfiles);
+ boolean isAutomaticallyActivated = isActive(sp, activeProfiles);
settingsProfiles.put(p, isAutomaticallyActivated);
}
return Collections.unmodifiableMap(settingsProfiles);
@@ -105,7 +103,10 @@
return false;
}
- private boolean isActive2(Profile p, List<String> activeProfiles) {
+ private boolean isActive(org.apache.maven.settings.Profile p, List<String> activeProfiles) {
+ if (p.getActivation() != null && p.getActivation().isActiveByDefault()){
+ return true;
+ }
for (String activeProfile : activeProfiles) {
if (activeProfile.equals(p.getId())) {
return true;
14 years