JBoss Tools SVN: r36890 - in trunk/openshift/plugins/org.jboss.tools.openshift.express.ui: src/org/jboss/tools/openshift/express/internal/core/behaviour and 5 other directories.
by jbosstools-commits@lists.jboss.org
Author: xcoulon
Date: 2011-12-02 13:11:38 -0500 (Fri, 02 Dec 2011)
New Revision: 36890
Added:
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/console/
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/console/ConsoleUtils.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/console/ServerTypePropertyTester.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/console/TailServerLogAction.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/console/TailServerLogActionProvider.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/console/TailServerLogWorker.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/messages/
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/messages/OpenShiftExpressUIMessages.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/messages/OpenShiftExpressUIMessages.properties
Modified:
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/plugin.xml
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/behaviour/ExpressServerUtils.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/behaviour/OpenShiftDeployUI.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ApplicationWizardModel.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ImportProjectWizardModel.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/NewApplicationWizardPage.java
Log:
OPEN - issue JBIDE-10152: enable console for openshift server rhc-tailfiles
https://issues.jboss.org/browse/JBIDE-10152
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/plugin.xml
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/plugin.xml 2011-12-02 18:10:47 UTC (rev 36889)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/plugin.xml 2011-12-02 18:11:38 UTC (rev 36890)
@@ -143,4 +143,48 @@
sourceLocatorId="org.eclipse.jdt.launching.sourceLocator.JavaSourceLookupDirector"
sourcePathComputerId="org.eclipse.jst.server.generic.core.sourcePathComputer"/>
</extension>
+
+ <!-- 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>
+ </enablement>
+ </actionProvider>
+ </extension>
+
+ <extension point="org.eclipse.ui.navigator.viewer">
+ <viewerContentBinding viewerId="org.eclipse.wst.server.ui.ServersView">
+ </viewerContentBinding>
+ <viewerActionBinding viewerId="org.eclipse.wst.server.ui.ServersView">
+ <includes>
+ <actionExtension
+ pattern="org.jboss.tools.openshift.express.ui.internal.ui.console.tailServerLogActionProvider"/>
+ </includes>
+ </viewerActionBinding>
+ </extension>
+
+ <extension
+ point="org.eclipse.core.expressions.propertyTesters">
+ <propertyTester
+ class="org.jboss.tools.openshift.express.internal.ui.console.ServerTypePropertyTester"
+ id="org.jboss.tools.openshift.express.ui.serverTypePropertyTester"
+ namespace="org.jboss.tools.openshift.express"
+ properties="isOpenShiftServer"
+ type="org.eclipse.wst.server.core.IServer">
+ </propertyTester>
+ </extension>
+ -->
</plugin>
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/behaviour/ExpressServerUtils.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/behaviour/ExpressServerUtils.java 2011-12-02 18:10:47 UTC (rev 36889)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/behaviour/ExpressServerUtils.java 2011-12-02 18:11:38 UTC (rev 36890)
@@ -23,6 +23,7 @@
import org.jboss.ide.eclipse.as.core.util.IJBossToolingConstants;
import org.jboss.ide.eclipse.as.core.util.RuntimeUtils;
import org.jboss.ide.eclipse.as.core.util.ServerCreationUtils;
+import org.jboss.tools.openshift.express.internal.ui.OpenShiftUIActivator;
/**
* This class holds the attribute names whose values will be
@@ -35,11 +36,15 @@
public static final String ATTRIBUTE_EXPRESS_MODE = "org.jboss.tools.openshift.express.internal.core.behaviour.ExpressMode";
public static final String EXPRESS_BINARY_MODE = "org.jboss.tools.openshift.express.internal.core.behaviour.ExpressBinaryMode";
public static final String EXPRESS_SOURCE_MODE = "org.jboss.tools.openshift.express.internal.core.behaviour.ExpressSourceMode";
- public static final String ATTRIBUTE_APPLICATION = "org.jboss.tools.openshift.express.internal.core.behaviour.Application";
+ public static final String ATTRIBUTE_APPLICATION_NAME = "org.jboss.tools.openshift.express.internal.core.behaviour.ApplicationName";
+ public static final String ATTRIBUTE_APPLICATION_ID = "org.jboss.tools.openshift.express.internal.core.behaviour.ApplicationId";
public static final String ATTRIBUTE_DOMAIN = "org.jboss.tools.openshift.express.internal.core.behaviour.Domain";
public static final String ATTRIBUTE_USERNAME = "org.jboss.tools.openshift.express.internal.core.behaviour.Username";
public static final String ATTRIBUTE_PASSWORD = "org.jboss.tools.openshift.express.internal.core.behaviour.Password";
+ /** the OpensHift Server Type as defined in the plugin.xml.*/
+ public static final String OPENSHIFT_SERVER_TYPE = "org.jboss.tools.openshift.express.openshift.server.type";
+
public static String getExpressMode(IServerAttributes attributes ) {
return attributes.getAttribute(ATTRIBUTE_EXPRESS_MODE, EXPRESS_SOURCE_MODE);
}
@@ -57,13 +62,17 @@
return wc.save(false, new NullProgressMonitor());
}
- public static String getExpressApplication(IServerAttributes attributes ) {
- return attributes.getAttribute(ATTRIBUTE_APPLICATION, (String)null);
+ public static String getExpressApplicationName(IServerAttributes attributes ) {
+ return attributes.getAttribute(ATTRIBUTE_APPLICATION_NAME, (String)null);
}
+ public static String getExpressApplicationId(IServerAttributes attributes ) {
+ return attributes.getAttribute(ATTRIBUTE_APPLICATION_ID, (String)null);
+ }
+
public static IServer setExpressApplication(IServer server, String val) throws CoreException {
IServerWorkingCopy wc = server.createWorkingCopy();
- wc.setAttribute(ATTRIBUTE_APPLICATION, val);
+ wc.setAttribute(ATTRIBUTE_APPLICATION_NAME, val);
return wc.save(false, new NullProgressMonitor());
}
@@ -108,7 +117,7 @@
* @param username
* @param password
* @param domain
- * @param app
+ * @param appName
* @param sourceOrBinary
* @param localRuntimeHomeDir
* @return
@@ -116,13 +125,13 @@
*/
public static IServer createAS7OpenShiftServer(
String host, String username, String password,
- String domain, String app,
+ String domain, String appName, String appId,
String sourceOrBinary,
String localRuntimeHomeDir) throws CoreException {
IServer server = createServerAndRuntime(IJBossToolingConstants.AS_70,
IJBossToolingConstants.SERVER_AS_70,
localRuntimeHomeDir, /* irrelevant */ "default");
- return fillServerWithOpenShiftDetails(server, host, username, password, domain, app, sourceOrBinary);
+ return fillServerWithOpenShiftDetails(server, host, username, password, domain, appName, appId, sourceOrBinary);
}
/**
@@ -133,7 +142,7 @@
* @param username
* @param password
* @param domain
- * @param app
+ * @param appName
* @param sourceOrBinary
* @param runtime
* @return
@@ -141,10 +150,10 @@
*/
public static IServer createAS7OpenShiftServer(
String host, String username, String password,
- String domain, String app, String sourceOrBinary,
+ String domain, String appName, String appId, String sourceOrBinary,
IRuntime runtime) throws CoreException {
IServer server = createServer(runtime, IJBossToolingConstants.SERVER_AS_70);
- return fillServerWithOpenShiftDetails(server, host, username, password, domain, app, sourceOrBinary);
+ return fillServerWithOpenShiftDetails(server, host, username, password, domain, appName, appId, sourceOrBinary);
}
/**
@@ -155,13 +164,14 @@
* @param username
* @param password
* @param domain
- * @param app
+ * @param appName
* @param sourceOrBinary
* @return
* @throws CoreException
*/
+ @SuppressWarnings("restriction")
public static IServer fillServerWithOpenShiftDetails(IServer server,
- String host, String username, String password, String domain, String app,
+ String host, String username, String password, String domain, String appName, String appId,
String mode) throws CoreException {
if( host.indexOf("://") != -1)
host = host.substring(host.indexOf("://") + 3);
@@ -173,7 +183,8 @@
wc.setAttribute(ATTRIBUTE_USERNAME, username);
wc.setAttribute(ATTRIBUTE_PASSWORD, password);
wc.setAttribute(ATTRIBUTE_DOMAIN, domain);
- wc.setAttribute(ATTRIBUTE_APPLICATION, app);
+ wc.setAttribute(ATTRIBUTE_APPLICATION_NAME, appName);
+ wc.setAttribute(ATTRIBUTE_APPLICATION_ID, appId);
wc.setAttribute(ATTRIBUTE_EXPRESS_MODE, mode);
wc.setAutoPublishSetting(Server.AUTO_PUBLISH_DISABLE);
wc.setAttribute(IJBossToolingConstants.IGNORE_LAUNCH_COMMANDS, "true");
@@ -196,5 +207,15 @@
public static IServer createServer(IRuntime runtime, IServerType serverType, String serverName) throws CoreException {
return ServerCreationUtils.createServer2(runtime, serverType, serverName, "openshift");
}
+
+ /**
+ * Returns true if the given server is an OpenShift one, false otherwise.
+ * @param server the server to check
+ * @return true or false
+ */
+ public static boolean isOpenShiftRuntime(IServer server) {
+ final String serverTypeId = server.getServerType().getId();
+ return (OPENSHIFT_SERVER_TYPE.equals(serverTypeId));
+ }
}
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/behaviour/OpenShiftDeployUI.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/behaviour/OpenShiftDeployUI.java 2011-12-02 18:10:47 UTC (rev 36889)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/behaviour/OpenShiftDeployUI.java 2011-12-02 18:11:38 UTC (rev 36890)
@@ -60,7 +60,7 @@
Label domainLabel = new Label(composite, SWT.NONE);
domainLabel.setText("Domain: " + ExpressServerUtils.getExpressDomain(callback.getServer()));
Label appLabel = new Label(composite, SWT.NONE);
- appLabel.setText("App: " + ExpressServerUtils.getExpressApplication(callback.getServer()));
+ appLabel.setText("App: " + ExpressServerUtils.getExpressApplicationName(callback.getServer()));
Label modeLabel = new Label(composite, SWT.NONE);
modeLabel.setText("Mode: " + ExpressServerUtils.getExpressModeAsString(callback.getServer()));
Added: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/console/ConsoleUtils.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/console/ConsoleUtils.java (rev 0)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/console/ConsoleUtils.java 2011-12-02 18:11:38 UTC (rev 36890)
@@ -0,0 +1,69 @@
+/*******************************************************************************
+ * Copyright (c) 2011 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.openshift.express.internal.ui.console;
+
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.console.ConsolePlugin;
+import org.eclipse.ui.console.IConsole;
+import org.eclipse.ui.console.IConsoleConstants;
+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;
+
+public class ConsoleUtils {
+
+
+ public static MessageConsole findMessageConsole(String name) {
+ ConsolePlugin plugin = ConsolePlugin.getDefault();
+ IConsoleManager consoleManager = plugin.getConsoleManager();
+ IConsole[] existing = consoleManager.getConsoles();
+ for (int i = 0; i < existing.length; i++) {
+ if (name.equals(existing[i].getName())) {
+ return (MessageConsole) existing[i];
+ }
+ }
+ // no console found, so create a new one
+ MessageConsole console = new MessageConsole(name, null);
+ consoleManager.addConsoles(new IConsole[] { console });
+ return console;
+ }
+
+ public static void displayConsoleView(IConsole console) {
+ IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
+ if (window != null) {
+ IWorkbenchPage page = window.getActivePage();
+ if (page != null) {
+ IWorkbenchPart part = page.findView(IConsoleConstants.ID_CONSOLE_VIEW);
+ if (part == null) {
+ try {
+ part = page.showView(IConsoleConstants.ID_CONSOLE_VIEW);
+ } catch (PartInitException e) {
+ Logger.warn("Could not open console view", e);
+ }
+ }
+ if (part != null) {
+ page.activate(part);
+ IConsoleView view = (IConsoleView) part.getAdapter(IConsoleView.class);
+ if (view != null) {
+ view.setFocus();
+ view.display(console);
+ }
+ }
+ }
+ }
+ }
+
+}
Property changes on: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/console/ConsoleUtils.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/console/ServerTypePropertyTester.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/console/ServerTypePropertyTester.java (rev 0)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/console/ServerTypePropertyTester.java 2011-12-02 18:11:38 UTC (rev 36890)
@@ -0,0 +1,25 @@
+package org.jboss.tools.openshift.express.internal.ui.console;
+
+import org.eclipse.core.expressions.PropertyTester;
+import org.eclipse.wst.server.core.IServer;
+import org.jboss.tools.openshift.express.internal.core.behaviour.ExpressServerUtils;
+
+/**
+ * Property tester used to compare the given Server's serverTypeId with a given value.
+ * This property tester is configured in the plugin.xml file and used to display extra menus item only when the server is on OpenShift one.
+ *
+ * @author Xavier Coulon
+ *
+ */
+public class ServerTypePropertyTester extends PropertyTester {
+
+ @Override
+ public boolean test(final Object receiver, final String property, final Object[] args, final Object expectedValue) {
+ if(receiver instanceof IServer) {
+ return ExpressServerUtils.isOpenShiftRuntime((IServer) receiver);
+ }
+
+ return false;
+ }
+
+}
Property changes on: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/console/ServerTypePropertyTester.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/console/TailServerLogAction.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/console/TailServerLogAction.java (rev 0)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/console/TailServerLogAction.java 2011-12-02 18:11:38 UTC (rev 36890)
@@ -0,0 +1,167 @@
+package org.jboss.tools.openshift.express.internal.ui.console;
+
+import java.io.IOException;
+import java.io.UnsupportedEncodingException;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.ISelectionChangedListener;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.SelectionChangedEvent;
+import org.eclipse.jgit.transport.RemoteSession;
+import org.eclipse.jgit.transport.SshSessionFactory;
+import org.eclipse.jgit.transport.URIish;
+import org.eclipse.jgit.util.FS;
+import org.eclipse.jsch.core.IJSchService;
+import org.eclipse.jsch.internal.core.JSchLocation;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.console.IConsoleConstants;
+import org.eclipse.ui.console.MessageConsole;
+import org.eclipse.ui.navigator.CommonViewer;
+import org.eclipse.ui.views.IViewDescriptor;
+import org.eclipse.ui.views.IViewRegistry;
+import org.eclipse.wst.server.core.IServer;
+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.OpenShiftUIActivator;
+import org.jboss.tools.openshift.express.internal.ui.console.TailServerLogWorker.MyLogger;
+import org.jboss.tools.openshift.express.internal.ui.messages.OpenShiftExpressUIMessages;
+import org.jboss.tools.openshift.express.internal.utils.Logger;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.ServiceReference;
+
+import com.jcraft.jsch.Channel;
+import com.jcraft.jsch.ChannelExec;
+import com.jcraft.jsch.JSch;
+import com.jcraft.jsch.JSchException;
+import com.jcraft.jsch.Session;
+
+public class TailServerLogAction extends Action implements ISelectionChangedListener {
+
+ /** 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>();
+
+ /**
+ * Constructor
+ */
+ public TailServerLogAction() {
+ super(OpenShiftExpressUIMessages.TAIL_SERVER_LOG_ACTION);
+ IViewRegistry reg = PlatformUI.getWorkbench().getViewRegistry();
+ IViewDescriptor desc = reg.find(IConsoleConstants.ID_CONSOLE_VIEW);
+ setImageDescriptor(desc.getImageDescriptor());
+ }
+
+ /**
+ * {@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;
+ try {
+ final Channel channel = initSshChannel(server);
+ tailServerLogRunner = new TailServerLogWorker(server, console, channel);
+ tailRunners.put(serverId, tailServerLogRunner);
+ Thread thread = new Thread(tailServerLogRunner);
+ thread.start();
+ } catch (Exception e) {
+ Logger.error("Failed to retrieve remote server logs", e);
+ }
+ }
+ ConsoleUtils.displayConsoleView(console);
+ }
+ }
+
+ private Channel initSshChannel(IServer server) 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");
+
+
+ JSch.setLogger(new MyLogger());
+ final SshSessionFactory sshSessionFactory = SshSessionFactory.getInstance();
+ final URIish uri = new URIish();
+ uri.setHost(host);
+ uri.setUser(appId);
+ final FS local = FS.detect();
+ final RemoteSession remoteSession = sshSessionFactory.getSession(uri, null, local, 100000);
+
+ //BundleContext context = OpenShiftUIActivator.getDefault().getBundle().getBundleContext();
+ //final ServiceReference<IJSchService> ssh = context.getServiceReference(IJSchService.class);
+ //final IJSchService jschService = context.getService(ssh);
+ // when the createSession method below take a null UserInfo param, it creates a new one that can't be initialized here (not a public class)
+ //final Session session = jschService.createSession(new JSchLocation(appId, host), null);
+ //jschService.connect(session, 0, new NullProgressMonitor());
+
+ // 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);
+ //final Channel channel = session.openChannel("exec");
+ //((ChannelExec) channel).setCommand(command);
+ //channel.connect();
+ //return channel;
+ return null;
+ }
+
+ private String buildCommand(final String filePath, final String options) throws UnsupportedEncodingException {
+ StringBuilder commandBuilder = new StringBuilder("tail ");
+ if (options != null && !options.isEmpty()) {
+ final String opts = new String(Base64Encoder.encode(options.getBytes("UTF-8")), "UTF-8");
+ commandBuilder.append("--opts ").append(opts).append(" ");
+ }
+ commandBuilder.append(filePath);
+ final String command = commandBuilder.toString();
+ System.out.println("cmd= '" + command + "'");
+ return command;
+ }
+
+ @Override
+ public void selectionChanged(SelectionChangedEvent event) {
+ Object source = event.getSource();
+ if (source instanceof CommonViewer) {
+ this.selection = ((CommonViewer) source).getSelection();
+ }
+ }
+
+ public void setSelection(ISelection selection) {
+ this.selection = selection;
+
+ }
+
+ public IServer getServer() {
+ if (selection instanceof IStructuredSelection) {
+ final Object selectedItem = ((IStructuredSelection) selection).getFirstElement();
+ if (selectedItem instanceof IServer) {
+ return ((IServer) selectedItem);
+ }
+ if (selectedItem instanceof IServerModule) {
+ return ((IServerModule) selectedItem).getServer();
+ }
+ }
+ return null;
+ }
+
+ public IServerModule getServerModule() {
+ if (selection instanceof IServerModule)
+ return ((IServerModule) selection);
+ return null;
+ }
+
+}
Property changes on: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/console/TailServerLogAction.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/console/TailServerLogActionProvider.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/console/TailServerLogActionProvider.java (rev 0)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/console/TailServerLogActionProvider.java 2011-12-02 18:11:38 UTC (rev 36890)
@@ -0,0 +1,47 @@
+package org.jboss.tools.openshift.express.internal.ui.console;
+
+import org.eclipse.jface.action.IMenuManager;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.ui.navigator.CommonActionProvider;
+import org.eclipse.ui.navigator.ICommonActionExtensionSite;
+import org.eclipse.ui.navigator.ICommonViewerSite;
+import org.eclipse.ui.navigator.ICommonViewerWorkbenchSite;
+import org.jboss.ide.eclipse.as.ui.views.server.extensions.CommonActionProviderUtils;
+
+public class TailServerLogActionProvider extends CommonActionProvider {
+
+ private TailServerLogAction action;
+
+ private ICommonActionExtensionSite actionExtensionSite;
+
+ public void init(ICommonActionExtensionSite actionExtensionSite) {
+ super.init(actionExtensionSite);
+ this.actionExtensionSite = actionExtensionSite;
+ ICommonViewerSite site = actionExtensionSite.getViewSite();
+ if (site instanceof ICommonViewerWorkbenchSite) {
+ action = new TailServerLogAction();
+ action.setSelection(actionExtensionSite.getStructuredViewer().getSelection());
+ actionExtensionSite.getStructuredViewer().addSelectionChangedListener(action);
+ }
+ }
+
+ public void fillContextMenu(IMenuManager menu) {
+ if (action != null && action.isEnabled()) {
+ //menu.insertBefore(ServerActionProvider.CONTROL_SERVER_SECTION_END_SEPARATOR, action);
+ CommonActionProviderUtils.addToShowInQuickSubMenu(action, menu, actionExtensionSite);
+
+ }
+ }
+
+ protected Object getSelection() {
+ ICommonViewerSite site = actionExtensionSite.getViewSite();
+ IStructuredSelection selection = null;
+ if (site instanceof ICommonViewerWorkbenchSite) {
+ ICommonViewerWorkbenchSite wsSite = (ICommonViewerWorkbenchSite) site;
+ selection = (IStructuredSelection) wsSite.getSelectionProvider().getSelection();
+ Object first = selection.getFirstElement();
+ return first;
+ }
+ return null;
+ }
+}
Property changes on: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/console/TailServerLogActionProvider.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/console/TailServerLogWorker.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/console/TailServerLogWorker.java (rev 0)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/console/TailServerLogWorker.java 2011-12-02 18:11:38 UTC (rev 36890)
@@ -0,0 +1,92 @@
+package org.jboss.tools.openshift.express.internal.ui.console;
+
+import java.io.BufferedReader;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.UnsupportedEncodingException;
+
+import org.eclipse.ui.console.MessageConsole;
+import org.eclipse.wst.server.core.IServer;
+import org.jboss.tools.openshift.express.internal.client.utils.Base64Encoder;
+import org.jboss.tools.openshift.express.internal.core.behaviour.ExpressServerUtils;
+
+import com.jcraft.jsch.Channel;
+import com.jcraft.jsch.ChannelExec;
+import com.jcraft.jsch.JSch;
+import com.jcraft.jsch.JSchException;
+import com.jcraft.jsch.Logger;
+import com.jcraft.jsch.Session;
+import com.jcraft.jsch.UserInfo;
+
+public class TailServerLogWorker implements Runnable {
+
+ private final IServer server;
+
+ private final Session session;
+
+ private final Channel channel;
+
+ private final MessageConsole console;
+
+ public TailServerLogWorker(final IServer server, final MessageConsole console, final Channel channel) throws UnsupportedEncodingException,
+ JSchException {
+ this.server = server;
+ this.console = console;
+ this.channel = channel;
+ this.session = channel.getSession();
+ }
+
+ @Override
+ public void run() {
+ try {
+ // get I/O streams for remote tail
+ final InputStream in = channel.getInputStream();
+ BufferedReader reader = new BufferedReader(new InputStreamReader(in));
+ String line;
+ // Read File Line By Line
+ while ((line = reader.readLine()) != null) {
+ console.newMessageStream().println(line);
+ }
+ if (!session.isConnected()) {
+ org.jboss.tools.openshift.express.internal.utils.Logger.warn("Session closed");
+
+ }
+ if (channel.isClosed()) {
+ org.jboss.tools.openshift.express.internal.utils.Logger.warn("Channel closed with exit status "
+ + channel.getExitStatus());
+ }
+ } catch (Throwable e) {
+ org.jboss.tools.openshift.express.internal.utils.Logger.error(
+ "Error while receiving the remote server log", e);
+ } finally {
+ org.jboss.tools.openshift.express.internal.utils.Logger.warn("Disconnecting from the remote server log");
+ session.disconnect();
+
+ }
+ }
+
+
+
+ static class MyLogger implements Logger {
+
+ static java.util.Hashtable<Integer, String> name = new java.util.Hashtable<Integer, String>();
+ static {
+ name.put(new Integer(DEBUG), "DEBUG: ");
+ name.put(new Integer(INFO), "INFO: ");
+ name.put(new Integer(WARN), "WARN: ");
+ name.put(new Integer(ERROR), "ERROR: ");
+ name.put(new Integer(FATAL), "FATAL: ");
+ }
+
+ public boolean isEnabled(int level) {
+ return true;
+ }
+
+ public void log(int level, String message) {
+ System.err.print(name.get(new Integer(level)));
+ System.err.println(message);
+ }
+
+ }
+
+}
Property changes on: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/console/TailServerLogWorker.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/messages/OpenShiftExpressUIMessages.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/messages/OpenShiftExpressUIMessages.java (rev 0)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/messages/OpenShiftExpressUIMessages.java 2011-12-02 18:11:38 UTC (rev 36890)
@@ -0,0 +1,21 @@
+package org.jboss.tools.openshift.express.internal.ui.messages;
+
+import org.eclipse.osgi.util.NLS;
+
+public class OpenShiftExpressUIMessages extends NLS {
+
+ private static final String BUNDLE_NAME = OpenShiftExpressUIMessages.class.getName();
+
+ static {
+ NLS.initializeMessages(BUNDLE_NAME, OpenShiftExpressUIMessages.class);
+ }
+
+ private OpenShiftExpressUIMessages() {
+ // Do not instantiate
+ }
+
+ public static String HOSTNAME_NOT_ANSWERING;
+
+ public static String TAIL_SERVER_LOG_ACTION;
+
+}
Property changes on: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/messages/OpenShiftExpressUIMessages.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/messages/OpenShiftExpressUIMessages.properties
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/messages/OpenShiftExpressUIMessages.properties (rev 0)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/messages/OpenShiftExpressUIMessages.properties 2011-12-02 18:11:38 UTC (rev 36890)
@@ -0,0 +1,2 @@
+HOSTNAME_NOT_ANSWERING=We weren''t able to lookup your hostname ({0}) in a reasonable amount of time. This can happen periodically and will just take an extra minute or two to propagate depending on where you are in the world.\nOnce you are able to access your application in a browser, you can then clone your git repository.\nIf you can''t get your application running in the browser, you can also try destroying and recreating the application as well using this Wizard.\n\nIf this doesn''t work for you, let us know in the forums or in IRC and we''ll make sure to get you up and running.\n\nForums\: https\://www.redhat.com/openshift/forums/express\n\nIRC\: \#openshift (on Freenode)
+TAIL_SERVER_LOG_ACTION=Remote console
Property changes on: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/messages/OpenShiftExpressUIMessages.properties
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ApplicationWizardModel.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ApplicationWizardModel.java 2011-12-02 18:10:47 UTC (rev 36889)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ApplicationWizardModel.java 2011-12-02 18:11:38 UTC (rev 36890)
@@ -10,13 +10,14 @@
******************************************************************************/
package org.jboss.tools.openshift.express.internal.ui.wizard;
-import java.net.MalformedURLException;
-
+import org.eclipse.osgi.util.NLS;
import org.jboss.tools.common.ui.databinding.ObservableUIPojo;
import org.jboss.tools.openshift.express.client.IApplication;
import org.jboss.tools.openshift.express.client.ICartridge;
import org.jboss.tools.openshift.express.client.IUser;
+import org.jboss.tools.openshift.express.client.OpenShiftApplicationNotAvailableException;
import org.jboss.tools.openshift.express.client.OpenShiftException;
+import org.jboss.tools.openshift.express.internal.ui.messages.OpenShiftExpressUIMessages;
/**
* @author André Dietisheim
@@ -67,8 +68,9 @@
if (isApplicationAvailable) {
setApplication(application);
} else {
- throw new OpenShiftException("The URL {0} did not respond within {1}s after the application creation.",
- application.getApplicationUrl(), APP_CREATION_TIMEOUT);
+ throw new OpenShiftApplicationNotAvailableException(NLS.bind(
+ OpenShiftExpressUIMessages.HOSTNAME_NOT_ANSWERING,
+ application.getApplicationUrl()));
}
}
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ImportProjectWizardModel.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ImportProjectWizardModel.java 2011-12-02 18:10:47 UTC (rev 36889)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ImportProjectWizardModel.java 2011-12-02 18:11:38 UTC (rev 36890)
@@ -271,7 +271,7 @@
IServer server = ExpressServerUtils.createServer(rt, type, serverName);
ExpressServerUtils.fillServerWithOpenShiftDetails(server, getApplication().getApplicationUrl(),
getUser().getRhlogin(), getUser().getPassword(),
- getUser().getDomain().getNamespace(), getApplication().getName(), mode);
+ getUser().getDomain().getNamespace(), getApplication().getName(), getApplication().getUUID(), mode);
return server;
}
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/NewApplicationWizardPage.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/NewApplicationWizardPage.java 2011-12-02 18:10:47 UTC (rev 36889)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/NewApplicationWizardPage.java 2011-12-02 18:11:38 UTC (rev 36890)
@@ -38,6 +38,7 @@
import org.eclipse.swt.widgets.Text;
import org.jboss.tools.common.ui.WizardUtils;
import org.jboss.tools.openshift.express.client.ICartridge;
+import org.jboss.tools.openshift.express.client.OpenShiftApplicationNotAvailableException;
import org.jboss.tools.openshift.express.client.OpenShiftException;
import org.jboss.tools.openshift.express.internal.client.Cartridge;
import org.jboss.tools.openshift.express.internal.ui.OpenShiftUIActivator;
@@ -172,6 +173,10 @@
wizardModel.createApplication();
applicationCreated.offer(true);
return Status.OK_STATUS;
+ } catch (OpenShiftApplicationNotAvailableException e) {
+ applicationCreated.offer(false);
+ return OpenShiftUIActivator.createErrorStatus(e.getMessage(), e,
+ wizardModel.getName());
} catch (OpenShiftException e) {
applicationCreated.offer(false);
return OpenShiftUIActivator.createErrorStatus("Could not create application \"{0}\"", (Throwable)e,
14 years
JBoss Tools SVN: r36889 - trunk/openshift/plugins/org.jboss.tools.openshift.express.client.
by jbosstools-commits@lists.jboss.org
Author: xcoulon
Date: 2011-12-02 13:10:47 -0500 (Fri, 02 Dec 2011)
New Revision: 36889
Modified:
trunk/openshift/plugins/org.jboss.tools.openshift.express.client/org.jboss.tools.openshift.express.client-2.3.0-SNAPSHOT.jar
Log:
Added a 'OpenShiftApplicationNotAvailableException'
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.client/org.jboss.tools.openshift.express.client-2.3.0-SNAPSHOT.jar
===================================================================
(Binary files differ)
14 years
JBoss Tools SVN: r36888 - trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/src/org/jboss/tools/ws/jaxrs/ui/cnf/action.
by jbosstools-commits@lists.jboss.org
Author: xcoulon
Date: 2011-12-02 13:05:32 -0500 (Fri, 02 Dec 2011)
New Revision: 36888
Modified:
trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/src/org/jboss/tools/ws/jaxrs/ui/cnf/action/CopyToClipboardActionProvider.java
Log:
removing obsolete code
Modified: trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/src/org/jboss/tools/ws/jaxrs/ui/cnf/action/CopyToClipboardActionProvider.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/src/org/jboss/tools/ws/jaxrs/ui/cnf/action/CopyToClipboardActionProvider.java 2011-12-02 18:05:00 UTC (rev 36887)
+++ trunk/ws/plugins/org.jboss.tools.ws.jaxrs.ui/src/org/jboss/tools/ws/jaxrs/ui/cnf/action/CopyToClipboardActionProvider.java 2011-12-02 18:05:32 UTC (rev 36888)
@@ -37,23 +37,12 @@
*/
@Override
public void init(ICommonActionExtensionSite aSite) {
-
- /*
- * ICompilationUnit cu = member.getCompilationUnit(); IEditorPart
- * javaEditor = JavaUI.openInEditor(cu);
- * JavaUI.revealInEditor(javaEditor, (IJavaElement)member);
- */
-
ICommonViewerSite viewSite = aSite.getViewSite();
if (viewSite instanceof ICommonViewerWorkbenchSite) {
- //ICommonViewerWorkbenchSite commonViewerWorkbenchSite = (ICommonViewerWorkbenchSite) viewSite;
- //JavaUI.revealInEditor(JavaUI.openInEditor(element), element)
- //JavaUI.openInEditor(null)
copyToClipboardAction = new CopyToClipboardAction();
copyToClipboardAction.setSelection(aSite.getStructuredViewer().getSelection());
aSite.getStructuredViewer().addSelectionChangedListener(copyToClipboardAction);
}
-
}
/*
14 years
JBoss Tools SVN: r36887 - trunk/ws/tests/org.jboss.tools.ws.jaxrs.core.test/META-INF.
by jbosstools-commits@lists.jboss.org
Author: xcoulon
Date: 2011-12-02 13:05:00 -0500 (Fri, 02 Dec 2011)
New Revision: 36887
Modified:
trunk/ws/tests/org.jboss.tools.ws.jaxrs.core.test/META-INF/MANIFEST.MF
Log:
Lowering dependency version to enable p2 updates
Modified: trunk/ws/tests/org.jboss.tools.ws.jaxrs.core.test/META-INF/MANIFEST.MF
===================================================================
--- trunk/ws/tests/org.jboss.tools.ws.jaxrs.core.test/META-INF/MANIFEST.MF 2011-12-02 18:04:37 UTC (rev 36886)
+++ trunk/ws/tests/org.jboss.tools.ws.jaxrs.core.test/META-INF/MANIFEST.MF 2011-12-02 18:05:00 UTC (rev 36887)
@@ -20,7 +20,7 @@
org.eclipse.jdt.ui;bundle-version="3.7.0",
org.eclipse.jdt.doc.user;bundle-version="3.7.0";resolution:=optional,
org.eclipse.core.resources;bundle-version="3.7.0",
- org.eclipse.equinox.ds;bundle-version="1.3.1",
+ org.eclipse.equinox.ds;bundle-version="1.3.0",
org.eclipse.jdt.core;bundle-version="3.7.0",
org.eclipse.jface.text;bundle-version="3.7.0",
org.eclipse.ui.workbench;bundle-version="3.7.0",
14 years
JBoss Tools SVN: r36886 - trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/builder.
by jbosstools-commits@lists.jboss.org
Author: xcoulon
Date: 2011-12-02 13:04:37 -0500 (Fri, 02 Dec 2011)
New Revision: 36886
Modified:
trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/builder/JaxrsMetamodelBuildJob.java
Log:
Prevent NPE/unnecessary processing when no change occurred
Modified: trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/builder/JaxrsMetamodelBuildJob.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/builder/JaxrsMetamodelBuildJob.java 2011-12-02 17:27:17 UTC (rev 36885)
+++ trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/builder/JaxrsMetamodelBuildJob.java 2011-12-02 18:04:37 UTC (rev 36886)
@@ -74,10 +74,14 @@
events, progressMonitor);
final List<JaxrsEndpointChangedEvent> jaxrsEndpointChanges = jaxrsElementChangedProcessor.processEvents(
jaxrsElementChanges, progressMonitor);
+ if(jaxrsEndpointChanges == null || jaxrsEndpointChanges.isEmpty()) {
+ Logger.debug("No JAX-RS change to publish to the UI");
+ } else {
for (JaxrsEndpointChangedEvent change : jaxrsEndpointChanges) {
Logger.debug(change.toString());
EventService.getInstance().publish(change);
}
+ }
} catch (Throwable e) {
Logger.error("Failed to build or refresh the JAX-RS metamodel", e);
} finally {
14 years
JBoss Tools SVN: r36885 - trunk/birt/plugins/org.jboss.tools.birt.oda.ui/META-INF.
by jbosstools-commits@lists.jboss.org
Author: dgeraskov
Date: 2011-12-02 12:27:17 -0500 (Fri, 02 Dec 2011)
New Revision: 36885
Modified:
trunk/birt/plugins/org.jboss.tools.birt.oda.ui/META-INF/MANIFEST.MF
Log:
Add hibernate libs dependency. Fix compile error.
Modified: trunk/birt/plugins/org.jboss.tools.birt.oda.ui/META-INF/MANIFEST.MF
===================================================================
--- trunk/birt/plugins/org.jboss.tools.birt.oda.ui/META-INF/MANIFEST.MF 2011-12-02 17:23:30 UTC (rev 36884)
+++ trunk/birt/plugins/org.jboss.tools.birt.oda.ui/META-INF/MANIFEST.MF 2011-12-02 17:27:17 UTC (rev 36885)
@@ -15,6 +15,7 @@
org.eclipse.ui.workbench.texteditor,
org.hibernate.eclipse.console,
org.hibernate.eclipse,
+ org.hibernate.eclipse.libs;bundle-version="3.4.0",
org.eclipse.core.resources
Eclipse-LazyStart: true
Bundle-RequiredExecutionEnvironment: J2SE-1.5
14 years
JBoss Tools SVN: r36884 - trunk/maven/plugins/org.jboss.tools.maven.project.examples/src/org/jboss/tools/maven/project/examples/wizard.
by jbosstools-commits@lists.jboss.org
Author: fbricon
Date: 2011-12-02 12:23:30 -0500 (Fri, 02 Dec 2011)
New Revision: 36884
Modified:
trunk/maven/plugins/org.jboss.tools.maven.project.examples/src/org/jboss/tools/maven/project/examples/wizard/ArchetypeExamplesWizardFirstPage.java
Log:
JBIDE-10322 : Reuse the last selected target runtime in the Archetype-based Project Example wizard
Modified: trunk/maven/plugins/org.jboss.tools.maven.project.examples/src/org/jboss/tools/maven/project/examples/wizard/ArchetypeExamplesWizardFirstPage.java
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.project.examples/src/org/jboss/tools/maven/project/examples/wizard/ArchetypeExamplesWizardFirstPage.java 2011-12-02 15:59:13 UTC (rev 36883)
+++ trunk/maven/plugins/org.jboss.tools.maven.project.examples/src/org/jboss/tools/maven/project/examples/wizard/ArchetypeExamplesWizardFirstPage.java 2011-12-02 17:23:30 UTC (rev 36884)
@@ -65,6 +65,7 @@
*/
public class ArchetypeExamplesWizardFirstPage extends MavenProjectWizardLocationPage {
+ private static final String TARGET_RUNTIME = "targetRuntime";
private Label projectNameLabel;
private Combo projectNameCombo;
private Label packageLabel;
@@ -88,6 +89,7 @@
}
+
@Override
protected void createAdditionalControls(Composite container) {
@@ -162,11 +164,21 @@
serverTargetCombo = new Combo(parent, SWT.BORDER | SWT.READ_ONLY);
serverTargetCombo.setLayoutData(gridData);
serverRuntimes = getServerRuntimes(facetVersion);
- for (String runtimeName : serverRuntimes.keySet()) {
- serverTargetCombo.add(runtimeName);
+ serverTargetCombo.add(Messages.ArchetypeExamplesWizardFirstPage_No_TargetRuntime);
+ int i =0, selectedRuntimeIdx = 0;
+ String lastUsedRuntime = dialogSettings.get(TARGET_RUNTIME);
+
+ for (Map.Entry<String, IRuntime> entry : serverRuntimes.entrySet()) {
+ serverTargetCombo.add(entry.getKey());
+ ++i;
+ IRuntime runtime = entry.getValue();
+ if (lastUsedRuntime != null && lastUsedRuntime.equals(runtime.getId())) {
+ selectedRuntimeIdx = i;
+ }
}
- serverTargetCombo.add(Messages.ArchetypeExamplesWizardFirstPage_No_TargetRuntime);
- serverTargetCombo.select(0);
+
+ serverTargetCombo.select(selectedRuntimeIdx);
+
serverTargetCombo.addModifyListener(new ModifyListener() {
@Override
@@ -174,6 +186,7 @@
validateEnterpriseRepo();
}
});
+
}
protected void validate() {
@@ -355,4 +368,16 @@
MavenProjectExamplesActivator.log(e);
}
}
+
+ @Override
+ public void dispose() {
+ if (dialogSettings != null && serverRuntimes != null && serverTargetCombo != null) {
+ IRuntime lastUsedRuntime = serverRuntimes.get(serverTargetCombo.getText());
+ if (lastUsedRuntime != null) {
+ dialogSettings.put(TARGET_RUNTIME, lastUsedRuntime.getId());
+ }
+ }
+ super.dispose();
+ }
+
}
14 years
JBoss Tools SVN: r36883 - trunk/requirements/soap.
by jbosstools-commits@lists.jboss.org
Author: ldimaggio
Date: 2011-12-02 10:59:13 -0500 (Fri, 02 Dec 2011)
New Revision: 36883
Modified:
trunk/requirements/soap/build.properties
Log:
Updated jbosstools/requirements/soap to reference correct SOA-P URLs.
Modified: trunk/requirements/soap/build.properties
===================================================================
--- trunk/requirements/soap/build.properties 2011-12-02 15:33:01 UTC (rev 36882)
+++ trunk/requirements/soap/build.properties 2011-12-02 15:59:13 UTC (rev 36883)
@@ -4,7 +4,7 @@
soap43.build.archive.md5=9d19284caf81b96d93c21148477df2fd
soap43.build.archive.root=jboss-soa-p.4.3.0
-soap50.build.uri=http://download.devel.redhat.com/released/JBossSOAP/5.0/5.0.1/
+soap50.build.uri=http://download.devel.redhat.com/released/JBossSOAP/5.0.1/
soap50.build.name=soa-5.0.1.GA-signed
soap50.build.archive=${soap50.build.name}.zip
soap50.build.archive.md5=b9088f7884c7464419623c596dafe25f
@@ -19,9 +19,17 @@
soap51.build.archive.root=jboss-soa-p.5.1.0
# http://jawa05.englab.brq.redhat.com/candidate/soa-5.2.0.ER6/soa-p-5.2.0.E...
-soap52.build.uri=http://jawa05.englab.brq.redhat.com/candidate/soa-5.2.0.ER6/
-soap52.build.name=soa-p-5.2.0.ER6
-soap52.build.archive=${soap51.build.name}.zip
-soap52.build.archive.md5=abc110a6e71c0c93713a350dacfcec46
+#soap52.build.uri=http://jawa05.englab.brq.redhat.com/candidate/soa-5.2.0.ER6/
+#soap52.build.name=soa-p-5.2.0.ER6
+#soap52.build.archive=${soap51.build.name}.zip
+#soap52.build.archive.md5=abc110a6e71c0c93713a350dacfcec46
+#soap52.build.archive.root=jboss-soa-p.5.2.0
+
+# Added Dec 2 2011 - ldimaggi
+# http://download.devel.redhat.com/released/JBossSOAP/5.2.0/
+soap52.build.uri=http://download.devel.redhat.com/released/JBossSOAP/5.2.0/
+soap52.build.name=soa-p-5.2.0.GA
+soap52.build.archive=${soap52.build.name}.zip
+soap52.build.archive.md5=4d2768e7291e83240398adf8d57ff8b8
soap52.build.archive.root=jboss-soa-p.5.2.0
14 years
JBoss Tools SVN: r36882 - trunk/central/plugins/org.jboss.tools.community.central.
by jbosstools-commits@lists.jboss.org
Author: fbricon
Date: 2011-12-02 10:33:01 -0500 (Fri, 02 Dec 2011)
New Revision: 36882
Modified:
trunk/central/plugins/org.jboss.tools.community.central/plugin.xml
Log:
Add HTML5 quickstart, remove quickstart suffixes
Modified: trunk/central/plugins/org.jboss.tools.community.central/plugin.xml
===================================================================
--- trunk/central/plugins/org.jboss.tools.community.central/plugin.xml 2011-12-02 15:05:14 UTC (rev 36881)
+++ trunk/central/plugins/org.jboss.tools.community.central/plugin.xml 2011-12-02 15:33:01 UTC (rev 36882)
@@ -18,7 +18,7 @@
<tutorial
id="org.jboss.tools.central.jbossas.quickstart.helloworld"
categoryId="org.jboss.tools.central.jbossas.quickstart"
- name="Helloworld quickstart"
+ name="Helloworld"
type="projectExample"
priority="1"
icon="icons/jbossas7.png"
@@ -26,7 +26,7 @@
<tutorial
id="org.jboss.tools.central.jbossas.quickstart.numberguess"
categoryId="org.jboss.tools.central.jbossas.quickstart"
- name="Numberguess quickstart"
+ name="Numberguess"
type="projectExample"
priority="2"
icon="icons/jbossas7.png"
@@ -35,7 +35,7 @@
<tutorial
id="org.jboss.tools.central.jbossas.quickstart.login"
categoryId="org.jboss.tools.central.jbossas.quickstart"
- name="Login quickstart"
+ name="Login"
type="projectExample"
priority="3"
icon="icons/jbossas7.png"
@@ -44,11 +44,30 @@
<tutorial
id="org.jboss.tools.central.jbossas.quickstart.kitchensink"
categoryId="org.jboss.tools.central.jbossas.quickstart"
- name="Kitchensink quickstart"
+ name="Kitchensink"
type="projectExample"
priority="4"
icon="icons/jbossas7.png"
reference="JBoss AS 7 Quickstarts::kitchensink"/>
+
+ <tutorial
+ id="org.jboss.tools.central.jbossas.quickstart.poh5helloworld"
+ categoryId="org.jboss.tools.central.jbossas.quickstart"
+ name="HTML5"
+ type="projectExample"
+ priority="5"
+ icon="icons/jbossas7.png"
+ reference="JBoss AS 7 Quickstarts::poh5-helloworld"/>
+
+ <tutorial
+ id="org.jboss.tools.central.jbossas.quickstart.ticketmonster"
+ categoryId="org.jboss.tools.central.jbossas.quickstart"
+ name="Ticket Monster"
+ type="projectExample"
+ priority="6"
+ icon="icons/jbossas7.png"
+ reference="JBoss AS 7 Quickstarts::ticketmonster"/>
+
<!--
<tutorial
id="org.jboss.tools.central.Seam.registration2"
14 years
JBoss Tools SVN: r36881 - trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/editors.
by jbosstools-commits@lists.jboss.org
Author: snjeza
Date: 2011-12-02 10:05:14 -0500 (Fri, 02 Dec 2011)
New Revision: 36881
Modified:
trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/editors/JBossCentralEditor.java
Log:
JBIDE-10217 JBoss Central Search location & defaults
Modified: trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/editors/JBossCentralEditor.java
===================================================================
--- trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/editors/JBossCentralEditor.java 2011-12-02 13:49:14 UTC (rev 36880)
+++ trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/editors/JBossCentralEditor.java 2011-12-02 15:05:14 UTC (rev 36881)
@@ -205,7 +205,7 @@
gridLayout.marginWidth = 0;
gridLayout.verticalSpacing = 0;
gridLayout.marginLeft = 0;
- gridLayout.marginRight = 0;
+ gridLayout.marginRight = 10;
searchComposite.setLayout(gridLayout);
ImageHyperlink menuLink = getToolkit().createImageHyperlink(
searchComposite, SWT.NONE);
14 years