This repository has been archived by the owner on Jul 13, 2022. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[PT-#150812522] Beans tab for Boot Dash
- Loading branch information
Showing
80 changed files
with
1,573 additions
and
591 deletions.
There are no files selected for viewing
7 changes: 7 additions & 0 deletions
7
plugins/org.springframework.ide.eclipse.beans.ui.live/.classpath
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<classpath> | ||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/> | ||
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/> | ||
<classpathentry kind="src" path="src"/> | ||
<classpathentry kind="output" path="bin"/> | ||
</classpath> |
28 changes: 28 additions & 0 deletions
28
plugins/org.springframework.ide.eclipse.beans.ui.live/.project
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<projectDescription> | ||
<name>org.springframework.ide.eclipse.beans.ui.live</name> | ||
<comment></comment> | ||
<projects> | ||
</projects> | ||
<buildSpec> | ||
<buildCommand> | ||
<name>org.eclipse.jdt.core.javabuilder</name> | ||
<arguments> | ||
</arguments> | ||
</buildCommand> | ||
<buildCommand> | ||
<name>org.eclipse.pde.ManifestBuilder</name> | ||
<arguments> | ||
</arguments> | ||
</buildCommand> | ||
<buildCommand> | ||
<name>org.eclipse.pde.SchemaBuilder</name> | ||
<arguments> | ||
</arguments> | ||
</buildCommand> | ||
</buildSpec> | ||
<natures> | ||
<nature>org.eclipse.pde.PluginNature</nature> | ||
<nature>org.eclipse.jdt.core.javanature</nature> | ||
</natures> | ||
</projectDescription> |
7 changes: 7 additions & 0 deletions
7
plugins/org.springframework.ide.eclipse.beans.ui.live/.settings/org.eclipse.jdt.core.prefs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
eclipse.preferences.version=1 | ||
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled | ||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 | ||
org.eclipse.jdt.core.compiler.compliance=1.8 | ||
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error | ||
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error | ||
org.eclipse.jdt.core.compiler.source=1.8 |
22 changes: 22 additions & 0 deletions
22
plugins/org.springframework.ide.eclipse.beans.ui.live/META-INF/MANIFEST.MF
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
Manifest-Version: 1.0 | ||
Bundle-ManifestVersion: 2 | ||
Bundle-Name: Live Beans Tree | ||
Bundle-SymbolicName: org.springframework.ide.eclipse.beans.ui.live;singleton:=true | ||
Bundle-Version: 3.9.1.qualifier | ||
Bundle-RequiredExecutionEnvironment: JavaSE-1.8 | ||
Export-Package: org.springframework.ide.eclipse.beans.ui.live, | ||
org.springframework.ide.eclipse.beans.ui.live.actions, | ||
org.springframework.ide.eclipse.beans.ui.live.model, | ||
org.springframework.ide.eclipse.beans.ui.live.tree | ||
Require-Bundle: org.eclipse.core.runtime, | ||
org.eclipse.ui.views, | ||
org.json, | ||
org.eclipse.core.resources, | ||
org.apache.commons.lang, | ||
org.eclipse.jface, | ||
org.eclipse.ui.workbench, | ||
org.eclipse.jdt.core, | ||
org.springsource.ide.eclipse.commons.ui | ||
Bundle-ActivationPolicy: lazy | ||
Bundle-Vendor: Spring IDE Developers | ||
Bundle-Activator: org.springframework.ide.eclipse.beans.ui.live.LiveBeansUiPlugin |
4 changes: 4 additions & 0 deletions
4
plugins/org.springframework.ide.eclipse.beans.ui.live/build.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
source.. = src/ | ||
output.. = bin/ | ||
bin.includes = META-INF/,\ | ||
. |
File renamed without changes
File renamed without changes
File renamed without changes
68 changes: 68 additions & 0 deletions
68
plugins/org.springframework.ide.eclipse.beans.ui.live/pom.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
<parent> | ||
<groupId>org.springframework.ide.eclipse</groupId> | ||
<artifactId>org.springframework.ide.eclipse.parent</artifactId> | ||
<version>3.9.1-SNAPSHOT</version> | ||
<relativePath>../../pom.xml</relativePath> | ||
</parent> | ||
<groupId>org.springframework.ide.eclipse</groupId> | ||
<artifactId>org.springframework.ide.eclipse.beans.ui.live</artifactId> | ||
|
||
<packaging>eclipse-plugin</packaging> | ||
|
||
<build> | ||
<plugins> | ||
|
||
<plugin> | ||
<groupId>org.eclipse.tycho</groupId> | ||
<artifactId>target-platform-configuration</artifactId> | ||
<version>${tycho-version}</version> | ||
<configuration> | ||
<resolver>p2</resolver> | ||
<pomDependencies>ignore</pomDependencies> | ||
</configuration> | ||
</plugin> | ||
|
||
<plugin> | ||
<groupId>org.eclipse.tycho</groupId> | ||
<artifactId>tycho-compiler-plugin</artifactId> | ||
<version>${tycho-version}</version> | ||
</plugin> | ||
|
||
<plugin> | ||
<groupId>org.eclipse.tycho</groupId> | ||
<artifactId>tycho-source-plugin</artifactId> | ||
<version>${tycho-version}</version> | ||
<executions> | ||
<execution> | ||
<id>plugin-source</id> | ||
<phase>generate-sources</phase> | ||
<goals> | ||
<goal>plugin-source</goal> | ||
</goals> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
|
||
<plugin> | ||
<groupId>org.eclipse.tycho</groupId> | ||
<artifactId>tycho-p2-plugin</artifactId> | ||
<version>${tycho-version}</version> | ||
<executions> | ||
<execution> | ||
<id>second-generate-p2-metadata</id> | ||
<goals> | ||
<goal>p2-metadata</goal> | ||
</goals> | ||
<phase>verify</phase> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
|
||
</plugins> | ||
</build> | ||
</project> |
64 changes: 64 additions & 0 deletions
64
...se.beans.ui.live/src/org/springframework/ide/eclipse/beans/ui/live/LiveBeansUiPlugin.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2017 Pivotal, Inc. | ||
* All rights reserved. This program and the accompanying materials | ||
* are made available under the terms of the Eclipse Public License v1.0 | ||
* which accompanies this distribution, and is available at | ||
* http://www.eclipse.org/legal/epl-v10.html | ||
* | ||
* Contributors: | ||
* Pivotal, Inc. - initial API and implementation | ||
*******************************************************************************/ | ||
package org.springframework.ide.eclipse.beans.ui.live; | ||
|
||
import org.eclipse.jface.resource.ImageRegistry; | ||
import org.eclipse.ui.plugin.AbstractUIPlugin; | ||
import org.osgi.framework.BundleContext; | ||
|
||
/** | ||
* Live Beans plugin | ||
* | ||
* @author Alex Boyko | ||
* | ||
*/ | ||
public class LiveBeansUiPlugin extends AbstractUIPlugin { | ||
|
||
// The plug-in ID | ||
public static final String PLUGIN_ID = "org.springframework.ide.eclipse.beans.ui.live"; //$NON-NLS-1$ | ||
|
||
private static final String ICON_PATH_PREFIX = "icons/"; | ||
private static final String NAME_PREFIX = PLUGIN_ID + '.'; | ||
private static final int NAME_PREFIX_LENGTH = NAME_PREFIX.length(); | ||
|
||
public static final String IMG_OBJS_BEAN = NAME_PREFIX + "bean_obj.gif"; | ||
public static final String IMG_OBJS_BEAN_REF = NAME_PREFIX + "beanref_obj.gif"; | ||
public static final String IMG_OBJS_CONFIG = NAME_PREFIX + "config_obj.gif"; | ||
|
||
private static LiveBeansUiPlugin plugin; | ||
|
||
|
||
@Override | ||
public void start(BundleContext context) throws Exception { | ||
super.start(context); | ||
plugin = this; | ||
} | ||
|
||
@Override | ||
public void stop(BundleContext context) throws Exception { | ||
plugin = null; | ||
super.stop(context); | ||
} | ||
|
||
public static LiveBeansUiPlugin getDefault() { | ||
return plugin; | ||
} | ||
|
||
@Override | ||
protected void initializeImageRegistry(ImageRegistry reg) { | ||
super.initializeImageRegistry(reg); | ||
reg.put(IMG_OBJS_BEAN, imageDescriptorFromPlugin(PLUGIN_ID, ICON_PATH_PREFIX + IMG_OBJS_BEAN.substring(NAME_PREFIX_LENGTH))); | ||
reg.put(IMG_OBJS_BEAN_REF, imageDescriptorFromPlugin(PLUGIN_ID, ICON_PATH_PREFIX + IMG_OBJS_BEAN_REF.substring(NAME_PREFIX_LENGTH))); | ||
reg.put(IMG_OBJS_CONFIG, imageDescriptorFromPlugin(PLUGIN_ID, ICON_PATH_PREFIX + IMG_OBJS_CONFIG.substring(NAME_PREFIX_LENGTH))); | ||
} | ||
|
||
|
||
} |
60 changes: 60 additions & 0 deletions
60
...src/org/springframework/ide/eclipse/beans/ui/live/actions/AbstractOpenResourceAction.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2013, 2017 Pivotal, Inc. | ||
* All rights reserved. This program and the accompanying materials | ||
* are made available under the terms of the Eclipse Public License v1.0 | ||
* which accompanies this distribution, and is available at | ||
* http://www.eclipse.org/legal/epl-v10.html | ||
* | ||
* Contributors: | ||
* Pivotal, Inc. - initial API and implementation | ||
*******************************************************************************/ | ||
package org.springframework.ide.eclipse.beans.ui.live.actions; | ||
|
||
import org.eclipse.jdt.core.IType; | ||
import org.eclipse.ui.actions.BaseSelectionListenerAction; | ||
import org.springframework.ide.eclipse.beans.ui.live.model.TypeLookup; | ||
import org.springsource.ide.eclipse.commons.ui.SpringUIUtils; | ||
|
||
/** | ||
* @author Leo Dos Santos | ||
* @author Alex Boyko | ||
*/ | ||
public abstract class AbstractOpenResourceAction extends BaseSelectionListenerAction { | ||
|
||
protected AbstractOpenResourceAction(String text) { | ||
super(text); | ||
} | ||
|
||
protected String extractClassName(String resourcePath) { | ||
int index = resourcePath.lastIndexOf("/WEB-INF/classes/"); | ||
int length = "/WEB-INF/classes/".length(); | ||
if (index >= 0) { | ||
resourcePath = resourcePath.substring(index + length); | ||
} | ||
resourcePath = resourcePath.substring(0, resourcePath.lastIndexOf(".class")); | ||
resourcePath = resourcePath.replaceAll("\\\\|\\/", "."); //Tolerate both '/' and '\'. | ||
return resourcePath; | ||
} | ||
|
||
protected String extractResourcePath(String resourceStr) { | ||
// Extract the resource path out of the descriptive text | ||
int indexStart = resourceStr.indexOf("["); | ||
int indexEnd = resourceStr.indexOf("]"); | ||
if (indexStart > -1 && indexEnd > -1 && indexStart < indexEnd) { | ||
resourceStr = resourceStr.substring(indexStart + 1, indexEnd); | ||
} | ||
return resourceStr; | ||
} | ||
|
||
protected boolean hasTypeInProject(TypeLookup workspaceContext, String className) { | ||
return workspaceContext.findType(className) != null; | ||
} | ||
|
||
protected void openInEditor(TypeLookup workspaceContext, String className) { | ||
IType type = workspaceContext.findType(className); | ||
if (type != null) { | ||
SpringUIUtils.openInEditor(type); | ||
} | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
65 changes: 65 additions & 0 deletions
65
...e/src/org/springframework/ide/eclipse/beans/ui/live/actions/OpenBeanDefinitionAction.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2012, 2017 Pivotal, Inc. | ||
* All rights reserved. This program and the accompanying materials | ||
* are made available under the terms of the Eclipse Public License v1.0 | ||
* which accompanies this distribution, and is available at | ||
* http://www.eclipse.org/legal/epl-v10.html | ||
* | ||
* Contributors: | ||
* Pivotal, Inc. - initial API and implementation | ||
*******************************************************************************/ | ||
package org.springframework.ide.eclipse.beans.ui.live.actions; | ||
|
||
import java.util.List; | ||
|
||
import org.eclipse.jface.viewers.IStructuredSelection; | ||
import org.springframework.ide.eclipse.beans.ui.live.model.LiveBean; | ||
import org.springframework.ide.eclipse.beans.ui.live.model.TypeLookup; | ||
|
||
/** | ||
* @author Leo Dos Santos | ||
* @author Alex Boyko | ||
*/ | ||
public class OpenBeanDefinitionAction extends AbstractOpenResourceAction { | ||
|
||
public OpenBeanDefinitionAction() { | ||
super("Open Bean Definition File"); | ||
} | ||
|
||
@Override | ||
public void run() { | ||
IStructuredSelection selection = getStructuredSelection(); | ||
List<?> elements = selection.toList(); | ||
for (Object obj : elements) { | ||
if (obj instanceof LiveBean) { | ||
LiveBean bean = (LiveBean) obj; | ||
TypeLookup session = bean.getTypeLookup(); | ||
String resource = bean.getResource(); | ||
if (resource != null && resource.trim().length() > 0 && !resource.equalsIgnoreCase("null")) { | ||
String resourcePath = extractResourcePath(resource); | ||
if (resourcePath.endsWith(".class")) { | ||
openInEditor(session, extractClassName(resourcePath)); | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
@Override | ||
protected boolean updateSelection(IStructuredSelection selection) { | ||
if (!selection.isEmpty()) { | ||
List<?> elements = selection.toList(); | ||
for (Object obj : elements) { | ||
if (obj instanceof LiveBean) { | ||
LiveBean bean = (LiveBean) obj; | ||
String resource = bean.getResource(); | ||
if (resource != null && resource.trim().length() > 0 && !resource.equalsIgnoreCase("null")) { | ||
return true; | ||
} | ||
} | ||
} | ||
} | ||
return false; | ||
} | ||
|
||
} |
Oops, something went wrong.