Permalink
Browse files

Merge remote branch 'origin/release'

  • Loading branch information...
ingo committed Feb 13, 2012
2 parents b770e5d + 31380f1 commit ece91c725327d86096a66d47a0c69b85e73dd017
@@ -2,7 +2,7 @@
<feature
id="com.aptana.feature"
label="%featureName"
- version="3.0.8.qualifier"
+ version="3.0.9.qualifier"
provider-name="%providerName"
plugin="com.aptana.branding">
@@ -2,5 +2,5 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: com.aptana.branding
-Bundle-Version: 3.0.8.qualifier
+Bundle-Version: 3.0.9.qualifier
Bundle-Vendor: %providerName
@@ -123,7 +123,11 @@ public void dispose()
{
fTextEditor = null;
fDoubleClickStrategy = null;
- fReconciler = null;
+ if (fReconciler != null)
+ {
+ fReconciler.dispose();
+ fReconciler = null;
+ }
if (fAutoActivationListener != null)
{
EclipseUtil.instanceScope().getNode(CommonEditorPlugin.PLUGIN_ID)
@@ -26,7 +26,7 @@
public class CommonReconciler extends Reconciler
{
- private final IReconcilingStrategy defaultStrategy;
+ private IReconcilingStrategy defaultStrategy;
private final Set<IReconcilingStrategy> reconcilingStrategies = new HashSet<IReconcilingStrategy>();
private BundleChangeReconcileTrigger bundleChangeReconcileTrigger;
@@ -46,6 +46,15 @@ public CommonReconciler(IReconcilingStrategy defaultStrategy)
setReconcilingStrategy(defaultStrategy, String.valueOf(System.currentTimeMillis()));
}
+ public void dispose()
+ {
+ if (defaultStrategy instanceof IDisposableReconcilingStrategy)
+ {
+ ((IDisposableReconcilingStrategy) defaultStrategy).dispose();
+ }
+ defaultStrategy = null;
+ }
+
/*
* (non-Javadoc)
* @see org.eclipse.jface.text.reconciler.Reconciler#setReconcilingStrategy(org.eclipse.jface.text.reconciler.
@@ -25,10 +25,11 @@
import com.aptana.core.logging.IdeLog;
import com.aptana.editor.common.AbstractThemeableEditor;
import com.aptana.editor.common.CommonEditorPlugin;
-import com.aptana.editor.common.parsing.FileService;
+import com.aptana.editor.common.outline.IParseListener;
+import com.aptana.parsing.IParseState;
public class CommonReconcilingStrategy implements IReconcilingStrategy, IReconcilingStrategyExtension,
- IBatchReconcilingStrategy
+ IBatchReconcilingStrategy, IDisposableReconcilingStrategy
{
private AbstractThemeableEditor fEditor;
@@ -43,20 +44,76 @@
private IFoldingComputer folder;
- public CommonReconcilingStrategy(AbstractThemeableEditor editor)
+ private IPropertyListener propertyListener = new IPropertyListener()
{
- fEditor = editor;
- fEditor.addPropertyListener(new IPropertyListener()
+
+ public void propertyChanged(Object source, int propId)
{
+ if (propId == IEditorPart.PROP_INPUT)
+ {
+ reconcile(false, true);
+ }
+ }
+ };
- public void propertyChanged(Object source, int propId)
+ private boolean isInitialReconcile;
+ private IParseListener parseListener = new IParseListener()
+ {
+
+ public void afterParse(IParseState parseState)
+ {
+ if (fEditor == null)
+ {
+ return;
+ }
+ // only do folding and validation when parsing happened
+ try
{
- if (propId == IEditorPart.PROP_INPUT)
+ if (fEditor.isFoldingEnabled())
{
- reconcile(false, true);
- }
+ calculatePositions(isInitialReconcile, fMonitor);
+ }
+ else
+ {
+ synchronized (fPositions)
+ {
+ fPositions.clear();
+ }
+ updatePositions();
+ }
+ fEditor.getFileService().validate();
+ }
+ catch (Exception e)
+ {
+ IdeLog.logError(CommonEditorPlugin.getDefault(), e);
}
- });
+ }
+
+ public void beforeParse(IParseState parseState)
+ {
+ }
+
+ public void parseCompletedSuccessfully()
+ {
+ }
+ };
+
+ public CommonReconcilingStrategy(AbstractThemeableEditor editor)
+ {
+ fEditor = editor;
+ fEditor.addPropertyListener(propertyListener);
+ fEditor.getFileService().addListener(parseListener);
+ }
+
+ public void dispose()
+ {
+ if (fEditor != null)
+ {
+ fEditor.getFileService().removeListener(parseListener);
+ fEditor.removePropertyListener(propertyListener);
+ fEditor = null;
+ }
+ fPositions.clear();
}
public AbstractThemeableEditor getEditor()
@@ -172,29 +229,9 @@ private void reconcile(boolean initialReconcile)
private void reconcile(boolean initialReconcile, boolean force)
{
- FileService fileService = fEditor.getFileService();
+ isInitialReconcile = initialReconcile;
// doing a full parse at the moment
- if (force || fileService.parse(fMonitor))
- {
- // only do folding and validation when the source was changed
- if (fEditor.isFoldingEnabled())
- {
- calculatePositions(initialReconcile, fMonitor);
- }
- else
- {
- synchronized (fPositions)
- {
- fPositions.clear();
- }
- updatePositions();
- }
- if (fMonitor != null && fMonitor.isCanceled())
- {
- return;
- }
- fEditor.getFileService().validate();
- }
+ fEditor.getFileService().parse(force, fMonitor);
}
public void fullReconcile()
@@ -19,7 +19,7 @@
* passed on to the contained strategies.
*/
public class CompositeReconcilingStrategy implements IReconcilingStrategy, IReconcilingStrategyExtension,
- IBatchReconcilingStrategy
+ IBatchReconcilingStrategy, IDisposableReconcilingStrategy
{
/** The list of internal reconciling strategies. */
@@ -33,6 +33,17 @@ public CompositeReconcilingStrategy(IReconcilingStrategy... strategies)
fStrategies = (strategies != null) ? strategies : new IReconcilingStrategy[0];
}
+ public void dispose()
+ {
+ for (IReconcilingStrategy strategy : fStrategies)
+ {
+ if (strategy instanceof IDisposableReconcilingStrategy)
+ {
+ ((IDisposableReconcilingStrategy) strategy).dispose();
+ }
+ }
+ }
+
/*
* (non-Javadoc)
* @see org.eclipse.jface.text.reconciler.IReconcilingStrategy#setDocument(org.eclipse.jface.text.IDocument)
@@ -0,0 +1,19 @@
+/**
+ * Aptana Studio
+ * Copyright (c) 2005-2011 by Appcelerator, Inc. All Rights Reserved.
+ * Licensed under the terms of the GNU Public License (GPL) v3 (with exceptions).
+ * Please see the license.html included with this distribution for details.
+ * Any modifications to this file must keep this entire header intact.
+ */
+package com.aptana.editor.common.text.reconciler;
+
+/**
+ * A reconciling strategy that has content to dispose when it is no longer used.
+ *
+ * @author Michael Xia (mxia@appcelerator.com)
+ */
+public interface IDisposableReconcilingStrategy
+{
+
+ public void dispose();
+}
@@ -506,11 +506,13 @@ private void pushDeclarationValueNode(CSSExpressionNode expressionNode, boolean
int expressionEndOffset = expressionNode.getEndingOffset();
int semicolonLocation = locateCharacterSkippingWhitespaces(document, expressionEndOffset + 1, ';', false);
int commaLocation = locateCharacterSkippingWhitespaces(document, expressionEndOffset + 1, ',', false);
+ int forwardSlashLocation = locateCharacterSkippingWhitespaces(document, expressionEndOffset + 1, '/', false);
int LFLocation = locateCharacterSkippingWhitespaces(document, expressionEndOffset + 1, '\n', false);
int CRLocation = locateCharacterSkippingWhitespaces(document, expressionEndOffset + 1, '\r', false);
boolean endsWithSemicolon = false;
boolean endsWithComma = false;
+ boolean endsWithSlash = false;
boolean isLastNodeInDeclaration = false;
if (document.charAt(semicolonLocation) == ';')
@@ -523,13 +525,18 @@ private void pushDeclarationValueNode(CSSExpressionNode expressionNode, boolean
endsWithComma = true;
}
+ if (document.charAt(forwardSlashLocation) == '/')
+ {
+ endsWithSlash = true;
+ }
+
if ((document.charAt(LFLocation) == '\n' || document.charAt(CRLocation) == '\r') && isLastDeclaration)
{
isLastNodeInDeclaration = true;
}
FormatterBlockWithBeginNode formatterDeclarationValueNode = new FormatterCSSDeclarationValueNode(document,
- isLastNodeInDeclaration, endsWithComma || endsWithSemicolon);
+ isLastNodeInDeclaration, endsWithComma || endsWithSemicolon || endsWithSlash);
formatterDeclarationValueNode.setBegin(createTextNode(document, expressionNode.getStartingOffset(),
expressionNode.getEndingOffset() + 1));
@@ -540,7 +547,6 @@ private void pushDeclarationValueNode(CSSExpressionNode expressionNode, boolean
{
findAndPushPunctuationNode(TypePunctuation.COMMA, commaLocation, false);
}
-
}
private void pushTermListNode(CSSTermListNode termListNode, boolean isLastDeclaration)
@@ -0,0 +1,3 @@
+# This file is here so we can turn on tracing for the plugin to have debug logs
+com.aptana.git.ui/debug=true
+com.aptana.gui.ui/debug/action=true
@@ -33,5 +33,6 @@ Export-Package: com.aptana.git.ui,
com.aptana.git.ui.actions,
com.aptana.git.ui.dialogs,
com.aptana.git.ui.internal.actions,
- com.aptana.git.ui.internal.history
+ com.aptana.git.ui.internal.history,
+ com.aptana.git.ui.util
Eclipse-ExtensibleAPI: true
@@ -6,5 +6,6 @@ bin.includes = META-INF/,\
plugin.xml,\
icons/,\
templates/,\
- license.html
+ license.html,\
+ .options
qualifier = context
@@ -0,0 +1,14 @@
+/**
+ * Aptana Studio
+ * Copyright (c) 2005-2011 by Appcelerator, Inc. All Rights Reserved.
+ * Licensed under the terms of the GNU Public License (GPL) v3 (with exceptions).
+ * Please see the license.html included with this distribution for details.
+ * Any modifications to this file must keep this entire header intact.
+ */
+package com.aptana.git.ui;
+
+public interface IDebugScopes
+{
+
+ String ACTION = GitUIPlugin.getPluginId() + "/debug/action"; //$NON-NLS-1$
+}
@@ -27,6 +27,10 @@
import org.eclipse.core.runtime.jobs.IJobChangeListener;
import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.team.core.RepositoryProvider;
+import org.eclipse.team.core.TeamException;
+
+import com.aptana.core.logging.IdeLog;
+import com.aptana.git.ui.GitUIPlugin;
public class DisconnectHandler extends AbstractGitHandler
{
@@ -63,21 +67,35 @@ public IStatus runInWorkspace(IProgressMonitor monitor) throws CoreException
SubMonitor sub = SubMonitor.convert(monitor, 100);
// Set back all the team privates to false!
- project.accept(new IResourceProxyVisitor()
+ try
{
-
- public boolean visit(IResourceProxy proxy) throws CoreException
+ project.accept(new IResourceProxyVisitor()
{
- if (proxy.isTeamPrivateMember())
+
+ public boolean visit(IResourceProxy proxy) throws CoreException
{
- proxy.requestResource().setTeamPrivateMember(false);
+ if (proxy.isTeamPrivateMember())
+ {
+ proxy.requestResource().setTeamPrivateMember(false);
+ }
+ return true;
}
- return true;
- }
- }, IContainer.INCLUDE_TEAM_PRIVATE_MEMBERS);
+ }, IContainer.INCLUDE_TEAM_PRIVATE_MEMBERS);
+ }
+ catch (CoreException e)
+ {
+ IdeLog.logError(GitUIPlugin.getDefault(), e);
+ }
sub.worked(20);
- RepositoryProvider.unmap(project);
+ try
+ {
+ RepositoryProvider.unmap(project);
+ }
+ catch (TeamException e)
+ {
+ IdeLog.logError(GitUIPlugin.getDefault(), e);
+ }
sub.worked(10);
getGitRepositoryManager().removeRepository(project);
Oops, something went wrong.

0 comments on commit ece91c7

Please sign in to comment.