Skip to content

Commit

Permalink
Move 'headless' extensions to core projects, whenever possible
Browse files Browse the repository at this point in the history
To allow integrators to easily build on on the headless support
which enables displaying the compare editor and therefore all 
revision operations ( comment, publish review, discard review draft )
a minimal subclipse.core plugin is introduced and the extension
contributed through the ui plugin.
  • Loading branch information
rombert committed Oct 19, 2011
1 parent a88392d commit 01b0c2e
Show file tree
Hide file tree
Showing 25 changed files with 338 additions and 16 deletions.
17 changes: 17 additions & 0 deletions .project
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>ereviewboard</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.m2e.core.maven2Builder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.m2e.core.maven2Nature</nature>
</natures>
</projectDescription>
5 changes: 5 additions & 0 deletions .settings/org.eclipse.m2e.core.prefs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#Wed Oct 19 12:14:03 EEST 2011
activeProfiles=
eclipse.preferences.version=1
resolveWorkspaceProjects=true
version=1
1 change: 1 addition & 0 deletions org.review_board.ereviewboard.core/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ Require-Bundle: org.eclipse.core.runtime,
Export-Package: org.review_board.ereviewboard.core,
org.review_board.ereviewboard.core.client,
org.review_board.ereviewboard.core.exception,
org.review_board.ereviewboard.core.internal.scm;x-friends:="org.review_board.ereviewboard.subclipse.ui",
org.review_board.ereviewboard.core.model,
org.review_board.ereviewboard.core.model.reviews,
org.review_board.ereviewboard.core.util
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* Contributors:
* Robert Munteanu - initial API and implementation
*******************************************************************************/
package org.review_board.ereviewboard.ui.editor.ext;
package org.review_board.ereviewboard.core.internal.scm;

import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
Expand Down
7 changes: 7 additions & 0 deletions org.review_board.ereviewboard.subclipse.core/.classpath
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/J2SE-1.5"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src/"/>
<classpathentry kind="output" path="target/classes"/>
</classpath>
2 changes: 2 additions & 0 deletions org.review_board.ereviewboard.subclipse.core/.options
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
org.review_board.ereviewboard.subclipse.core/debug=false
org.review_board.ereviewboard.subclipse.core/debug/diff=false
34 changes: 34 additions & 0 deletions org.review_board.ereviewboard.subclipse.core/.project
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>org.review_board.ereviewboard.subclipse.core</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.m2e.core.maven2Builder</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.m2e.core.maven2Nature</nature>
<nature>org.eclipse.pde.PluginNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#Wed Oct 19 12:14:48 EEST 2011
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
org.eclipse.jdt.core.compiler.compliance=1.5
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.source=1.5
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#Wed Oct 19 12:14:03 EEST 2011
activeProfiles=
eclipse.preferences.version=1
resolveWorkspaceProjects=true
version=1
22 changes: 22 additions & 0 deletions org.review_board.ereviewboard.subclipse.core/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %Bundle-Name
Bundle-SymbolicName: org.review_board.ereviewboard.subclipse.core;singleton:=true
Bundle-Version: 0.11.0.qualifier
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Bundle-Localization: OSGI-INF/l10n/bundle
Bundle-Vendor: %Bundle-Vendor
Bundle-ClassPath: .
Require-Bundle: org.eclipse.core.runtime,
org.eclipse.team.core,
org.eclipse.mylyn.tasks.core;bundle-version="[3.6.0,4.0.0)",
org.eclipse.mylyn.tasks.ui;bundle-version="[3.6.0,4.0.0)",
org.review_board.ereviewboard.core,
org.review_board.ereviewboard.ui,
org.review_board.ereviewboard.subclipse.core,
org.apache.commons.io;bundle-version="1.4.0",
org.tigris.subversion.subclipse.core;bundle-version="1.6.0"
Bundle-ActivationPolicy: lazy
Bundle-Activator: org.review_board.ereviewboard.subclipse.core.internal.Activator
Export-Package: org.review_board.ereviewboard.subclipse.core.internal;x-friends:="org.review_board.ereviewboard.subclipse.ui",
org.review_board.ereviewboard.subclipse.core.internal.actions;x-friends:="org.review_board.ereviewboard.subclipse.ui"
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#Properties file for org.review_board.ereviewboard.core
Bundle-Name = eReviewboard Subclipse Core Plug-in
Bundle-Vendor = Markus Knittig
11 changes: 11 additions & 0 deletions org.review_board.ereviewboard.subclipse.core/build.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
source.. = src/
output.. = target/classes/
bin.includes = META-INF/,\
.,\
OSGI-INF/l10n/bundle.properties,\
target/classes/,\
OSGI-INF/l10n/,\
OSGI-INF/,\
.options,\
plugin.xml

12 changes: 12 additions & 0 deletions org.review_board.ereviewboard.subclipse.core/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>ereviewboard</artifactId>
<groupId>org.review_board.ereviewboard</groupId>
<version>0.11.0-SNAPSHOT</version>
</parent>
<artifactId>org.review_board.ereviewboard.subclipse.core</artifactId>
<name>eReviewBoard : Subclipse Integration</name>
<packaging>eclipse-plugin</packaging>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
/*******************************************************************************
* Copyright (c) 2011 Robert Munteanu and others.
* 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:
* Robert Munteanu - initial API and implementation
*******************************************************************************/
package org.review_board.ereviewboard.subclipse.core.internal;

import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.Plugin;
import org.eclipse.core.runtime.Status;
import org.osgi.framework.BundleContext;

/**
* @author Robert Munteanu
*
*/
public class Activator extends Plugin {

public static final String PLUGIN_ID = "org.review_board.ereviewboard.subclipse.core";

private static volatile Activator DEFAULT;

public void start(BundleContext context) throws Exception {

super.start(context);

DEFAULT = this;
}

@Override
public void stop(BundleContext context) throws Exception {

DEFAULT = null;
}

public static Activator getDefault() {

return DEFAULT;
}

public void trace(TraceLocation location, String message) {

if (!Platform.inDebugMode())
return;

String debugOption = Platform.getDebugOption(PLUGIN_ID + "/debug" + location.getPrefix());

if ( !Boolean.parseBoolean(debugOption) )
return;

getLog().log(new Status(IStatus.INFO, PLUGIN_ID, message));
}

/**
*
* @param severity one of the {@link IStatus} severity constants
* @param message
* @param cause the cause, can be <code>null</code>
*
* @see #log(int, String)
*/
public void log(int severity, String message, Throwable cause) {

getLog().log(new Status(severity, PLUGIN_ID, message, cause));
}

/**
*
* @param severity one of the {@link IStatus} severity constants
* @param message
*/
public void log(int severity, String message) {

log(severity, message, null);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/*******************************************************************************
* Copyright (c) 2011 Robert Munteanu and others.
* 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:
* Robert Munteanu - initial API and implementation
*******************************************************************************/
package org.review_board.ereviewboard.subclipse.core.internal;


/**
* @author Robert Munteanu
*
*/
public enum TraceLocation {

MAIN(""), DIFF("/diff");

private final String _prefix;

private TraceLocation(String prefix) {

_prefix = prefix;
}

String getPrefix() {

return _prefix;
}
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
package org.review_board.ereviewboard.subclipse.core.internal.actions;
/*******************************************************************************
* Copyright (c) 2011 Robert Munteanu and others.
* All rights reserved. This program and the accompanying materials
Expand All @@ -8,7 +9,7 @@
* Contributors:
* Robert Munteanu - initial API and implementation
*******************************************************************************/
package org.review_board.ereviewboard.subclipse.internal.actions;


import java.io.IOException;
import java.io.InputStream;
Expand All @@ -19,12 +20,12 @@
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.review_board.ereviewboard.core.internal.scm.SCMFileContentsLocator;
import org.review_board.ereviewboard.core.model.FileDiff;
import org.review_board.ereviewboard.core.model.Repository;
import org.review_board.ereviewboard.core.model.RepositoryType;
import org.review_board.ereviewboard.subclipse.Activator;
import org.review_board.ereviewboard.subclipse.TraceLocation;
import org.review_board.ereviewboard.ui.editor.ext.SCMFileContentsLocator;
import org.review_board.ereviewboard.subclipse.core.internal.Activator;
import org.review_board.ereviewboard.subclipse.core.internal.TraceLocation;
import org.tigris.subversion.subclipse.core.repo.SVNRepositoryLocation;
import org.tigris.subversion.svnclientadapter.SVNClientException;
import org.tigris.subversion.svnclientadapter.SVNRevision;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ Require-Bundle: org.eclipse.core.runtime,
org.eclipse.mylyn.tasks.ui;bundle-version="[3.6.0,4.0.0)",
org.review_board.ereviewboard.core,
org.review_board.ereviewboard.ui,
org.review_board.ereviewboard.subclipse.core,
org.apache.commons.io;bundle-version="1.4.0",
org.tigris.subversion.subclipse.core;bundle-version="1.6.0"
Bundle-Activator: org.review_board.ereviewboard.subclipse.Activator
8 changes: 2 additions & 6 deletions org.review_board.ereviewboard.subclipse.ui/plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
</objectContribution>
</extension>
<extension
id="org.review_board.ereviewboard.subclipse.ui.updateReviewRequest"
point="org.review_board.ereviewboard.ui.taskDiffActions">
<taskDiffAction
id="org.review_board.ereviewboard.subclipse.ui.updateDiff"
Expand All @@ -28,10 +27,7 @@
label="Apply Diff..."
class="org.review_board.ereviewboard.subclipse.internal.actions.ApplyDiffAction"/>
</extension>
<extension
point="org.review_board.ereviewboard.ui.scmFileContentsLocator">
<scmFileContentLocator
id="org.review_board.ereviewboard.subclipse.subclipseSCMFileContentsLocator"
class="org.review_board.ereviewboard.subclipse.internal.actions.SubclipseSCMFileContentsLocator"/>
<extension point="org.review_board.ereviewboard.ui.scmFileContentsLocator">
<scmFileContentsLocator class="org.review_board.ereviewboard.subclipse.core.internal.actions.SubclipseSCMFileContentsLocator"/>
</extension>
</plugin>
7 changes: 7 additions & 0 deletions org.review_board.ereviewboard.subclipse/feature.xml
Original file line number Diff line number Diff line change
Expand Up @@ -127,4 +127,11 @@ Inc. in the United States, other countries, or both.
version="0.0.0"
unpack="false"/>

<plugin
id="org.review_board.ereviewboard.subclipse.core"
download-size="0"
install-size="0"
version="0.0.0"
unpack="false"/>

</feature>
4 changes: 2 additions & 2 deletions org.review_board.ereviewboard.ui/plugin.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.4"?>
<plugin>
<extension-point id="org.review_board.ereviewboard.ui.taskDiffActions" name="taskDiffActions" schema="schema/org.review_board.ereviewboard.ui.taskDiffActions.exsd"/>
<extension-point id="org.review_board.ereviewboard.ui.scmFileContentsLocator" name="scmFileContentsLocator" schema="schema/org.review_board.ereviewboard.ui.scmFileContentsLocator.exsd"/>
<extension-point id="org.review_board.ereviewboard.ui.taskDiffActions" name="taskDiffActions" schema="schema/taskDiffActions.exsd"/>
<extension-point id="org.review_board.ereviewboard.ui.scmFileContentsLocator" name="scmFileContentsLocator" schema="schema/scmFileContentsLocator.exsd"/>
<extension
point="org.eclipse.mylyn.tasks.ui.repositories">
<connectorCore
Expand Down
Loading

0 comments on commit 01b0c2e

Please sign in to comment.