JBoss Tools SVN: r40607 - in trunk/openshift/plugins/org.jboss.tools.openshift.express.ui: src/org/jboss/tools/openshift/express/internal/core/portforward and 5 other directories.
by jbosstools-commits@lists.jboss.org
Author: xcoulon
Date: 2012-04-27 21:32:19 -0400 (Fri, 27 Apr 2012)
New Revision: 40607
Added:
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/action/ShowEnvironmentAction.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/utils/OpenShiftSshSessionFactory.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/viewer/actionProvider/ShowEnvironmentActionProvider.java
Removed:
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/portforward/OpenShiftSshSessionFactory.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/action/TailServerLogWorker.java
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/portforward/ApplicationPortForwardingWizardPage.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/messages/OpenShiftExpressUIMessages.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/messages/OpenShiftExpressUIMessages.properties
Log:
Fixed - JBIDE-11632
Add a "Show environment" to openshift console
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/plugin.xml
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/plugin.xml 2012-04-28 00:48:19 UTC (rev 40606)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/plugin.xml 2012-04-28 01:32:19 UTC (rev 40607)
@@ -491,7 +491,18 @@
</or>
</enablement>
</actionProvider>
-
+ <actionProvider
+ appearsBefore="org.jboss.tools.openshift.express.internal.ui.viewer.actionProvider.showPropertiesActionProvider"
+ class="org.jboss.tools.openshift.express.internal.ui.viewer.actionProvider.ShowEnvironmentActionProvider"
+ id="org.jboss.tools.openshift.express.internal.ui.viewer.actionProvider.showEnvironmentActionProvider">
+ <enablement>
+ <or>
+ <instanceof
+ value="com.openshift.client.IApplication">
+ </instanceof>
+ </or>
+ </enablement>
+ </actionProvider>
</extension>
<extension
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/portforward/ApplicationPortForwardingWizardPage.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/portforward/ApplicationPortForwardingWizardPage.java 2012-04-28 00:48:19 UTC (rev 40606)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/portforward/ApplicationPortForwardingWizardPage.java 2012-04-28 01:32:19 UTC (rev 40607)
@@ -21,7 +21,6 @@
import org.eclipse.jface.viewers.TableViewer;
import org.eclipse.jface.viewers.TableViewerColumn;
import org.eclipse.jface.viewers.ViewerCell;
-import org.eclipse.jgit.transport.URIish;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
@@ -34,11 +33,11 @@
import org.jboss.tools.common.ui.databinding.ValueBindingBuilder;
import org.jboss.tools.openshift.express.internal.ui.OpenShiftUIActivator;
import org.jboss.tools.openshift.express.internal.ui.utils.Logger;
+import org.jboss.tools.openshift.express.internal.ui.utils.OpenShiftSshSessionFactory;
import org.jboss.tools.openshift.express.internal.ui.wizard.AbstractOpenShiftWizardPage;
import com.jcraft.jsch.JSchException;
import com.jcraft.jsch.Session;
-import com.openshift.client.IApplication;
import com.openshift.client.IApplicationPortForwarding;
import com.openshift.client.OpenShiftSSHOperationException;
@@ -224,14 +223,6 @@
};
}
- static URIish getSshUri(IApplication application) {
- final String host = application.getName() + "-" + application.getDomain().getId() + "."
- + application.getDomain().getSuffix();
- final String user = application.getUUID();
- final URIish uri = new URIish().setHost(host).setPort(22).setUser(user);
- return uri;
- }
-
private SelectionListener onStopPortForwarding() {
return new SelectionAdapter() {
@Override
@@ -371,7 +362,7 @@
if (!hasSSHSession) {
Logger.debug("Opening a new SSH Session for application '" + wizardModel.getApplication().getName() + "'");
final Session session = OpenShiftSshSessionFactory.getInstance().createSession(
- getSshUri(wizardModel.getApplication()));
+ wizardModel.getApplication());
wizardModel.getApplication().setSSHSession(session);
}
}
Deleted: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/portforward/OpenShiftSshSessionFactory.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/portforward/OpenShiftSshSessionFactory.java 2012-04-28 00:48:19 UTC (rev 40606)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/portforward/OpenShiftSshSessionFactory.java 2012-04-28 01:32:19 UTC (rev 40607)
@@ -1,131 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 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.core.portforward;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.eclipse.egit.ui.internal.credentials.EGitCredentialsProvider;
-import org.eclipse.jgit.transport.CredentialsProviderUserInfo;
-import org.eclipse.jgit.transport.JschConfigSessionFactory;
-import org.eclipse.jgit.transport.OpenSshConfig;
-import org.eclipse.jgit.transport.URIish;
-import org.eclipse.jgit.util.FS;
-import org.eclipse.jsch.core.IJSchService;
-import org.eclipse.jsch.ui.UserInfoPrompter;
-import org.jboss.tools.openshift.express.internal.ui.OpenShiftUIActivator;
-import org.jboss.tools.openshift.express.internal.ui.console.JschToEclipseLogger;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.ServiceReference;
-
-import com.jcraft.jsch.JSch;
-import com.jcraft.jsch.JSchException;
-import com.jcraft.jsch.Session;
-import com.jcraft.jsch.UserInfo;
-
-/**
- * Same as EclipseSshSessinFactory, but provides a mean to retrieve the pure Jsch Session, not a RemoteSession.
- *
- * @author Xavier Coulon
- *
- */
-public class OpenShiftSshSessionFactory extends JschConfigSessionFactory {
-
- private static OpenShiftSshSessionFactory INSTANCE = new OpenShiftSshSessionFactory();
-
- /**
- * Get the currently configured JVM-wide factory.
- * <p>
- * A factory is always available. By default the factory will read from the user's <code>$HOME/.ssh</code> and
- * assume OpenSSH compatibility.
- *
- * @return factory the current factory for this JVM.
- */
- public static OpenShiftSshSessionFactory getInstance() {
- return INSTANCE;
- }
-
- private final IJSchService provider;
-
- private OpenSshConfig config;
-
- private final Map<URIish, Session> cache = new HashMap<URIish, Session>();
-
- OpenShiftSshSessionFactory() {
- final BundleContext context = OpenShiftUIActivator.getDefault().getBundle().getBundleContext();
- final ServiceReference<?> ssh = context.getServiceReference(IJSchService.class.getName());
- this.provider = (IJSchService) context.getService(ssh);
- }
-
- public Session createSession(final URIish uri) throws JSchException {
- final Session session = cache.get(uri);
- if (session == null || !session.isConnected()) {
- final FS fs = FS.DETECTED;
- if (config == null) {
- config = OpenSshConfig.get(fs);
- }
- String user = uri.getUser();
- String host = uri.getHost();
- int port = uri.getPort();
- JSch.setLogger(new JschToEclipseLogger());
- final OpenSshConfig.Host hc = config.lookup(host);
- cache.put(uri, createSession(hc, user, host, port, fs));
- }
- return cache.get(uri);
- }
-
- @Override
- protected Session createSession(final OpenSshConfig.Host hc, final String user, final String host, final int port,
- FS fs) throws JSchException {
- final JSch jsch = getJSch(hc, FS.DETECTED);
- if (jsch == provider.getJSch()) {
- // If its the default JSch desired, let the provider
- // manage the session creation for us.
- //
- final Session session = provider.createSession(host, port, user);
- configure(hc, session);
- session.connect();
- return session;
- } else {
- // This host configuration is using a different IdentityFile,
- // one that is not available through the default JSch.
- //
- final Session session = jsch.getSession(user, host, port);
- configure(hc, session);
- session.connect(0);
- return session;
- }
- }
-
- @Override
- protected JSch createDefaultJSch(FS fs) throws JSchException {
- // Forcing a dummy session to be created will cause the known hosts
- // and configured private keys to be initialized. This is needed by
- // our parent class in case non-default JSch instances need to be made.
- //
- provider.createSession("127.0.0.1", 0, "eclipse"); //$NON-NLS-1$ //$NON-NLS-2$
- return provider.getJSch();
- }
-
- @Override
- protected void configure(final OpenSshConfig.Host hc, final Session session) {
- final EGitCredentialsProvider credentialsProvider = new EGitCredentialsProvider();
- if ((!hc.isBatchMode() || !credentialsProvider.isInteractive())) {
- session.setUserInfo(new CredentialsProviderUserInfo(session, credentialsProvider));
- } else {
- UserInfo userInfo = session.getUserInfo();
-
- if (!hc.isBatchMode() && userInfo == null)
- new UserInfoPrompter(session);
- }
- }
-
-}
Added: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/action/ShowEnvironmentAction.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/action/ShowEnvironmentAction.java (rev 0)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/action/ShowEnvironmentAction.java 2012-04-28 01:32:19 UTC (rev 40607)
@@ -0,0 +1,70 @@
+/*******************************************************************************
+ * 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.action;
+
+import java.util.List;
+
+import org.eclipse.jface.viewers.ITreeSelection;
+import org.eclipse.ui.console.MessageConsole;
+import org.eclipse.ui.console.MessageConsoleStream;
+import org.jboss.tools.openshift.express.internal.ui.OpenShiftUIActivator;
+import org.jboss.tools.openshift.express.internal.ui.console.ConsoleUtils;
+import org.jboss.tools.openshift.express.internal.ui.messages.OpenShiftExpressUIMessages;
+import org.jboss.tools.openshift.express.internal.ui.utils.OpenShiftSshSessionFactory;
+
+import com.openshift.client.IApplication;
+
+/**
+ * @author Xavier Coulon
+ */
+public class ShowEnvironmentAction extends AbstractAction {
+
+ public ShowEnvironmentAction() {
+ super(OpenShiftExpressUIMessages.SHOW_ENVIRONMENT_ACTION, true);
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.jface.action.Action#run()
+ */
+ @Override
+ public void run() {
+ try {
+ final ITreeSelection treeSelection = (ITreeSelection) selection;
+ if (selection instanceof ITreeSelection && treeSelection.getFirstElement() instanceof IApplication) {
+ final IApplication application = (IApplication) treeSelection.getFirstElement();
+ if(!application.hasSSHSession()) {
+ application.setSSHSession(OpenShiftSshSessionFactory.getInstance().createSession(application));
+ }
+ List<String> props = application.getEnvironmentProperties();
+ final MessageConsole console = ConsoleUtils.findMessageConsole(getMessageConsoleName(application));
+ MessageConsoleStream stream = console.newMessageStream();
+ for (String prop : props) {
+ stream.println(prop);
+ }
+ ConsoleUtils.displayConsoleView(console);
+
+ }
+ } catch (Exception e) {
+ OpenShiftUIActivator.createErrorStatus("Failed to display remote environment variables", e);
+ }
+
+ }
+
+ /**
+ * @return
+ */
+ private String getMessageConsoleName(final IApplication application) {
+ return "Environment Variables for application '" + application.getName() + "' (" + application.getDomain().getId() + ")";
+ }
+
+
+}
Property changes on: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/action/ShowEnvironmentAction.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Deleted: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/action/TailServerLogWorker.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/action/TailServerLogWorker.java 2012-04-28 00:48:19 UTC (rev 40606)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/action/TailServerLogWorker.java 2012-04-28 01:32:19 UTC (rev 40607)
@@ -1,74 +0,0 @@
-package org.jboss.tools.openshift.express.internal.ui.action;
-
-import java.io.BufferedReader;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-
-import org.eclipse.jgit.transport.RemoteSession;
-import org.eclipse.ui.console.MessageConsole;
-
-
-/**
- * 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 {
-
- /** the remote 'tail' process. */
- private final Process process;
-
- /** the output message console. */
- private final MessageConsole console;
-
- /** 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
- public void run() {
- try {
- // get I/O streams for remote tail
- final InputStream in = process.getInputStream();
- BufferedReader reader = new BufferedReader(new InputStreamReader(in));
- String line;
- // Read File Line By Line
- while ((line = reader.readLine()) != null) {
- console.newMessageStream().println(line);
- }
- } catch (Throwable e) {
- org.jboss.tools.openshift.express.internal.ui.utils.Logger.error(
- "Error while receiving the remote server log", e);
- console.newMessageStream().println("Error while receiving the remote server log: " + e.getMessage());
- } 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();
- }
-
-}
Modified: 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 2012-04-28 00:48:19 UTC (rev 40606)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/console/TailServerLogAction.java 2012-04-28 01:32:19 UTC (rev 40607)
@@ -28,7 +28,6 @@
import org.eclipse.wst.server.ui.IServerModule;
import org.jboss.tools.openshift.express.internal.core.behaviour.ExpressServerUtils;
import org.jboss.tools.openshift.express.internal.ui.action.AbstractAction;
-import org.jboss.tools.openshift.express.internal.ui.action.TailServerLogWorker;
import org.jboss.tools.openshift.express.internal.ui.messages.OpenShiftExpressUIMessages;
import org.jboss.tools.openshift.express.internal.ui.utils.Logger;
Copied: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/console/TailServerLogWorker.java (from rev 40548, trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/action/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 2012-04-28 01:32:19 UTC (rev 40607)
@@ -0,0 +1,74 @@
+package org.jboss.tools.openshift.express.internal.ui.console;
+
+import java.io.BufferedReader;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+
+import org.eclipse.jgit.transport.RemoteSession;
+import org.eclipse.ui.console.MessageConsole;
+
+
+/**
+ * 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 {
+
+ /** the remote 'tail' process. */
+ private final Process process;
+
+ /** the output message console. */
+ private final MessageConsole console;
+
+ /** 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
+ public void run() {
+ try {
+ // get I/O streams for remote tail
+ final InputStream in = process.getInputStream();
+ BufferedReader reader = new BufferedReader(new InputStreamReader(in));
+ String line;
+ // Read File Line By Line
+ while ((line = reader.readLine()) != null) {
+ console.newMessageStream().println(line);
+ }
+ } catch (Throwable e) {
+ org.jboss.tools.openshift.express.internal.ui.utils.Logger.error(
+ "Error while receiving the remote server log", e);
+ console.newMessageStream().println("Error while receiving the remote server log: " + e.getMessage());
+ } 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();
+ }
+
+}
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
Modified: 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 2012-04-28 00:48:19 UTC (rev 40606)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/messages/OpenShiftExpressUIMessages.java 2012-04-28 01:32:19 UTC (rev 40607)
@@ -40,6 +40,8 @@
public static String MAKE_SNAPSHOT_ACTION;
public static String SHOW_PROPERTIES_VIEW_ACTION;
+
+ public static String SHOW_ENVIRONMENT_ACTION;
public static String REFRESH_VIEWER_ACTION;
Modified: 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 2012-04-28 00:48:19 UTC (rev 40606)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/messages/OpenShiftExpressUIMessages.properties 2012-04-28 01:32:19 UTC (rev 40607)
@@ -16,7 +16,9 @@
SHOW_PROPERTIES_VIEW_ACTION=Properties
REFRESH_VIEWER_ACTION=Refresh
+SHOW_ENVIRONMENT_ACTION=Show Environment Variables
+
DELETE_CONNECTION_ACTION=Disconnect
USER_NOT_CONNECTED_LABEL=<User is not connected>
Copied: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/utils/OpenShiftSshSessionFactory.java (from rev 40595, trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/portforward/OpenShiftSshSessionFactory.java)
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/utils/OpenShiftSshSessionFactory.java (rev 0)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/utils/OpenShiftSshSessionFactory.java 2012-04-28 01:32:19 UTC (rev 40607)
@@ -0,0 +1,141 @@
+/*******************************************************************************
+ * Copyright (c) 2012 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.utils;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.eclipse.egit.ui.internal.credentials.EGitCredentialsProvider;
+import org.eclipse.jgit.transport.CredentialsProviderUserInfo;
+import org.eclipse.jgit.transport.JschConfigSessionFactory;
+import org.eclipse.jgit.transport.OpenSshConfig;
+import org.eclipse.jgit.transport.URIish;
+import org.eclipse.jgit.util.FS;
+import org.eclipse.jsch.core.IJSchService;
+import org.eclipse.jsch.ui.UserInfoPrompter;
+import org.jboss.tools.openshift.express.internal.ui.OpenShiftUIActivator;
+import org.jboss.tools.openshift.express.internal.ui.console.JschToEclipseLogger;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.ServiceReference;
+
+import com.jcraft.jsch.JSch;
+import com.jcraft.jsch.JSchException;
+import com.jcraft.jsch.Session;
+import com.jcraft.jsch.UserInfo;
+import com.openshift.client.IApplication;
+
+/**
+ * Same as EclipseSshSessinFactory, but provides a mean to retrieve the pure Jsch Session, not a RemoteSession.
+ *
+ * @author Xavier Coulon
+ *
+ */
+public class OpenShiftSshSessionFactory extends JschConfigSessionFactory {
+
+ private static OpenShiftSshSessionFactory INSTANCE = new OpenShiftSshSessionFactory();
+
+ /**
+ * Get the currently configured JVM-wide factory.
+ * <p>
+ * A factory is always available. By default the factory will read from the user's <code>$HOME/.ssh</code> and
+ * assume OpenSSH compatibility.
+ *
+ * @return factory the current factory for this JVM.
+ */
+ public static OpenShiftSshSessionFactory getInstance() {
+ return INSTANCE;
+ }
+
+ private final IJSchService provider;
+
+ private OpenSshConfig config;
+
+ private final Map<URIish, Session> cache = new HashMap<URIish, Session>();
+
+ OpenShiftSshSessionFactory() {
+ final BundleContext context = OpenShiftUIActivator.getDefault().getBundle().getBundleContext();
+ final ServiceReference<?> ssh = context.getServiceReference(IJSchService.class.getName());
+ this.provider = (IJSchService) context.getService(ssh);
+ }
+
+ public Session createSession(final IApplication application) throws JSchException {
+ final URIish uri = getSshUri(application);
+ final Session session = cache.get(uri);
+ if (session == null || !session.isConnected()) {
+ final FS fs = FS.DETECTED;
+ if (config == null) {
+ config = OpenSshConfig.get(fs);
+ }
+ String user = uri.getUser();
+ String host = uri.getHost();
+ int port = uri.getPort();
+ JSch.setLogger(new JschToEclipseLogger());
+ final OpenSshConfig.Host hc = config.lookup(host);
+ cache.put(uri, createSession(hc, user, host, port, fs));
+ }
+ return cache.get(uri);
+ }
+
+ static URIish getSshUri(IApplication application) {
+ final String host = application.getName() + "-" + application.getDomain().getId() + "."
+ + application.getDomain().getSuffix();
+ final String user = application.getUUID();
+ final URIish uri = new URIish().setHost(host).setPort(22).setUser(user);
+ return uri;
+ }
+
+ @Override
+ protected Session createSession(final OpenSshConfig.Host hc, final String user, final String host, final int port,
+ FS fs) throws JSchException {
+ final JSch jsch = getJSch(hc, FS.DETECTED);
+ if (jsch == provider.getJSch()) {
+ // If its the default JSch desired, let the provider
+ // manage the session creation for us.
+ //
+ final Session session = provider.createSession(host, port, user);
+ configure(hc, session);
+ session.connect();
+ return session;
+ } else {
+ // This host configuration is using a different IdentityFile,
+ // one that is not available through the default JSch.
+ //
+ final Session session = jsch.getSession(user, host, port);
+ configure(hc, session);
+ session.connect(0);
+ return session;
+ }
+ }
+
+ @Override
+ protected JSch createDefaultJSch(FS fs) throws JSchException {
+ // Forcing a dummy session to be created will cause the known hosts
+ // and configured private keys to be initialized. This is needed by
+ // our parent class in case non-default JSch instances need to be made.
+ //
+ provider.createSession("127.0.0.1", 0, "eclipse"); //$NON-NLS-1$ //$NON-NLS-2$
+ return provider.getJSch();
+ }
+
+ @Override
+ protected void configure(final OpenSshConfig.Host hc, final Session session) {
+ final EGitCredentialsProvider credentialsProvider = new EGitCredentialsProvider();
+ if ((!hc.isBatchMode() || !credentialsProvider.isInteractive())) {
+ session.setUserInfo(new CredentialsProviderUserInfo(session, credentialsProvider));
+ } else {
+ UserInfo userInfo = session.getUserInfo();
+
+ if (!hc.isBatchMode() && userInfo == null)
+ new UserInfoPrompter(session);
+ }
+ }
+
+}
Property changes on: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/utils/OpenShiftSshSessionFactory.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/viewer/actionProvider/ShowEnvironmentActionProvider.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/viewer/actionProvider/ShowEnvironmentActionProvider.java (rev 0)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/viewer/actionProvider/ShowEnvironmentActionProvider.java 2012-04-28 01:32:19 UTC (rev 40607)
@@ -0,0 +1,24 @@
+/*******************************************************************************
+ * 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.viewer.actionProvider;
+
+import org.jboss.tools.openshift.express.internal.ui.action.ShowEnvironmentAction;
+
+/**
+ * @author Xavier Coulon
+ */
+public class ShowEnvironmentActionProvider extends AbstractActionProvider {
+
+ public ShowEnvironmentActionProvider() {
+ super(new ShowEnvironmentAction(), "group.properties");
+ }
+
+}
Property changes on: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/viewer/actionProvider/ShowEnvironmentActionProvider.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
12 years, 8 months
JBoss Tools SVN: r40606 - trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/util.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2012-04-27 20:48:19 -0400 (Fri, 27 Apr 2012)
New Revision: 40606
Modified:
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/util/EclipseResourceUtil.java
Log:
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/util/EclipseResourceUtil.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/util/EclipseResourceUtil.java 2012-04-28 00:29:13 UTC (rev 40605)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/util/EclipseResourceUtil.java 2012-04-28 00:48:19 UTC (rev 40606)
@@ -695,7 +695,7 @@
IClasspathEntry[] es = null;
for (int i = 0; i < es0.length && es == null; i++) {
if(es0[i].getEntryKind() == IClasspathEntry.CPE_CONTAINER &&
- es0[i].getPath().toString().equals("org.eclipse.jdt.launching.JRE_CONTAINER")) { //$NON-NLS-1$
+ es0[i].getPath().toString().startsWith("org.eclipse.jdt.launching.JRE_CONTAINER")) { //$NON-NLS-1$
IClasspathContainer container = JavaCore.getClasspathContainer(es0[i].getPath(), javaProject);
if(container == null) continue;
es = container.getClasspathEntries();
12 years, 8 months
JBoss Tools SVN: r40605 - trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/appimport.
by jbosstools-commits@lists.jboss.org
Author: fbricon
Date: 2012-04-27 20:29:13 -0400 (Fri, 27 Apr 2012)
New Revision: 40605
Modified:
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/appimport/AbstractImportApplicationOperation.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/appimport/ConfigureUnsharedProject.java
Log:
JBIDE-11702 : .gitignore cannot exclude .jsdtscope nor factorypath by default
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/appimport/AbstractImportApplicationOperation.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/appimport/AbstractImportApplicationOperation.java 2012-04-28 00:01:33 UTC (rev 40604)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/appimport/AbstractImportApplicationOperation.java 2012-04-28 00:29:13 UTC (rev 40605)
@@ -217,10 +217,10 @@
protected IFile setupGitIgnore(IProject project, IProgressMonitor monitor) throws IOException, CoreException {
GitIgnore gitIgnore = new GitIgnore(project);
gitIgnore.add("target")
- .add(".settings")
+ .add(".settings/*")
+ .add("!.settings/.jsdtscope")//To prevent nasty JSDT bugs
.add(".project")
- .add(".classpath")
- .add(".factorypath");
+ .add(".classpath");
return gitIgnore.write(monitor);
}
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/appimport/ConfigureUnsharedProject.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/appimport/ConfigureUnsharedProject.java 2012-04-28 00:01:33 UTC (rev 40604)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/appimport/ConfigureUnsharedProject.java 2012-04-28 00:29:13 UTC (rev 40605)
@@ -94,7 +94,7 @@
IProject project = getProject();
copyOpenshiftConfigurations(getApplication(), getRemoteName(), project, monitor);
- createGitIgnore(project, monitor);
+ setupGitIgnore(project, monitor);
setupOpenShiftMavenProfile(project, monitor);
shareProject(project, monitor);
addRemoteRepo(getRemoteName(), getApplication().getGitUrl(), EGitUtils.getRepository(project));
@@ -150,25 +150,6 @@
}
- /**
- * Adds a predefined set of entries to the gitignore file in (root of) the
- * given project. If no .gitignore exists yet, a fresh one is created.
- *
- * @param project
- * the project to which the .gitignore shall be configured
- * @throws IOException
- * @throws CoreException
- */
- private void createGitIgnore(IProject project, IProgressMonitor monitor) throws IOException, CoreException {
- GitIgnore gitIgnore = new GitIgnore(project);
- gitIgnore.add("target")
- .add(".settings")
- .add(".project")
- .add(".classpath")
- .add(".factorypath");
- gitIgnore.write(monitor);
- }
-
// private void mergeWithApplicationRepository(Repository repository,
// IApplication application,
// IProgressMonitor monitor)
12 years, 8 months
JBoss Tools SVN: r40604 - in trunk/cdi/tests/org.jboss.tools.cdi.core.test: src/org/jboss/tools/cdi/core/test/tck and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2012-04-27 20:01:33 -0400 (Fri, 27 Apr 2012)
New Revision: 40604
Added:
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/definition/stereotype/defaultNamed/Sambar.java
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/definition/stereotype/defaultNamed/StereotypeWithAdditionalStereotype.java
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/EnterpriseStereotypeDefinitionTest.java
Log:
JBIDE-11540
https://issues.jboss.org/browse/JBIDE-11540
Test is added.
Added: trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/definition/stereotype/defaultNamed/Sambar.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/definition/stereotype/defaultNamed/Sambar.java (rev 0)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/definition/stereotype/defaultNamed/Sambar.java 2012-04-28 00:01:33 UTC (rev 40604)
@@ -0,0 +1,24 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc., and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jboss.jsr299.tck.tests.definition.stereotype.defaultNamed;
+
+
+@StereotypeWithAdditionalStereotype
+class Sambar
+{
+
+}
Property changes on: trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/definition/stereotype/defaultNamed/Sambar.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/definition/stereotype/defaultNamed/StereotypeWithAdditionalStereotype.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/definition/stereotype/defaultNamed/StereotypeWithAdditionalStereotype.java (rev 0)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/definition/stereotype/defaultNamed/StereotypeWithAdditionalStereotype.java 2012-04-28 00:01:33 UTC (rev 40604)
@@ -0,0 +1,35 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc., and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jboss.jsr299.tck.tests.definition.stereotype.defaultNamed;
+
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import javax.enterprise.inject.Stereotype;
+import javax.inject.Named;
+
+@Stereotype
+@Target( { TYPE })
+@Retention(RUNTIME)
+@StereotypeWithEmptyNamed
+@interface StereotypeWithAdditionalStereotype
+{
+
+}
Property changes on: trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/definition/stereotype/defaultNamed/StereotypeWithAdditionalStereotype.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/EnterpriseStereotypeDefinitionTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/EnterpriseStereotypeDefinitionTest.java 2012-04-28 00:00:28 UTC (rev 40603)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/EnterpriseStereotypeDefinitionTest.java 2012-04-28 00:01:33 UTC (rev 40604)
@@ -14,6 +14,7 @@
import org.eclipse.jdt.core.JavaModelException;
import org.jboss.tools.cdi.core.IBean;
+import org.jboss.tools.cdi.core.IStereotypeDeclaration;
/**
* @author Alexey Kazakov
@@ -103,4 +104,12 @@
"javax.enterprise.context.SessionScoped", bean.getScope()
.getSourceType().getFullyQualifiedName());
}
+
+ public void testAdditionalStereotype() throws JavaModelException {
+ Set<IBean> beans = getBeans("org.jboss.jsr299.tck.tests.definition.stereotype.defaultNamed.Sambar");
+ IBean bean = beans.iterator().next();
+ assertEquals("sambar", bean.getName());
+ Set<IStereotypeDeclaration> s = bean.getStereotypeDeclarations();
+ assertEquals(2, s.size());
+ }
}
\ No newline at end of file
12 years, 8 months
JBoss Tools SVN: r40603 - in trunk/jst/plugins/org.jboss.tools.jst.web.ui: templates and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2012-04-27 20:00:28 -0400 (Fri, 27 Apr 2012)
New Revision: 40603
Added:
trunk/jst/plugins/org.jboss.tools.jst.web.ui/templates/htmldefault-templates.properties
trunk/jst/plugins/org.jboss.tools.jst.web.ui/templates/htmldefault-templates.xml
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web.ui/plugin.xml
trunk/jst/plugins/org.jboss.tools.jst.web.ui/templates/xhtmldefault-templates.xml
Log:
https://issues.jboss.org/browse/JBIDE-11511 HTML5 jQuery Mobile Template
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.ui/plugin.xml
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.ui/plugin.xml 2012-04-27 23:55:49 UTC (rev 40602)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.ui/plugin.xml 2012-04-28 00:00:28 UTC (rev 40603)
@@ -727,6 +727,10 @@
file="templates/xhtmldefault-templates.xml"
translations="$nl$/templates/xhtmldefault-templates.properties">
</include>
+ <include
+ file="templates/htmldefault-templates.xml"
+ translations="$nl$/templates/htmldefault-templates.properties">
+ </include>
</extension>
<extension point="org.eclipse.ui.perspectiveExtensions">
Added: trunk/jst/plugins/org.jboss.tools.jst.web.ui/templates/htmldefault-templates.properties
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.ui/templates/htmldefault-templates.properties (rev 0)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.ui/templates/htmldefault-templates.properties 2012-04-28 00:00:28 UTC (rev 40603)
@@ -0,0 +1,3 @@
+Templates.html.jQueryMobile = HTML5 jQuery Mobile Page
+Templates.html.jQueryMobile.desc = HTML5 jQuery Mobile Template
+Templates.html.jQueryMobile.content = <!DOCTYPE html> \n<html><head> \n <title>jQuery Mobile Template</title> \n <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> \n <meta name="viewport" \n content="width=device-width, initial-scale=1, user-scalable=0" /> \n \n <link rel="stylesheet" \n href="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.css" /> \n \n <script type="text/javascript" \n src="http://code.jquery.com/jquery-1.7.2.min.js"></script> \n <script type="text/javascript" \n src="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.js"></script> \n <script type="text/javascript"> \n $$(document).on("pageinit", function(event){ \n alert("Ready To Go"); \n }); \n </script> \n</head> \n \n<body> \n <div data-role="page" id="page1"> \n <div data-role="header"> \n <h1>jQuery Mobile</h1> \n </div> \n \n <div data-role="content"> \n <ul id="listOfItems" data-role="listview" data-inset="true" \n data-filter="true"> \n!
<li><a href="">One</a></li> \n <li><a href="">Two</a></li> \n <li><a href="">Three</a></li> \n </ul> \n </div> \n \n <div data-role="footer"> \n <h4>www.jboss.org/developer</h4> \n </div> \n \n </div> \n</body> \n</html> \n
\ No newline at end of file
Property changes on: trunk/jst/plugins/org.jboss.tools.jst.web.ui/templates/htmldefault-templates.properties
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/jst/plugins/org.jboss.tools.jst.web.ui/templates/htmldefault-templates.xml
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.ui/templates/htmldefault-templates.xml (rev 0)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.ui/templates/htmldefault-templates.xml 2012-04-28 00:00:28 UTC (rev 40603)
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<templates>
+
+<template name="%Templates.html.jQueryMobile" description="%Templates.html.jQueryMobile.desc" id="org.jboss.tools.jst.ui.html.jquery" context="html_new" enabled="true">%Templates.html.jQueryMobile.content</template>
+
+</templates>
\ No newline at end of file
Property changes on: trunk/jst/plugins/org.jboss.tools.jst.web.ui/templates/htmldefault-templates.xml
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.ui/templates/xhtmldefault-templates.xml
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.ui/templates/xhtmldefault-templates.xml 2012-04-27 23:55:49 UTC (rev 40602)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.ui/templates/xhtmldefault-templates.xml 2012-04-28 00:00:28 UTC (rev 40603)
@@ -13,4 +13,4 @@
<template name="%Templates.xhtml.jsf.richfaces" description="%Templates.xhtml.jsf.richfaces.desc" id="org.jboss.tools.jsf.ui.richfaces" context="xhtml_new" enabled="true">%Templates.xhtml.jsf.richfaces.content</template>
-</templates>
+</templates>
\ No newline at end of file
12 years, 8 months
JBoss Tools SVN: r40602 - trunk/openshift/plugins/org.jboss.tools.openshift.express.client.
by jbosstools-commits@lists.jboss.org
Author: max.andersen(a)jboss.com
Date: 2012-04-27 19:55:49 -0400 (Fri, 27 Apr 2012)
New Revision: 40602
Modified:
trunk/openshift/plugins/org.jboss.tools.openshift.express.client/.classpath
Log:
reverted bad commit on .classpath
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.client/.classpath
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.client/.classpath 2012-04-27 23:53:42 UTC (rev 40601)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.client/.classpath 2012-04-27 23:55:49 UTC (rev 40602)
@@ -3,7 +3,7 @@
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src"/>
- <classpathentry exported="true" kind="lib" path="openshift-java-client-2.0.0-SNAPSHOT.jar" sourcepath="/openshift-java-client/src/main/java"/>
+ <classpathentry exported="true" kind="lib" path="openshift-java-client-2.0.0-SNAPSHOT.jar"/>
<classpathentry kind="lib" path="jboss-dmr-1.0.0.Final.jar"/>
<classpathentry kind="lib" path="log4j-1.2.16.jar"/>
<classpathentry kind="lib" path="slf4j-api-1.6.1.jar"/>
12 years, 8 months
JBoss Tools SVN: r40601 - in trunk/openshift/plugins: org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/portforward and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: max.andersen(a)jboss.com
Date: 2012-04-27 19:53:42 -0400 (Fri, 27 Apr 2012)
New Revision: 40601
Modified:
trunk/openshift/plugins/org.jboss.tools.openshift.express.client/.classpath
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/portforward/ApplicationPortForwardingWizardPage.java
Log:
JBIDE-11696 showing a dialog now if errors for one or more ports failed
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.client/.classpath
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.client/.classpath 2012-04-27 23:32:45 UTC (rev 40600)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.client/.classpath 2012-04-27 23:53:42 UTC (rev 40601)
@@ -3,7 +3,7 @@
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src"/>
- <classpathentry exported="true" kind="lib" path="openshift-java-client-2.0.0-SNAPSHOT.jar" sourcepath="/openshift-java-client"/>
+ <classpathentry exported="true" kind="lib" path="openshift-java-client-2.0.0-SNAPSHOT.jar" sourcepath="/openshift-java-client/src/main/java"/>
<classpathentry kind="lib" path="jboss-dmr-1.0.0.Final.jar"/>
<classpathentry kind="lib" path="log4j-1.2.16.jar"/>
<classpathentry kind="lib" path="slf4j-api-1.6.1.jar"/>
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/portforward/ApplicationPortForwardingWizardPage.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/portforward/ApplicationPortForwardingWizardPage.java 2012-04-27 23:32:45 UTC (rev 40600)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/portforward/ApplicationPortForwardingWizardPage.java 2012-04-27 23:53:42 UTC (rev 40601)
@@ -1,5 +1,7 @@
package org.jboss.tools.openshift.express.internal.core.portforward;
+import java.util.List;
+
import org.eclipse.core.databinding.DataBindingContext;
import org.eclipse.core.databinding.beans.BeanProperties;
import org.eclipse.core.databinding.observable.value.IObservableValue;
@@ -196,6 +198,22 @@
} catch (Exception e) {
return OpenShiftUIActivator.createErrorStatus("Failed to start port-forwarding.", e);
}
+
+ try {
+ if(wizardModel.getApplication().isPortFowardingStarted()) {
+ List<IApplicationPortForwarding> forwardablePorts = wizardModel.getForwardablePorts();
+ for (IApplicationPortForwarding portfwd : forwardablePorts) {
+ if (!portfwd.isStarted(wizardModel.getApplication().getSSHSession())) {
+ return OpenShiftUIActivator.createErrorStatus("Failed to start port-forwarding for one or more ports. See console for errors.");
+ }
+ }
+ } else {
+ return OpenShiftUIActivator.createErrorStatus("Failed to start port-forwarding. See console for errors.");
+ }
+ } catch (OpenShiftSSHOperationException e) {
+ return OpenShiftUIActivator.createErrorStatus("Problem checking port forward status during start. See console for errors.");
+ }
+
return Status.OK_STATUS;
}
}, getContainer(), getDataBindingContext());
12 years, 8 months
JBoss Tools SVN: r40600 - trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/portforward.
by jbosstools-commits@lists.jboss.org
Author: max.andersen(a)jboss.com
Date: 2012-04-27 19:32:45 -0400 (Fri, 27 Apr 2012)
New Revision: 40600
Modified:
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/portforward/ApplicationPortForwardingWizardModel.java
Log:
JBIDE-11691 fixed another recalc and made 'find free ports' actually work
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/portforward/ApplicationPortForwardingWizardModel.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/portforward/ApplicationPortForwardingWizardModel.java 2012-04-27 23:23:48 UTC (rev 40599)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/portforward/ApplicationPortForwardingWizardModel.java 2012-04-27 23:32:45 UTC (rev 40600)
@@ -148,7 +148,9 @@
* @throws OpenShiftSSHOperationException
*/
public void setUseFreePorts(Boolean useFreePorts) throws OpenShiftSSHOperationException {
- updateLocalPortBindings(useFreePorts);
+ if(!application.isPortFowardingStarted()) { // do not change the current bindings if port forwarding is already started.
+ updateLocalPortBindings(useFreePorts);
+ }
firePropertyChange(PROPERTY_USE_DEFAULT_LOCAL_IP_ADDRESS, this.useFreePorts, this.useFreePorts = useFreePorts);
}
@@ -164,14 +166,19 @@
final List<String> bindings = new ArrayList<String>();
// update local bindings while avoiding duplicates
for (IApplicationPortForwarding port : ports) {
- // find duplicate
- port.setLocalPort(port.getRemotePort());
- String key = computeKey(port);
- while (bindings.contains(key)) {
+ if(useFreePorts) {
+ // find free port for every port
port.setLocalPort(SocketUtil.findFreePort());
- key = computeKey(port);
+ } else {
+ // find duplicates and if match we find free port for those until stops.
+ port.setLocalPort(port.getRemotePort());
+ String key = computeKey(port);
+ while (bindings.contains(key)) {
+ port.setLocalPort(SocketUtil.findFreePort());
+ key = computeKey(port);
+ }
+ bindings.add(key);
}
- bindings.add(key);
}
}
12 years, 8 months
JBoss Tools SVN: r40599 - trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2012-04-27 19:23:48 -0400 (Fri, 27 Apr 2012)
New Revision: 40599
Modified:
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/EditDomainWizardPage.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/EditDomainWizardPageModel.java
Log:
[JBIDE-11265] checking if the current value in the text field is the same as the current domainId
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/EditDomainWizardPage.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/EditDomainWizardPage.java 2012-04-27 23:20:52 UTC (rev 40598)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/EditDomainWizardPage.java 2012-04-27 23:23:48 UTC (rev 40599)
@@ -86,6 +86,9 @@
@Override
protected IStatus validate() {
final String domainName = (String) domainNameObservable.getValue();
+ if (pageModel.isCurrentDomainId(domainName)) {
+ return ValidationStatus.cancel(getDescription());
+ }
if (domainName.isEmpty()) {
return ValidationStatus.cancel(
"Enter a domain name with lower-case letters and digits only. Max length is 16 characters.");
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/EditDomainWizardPageModel.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/EditDomainWizardPageModel.java 2012-04-27 23:20:52 UTC (rev 40598)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/EditDomainWizardPageModel.java 2012-04-27 23:23:48 UTC (rev 40599)
@@ -14,8 +14,10 @@
import org.jboss.tools.common.ui.databinding.ObservableUIPojo;
import org.jboss.tools.openshift.express.internal.core.console.UserDelegate;
+import org.jboss.tools.openshift.express.internal.ui.OpenShiftUIActivator;
import org.jboss.tools.openshift.express.internal.ui.utils.Logger;
+import com.openshift.client.IDomain;
import com.openshift.client.OpenShiftException;
/**
@@ -59,4 +61,18 @@
Logger.warn("Attempting to rename missing user domain...");
}
}
+
+ public boolean isCurrentDomainId(String domainId) {
+ IDomain domain;
+ try {
+ domain = user.getDefaultDomain();
+ if (domain == null) {
+ return false;
+ }
+ return domain.getId().equals(domainId);
+ } catch (Exception e) {
+ OpenShiftUIActivator.log(e);
+ return true;
+ }
+ }
}
12 years, 8 months
JBoss Tools SVN: r40598 - trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2012-04-27 19:20:52 -0400 (Fri, 27 Apr 2012)
New Revision: 40598
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/AbstractBeanElement.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/ClassBean.java
Log:
JBIDE-11540
https://issues.jboss.org/browse/JBIDE-11540
Collecting bean stereotypes is fixed.
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/AbstractBeanElement.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/AbstractBeanElement.java 2012-04-27 23:19:59 UTC (rev 40597)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/AbstractBeanElement.java 2012-04-27 23:20:52 UTC (rev 40598)
@@ -145,42 +145,55 @@
}
public Set<IStereotypeDeclaration> getStereotypeDeclarations() {
- return getStereotypeDeclarations(true);
+ return getStereotypeDeclarations(false);
}
public Set<IStereotypeDeclaration> getStereotypeDeclarations(boolean includeInherited) {
Set<IStereotypeDeclaration> result = new HashSet<IStereotypeDeclaration>();
+ Set<IStereotype> ss = new HashSet<IStereotype>();
for (IAnnotationDeclaration d: definition.getAnnotations()) {
if(d instanceof IStereotypeDeclaration) {
- if(d instanceof IStereotypeDeclaration) {
- result.add((IStereotypeDeclaration)d);
+ IStereotypeDeclaration sd = (IStereotypeDeclaration)d;
+ result.add(sd);
+ if(sd.getStereotype() != null) ss.add(sd.getStereotype());
+ }
+ }
+ Set<IStereotypeDeclaration> delta1 = result;
+ Set<IStereotypeDeclaration> delta2 = new HashSet<IStereotypeDeclaration>();
+ while(!delta1.isEmpty()) {
+ for (IStereotypeDeclaration d: delta1) {
+ IStereotype s = d.getStereotype();
+ if(s == null) continue;
+ Set<IStereotypeDeclaration> ds = s.getStereotypeDeclarations();
+ for (IStereotypeDeclaration d1: ds) {
+ if(d1.getStereotype() != null) {
+ if(!result.contains(d1) && !delta2.contains(d1)) delta2.add(d1);
+ }
}
}
+ if(delta2.isEmpty()) break;
+ for (IStereotypeDeclaration d: delta2) {
+ result.add(d);
+ if(d.getStereotype() != null) ss.add(d.getStereotype());
+ }
+ delta1 = delta2;
+ delta2 = new HashSet<IStereotypeDeclaration>();
}
if(includeInherited) {
- Set<IStereotypeDeclaration> delta1 = result;
- Set<IStereotypeDeclaration> delta2 = new HashSet<IStereotypeDeclaration>();
- while(!delta1.isEmpty()) {
- for (IStereotypeDeclaration d: delta1) {
- IStereotype s = d.getStereotype();
- if(s == null) continue;
- Set<IStereotypeDeclaration> ds = s.getStereotypeDeclarations();
- for (IStereotypeDeclaration d1: ds) {
- IStereotype s1 = d1.getStereotype();
- if(s1 != null/* && s1.getInheritedDeclaration() != null*/) {
- if(!result.contains(d1) && !delta2.contains(d1)) delta2.add(d1);
- }
- }
+ Set<IStereotypeDeclaration> ds = getInheritedStereotypDeclarations();
+ for (IStereotypeDeclaration d : ds) {
+ if (d.getStereotype() != null && !ss.contains(d.getStereotype())) {
+ result.add(d);
}
- if(delta2.isEmpty()) break;
- result.addAll(delta2);
- delta1 = delta2;
- delta2 = new HashSet<IStereotypeDeclaration>();
}
}
return result;
}
+ public Set<IStereotypeDeclaration> getInheritedStereotypDeclarations() {
+ return Collections.emptySet();
+ }
+
public Set<IQualifierDeclaration> getQualifierDeclarations() {
return getQualifierDeclarations(false);
}
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/ClassBean.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/ClassBean.java 2012-04-27 23:19:59 UTC (rev 40597)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/ClassBean.java 2012-04-27 23:20:52 UTC (rev 40598)
@@ -431,7 +431,7 @@
if(getCDIProject().isClassAlternativeActivated(getDefinition().getQualifiedName())) {
return true;
}
- Set<IStereotypeDeclaration> ds = getStereotypeDeclarations();
+ Set<IStereotypeDeclaration> ds = getStereotypeDeclarations(true);
for (IStereotypeDeclaration d: ds) {
IStereotype s = d.getStereotype();
if(s != null && s.isAlternative() && !getCDIProject().getAlternatives(s.getSourceType().getFullyQualifiedName()).isEmpty()) {
@@ -569,7 +569,7 @@
if(getDefinition().getAlternativeAnnotation() != null && getCDIProject().isTypeAlternative(getBeanClass().getFullyQualifiedName())) {
return true;
}
- Set<IStereotypeDeclaration> ds = getStereotypeDeclarations();
+ Set<IStereotypeDeclaration> ds = getStereotypeDeclarations(true);
for (IStereotypeDeclaration d: ds) {
IStereotype s = d.getStereotype();
if(s != null && s.isAlternative() &&
12 years, 8 months