1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-29 19:45:01 +02:00

Backing out previous changes regarding new JFace interfaces

This commit is contained in:
Hoda Amer 2004-04-22 17:32:38 +00:00
parent bbff2f727d
commit 0634c0b3a2
2 changed files with 31 additions and 28 deletions

View file

@ -1,3 +1,6 @@
2004-04-22 Hoda Amer
Backing out previous changes regarding new JFace interfaces.
2004-04-22 Alain Magloire 2004-04-22 Alain Magloire
Fix for PR 59534 Fix for PR 59534

View file

@ -35,13 +35,12 @@ import org.eclipse.jface.text.contentassist.ICompletionProposalExtension;
import org.eclipse.jface.text.contentassist.ICompletionProposalExtension2; import org.eclipse.jface.text.contentassist.ICompletionProposalExtension2;
import org.eclipse.jface.text.contentassist.ICompletionProposalExtension3; import org.eclipse.jface.text.contentassist.ICompletionProposalExtension3;
import org.eclipse.jface.text.contentassist.IContextInformation; import org.eclipse.jface.text.contentassist.IContextInformation;
import org.eclipse.jface.text.link.ILinkedModeListener; import org.eclipse.jface.text.link.ILinkedListener;
import org.eclipse.jface.text.link.LinkedModeModel; import org.eclipse.jface.text.link.LinkedEnvironment;
import org.eclipse.jface.text.link.LinkedModeUI;
import org.eclipse.jface.text.link.LinkedPosition;
import org.eclipse.jface.text.link.LinkedPositionGroup; import org.eclipse.jface.text.link.LinkedPositionGroup;
import org.eclipse.jface.text.link.LinkedModeUI.ExitFlags; import org.eclipse.jface.text.link.LinkedUIControl;
import org.eclipse.jface.text.link.LinkedModeUI.IExitPolicy; import org.eclipse.jface.text.link.LinkedUIControl.ExitFlags;
import org.eclipse.jface.text.link.LinkedUIControl.IExitPolicy;
import org.eclipse.swt.SWT; import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.StyleRange; import org.eclipse.swt.custom.StyleRange;
import org.eclipse.swt.custom.StyledText; import org.eclipse.swt.custom.StyledText;
@ -50,7 +49,8 @@ import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.graphics.Image; import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.graphics.Point; import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.graphics.RGB; import org.eclipse.swt.graphics.RGB;
import org.eclipse.ui.texteditor.link.EditorLinkedModeUI; import org.eclipse.ui.texteditor.link.EditorHistoryUpdater;
public class CCompletionProposal implements ICCompletionProposal, ICompletionProposalExtension, ICompletionProposalExtension2, ICompletionProposalExtension3 { public class CCompletionProposal implements ICCompletionProposal, ICompletionProposalExtension, ICompletionProposalExtension2, ICompletionProposalExtension3 {
@ -118,7 +118,7 @@ public class CCompletionProposal implements ICCompletionProposal, ICompletionPro
/** /**
* Sets the context information. * Sets the context information.
* @param contextInformation The context information associated with this proposal * @param contentInformation The context information associated with this proposal
*/ */
public void setContextInformation(IContextInformation contextInformation) { public void setContextInformation(IContextInformation contextInformation) {
fContextInformation= contextInformation; fContextInformation= contextInformation;
@ -135,7 +135,7 @@ public class CCompletionProposal implements ICCompletionProposal, ICompletionPro
/** /**
* Sets the proposal info. * Sets the proposal info.
* @param proposalInfo The additional information associated with this proposal or <code>null</code> * @param additionalProposalInfo The additional information associated with this proposal or <code>null</code>
*/ */
public void setAdditionalProposalInfo(String proposalInfo) { public void setAdditionalProposalInfo(String proposalInfo) {
fProposalInfo= proposalInfo; fProposalInfo= proposalInfo;
@ -196,17 +196,17 @@ public class CCompletionProposal implements ICCompletionProposal, ICompletionPro
int newOffset= fReplacementOffset + fCursorPosition; int newOffset= fReplacementOffset + fCursorPosition;
LinkedPositionGroup group= new LinkedPositionGroup(); LinkedPositionGroup group= new LinkedPositionGroup();
group.addPosition(new LinkedPosition(document, newOffset, 0, LinkedPositionGroup.NO_STOP)); group.createPosition(document, newOffset, 0);
LinkedModeModel model= new LinkedModeModel(); LinkedEnvironment env= new LinkedEnvironment();
model.addGroup(group); env.addGroup(group);
model.forceInstall(); env.forceInstall();
LinkedModeUI ui= new EditorLinkedModeUI(model, fTextViewer); LinkedUIControl ui= new LinkedUIControl(env, fTextViewer);
ui.setSimpleMode(true); ui.setPositionListener(new EditorHistoryUpdater());
ui.setExitPolicy(new ExitPolicy(')')); ui.setExitPolicy(new ExitPolicy(')'));
ui.setExitPosition(fTextViewer, newOffset + 1, 0, Integer.MAX_VALUE); ui.setExitPosition(fTextViewer, newOffset + 1, 0, Integer.MAX_VALUE);
ui.setCyclingMode(LinkedModeUI.CYCLE_NEVER); ui.setCyclingMode(LinkedUIControl.CYCLE_NEVER);
ui.enter(); ui.enter();
} }
} }
@ -278,18 +278,18 @@ public class CCompletionProposal implements ICCompletionProposal, ICompletionPro
/* /*
* @see org.eclipse.jdt.internal.ui.text.link.LinkedPositionUI.ExitPolicy#doExit(org.eclipse.jdt.internal.ui.text.link.LinkedPositionManager, org.eclipse.swt.events.VerifyEvent, int, int) * @see org.eclipse.jdt.internal.ui.text.link.LinkedPositionUI.ExitPolicy#doExit(org.eclipse.jdt.internal.ui.text.link.LinkedPositionManager, org.eclipse.swt.events.VerifyEvent, int, int)
*/ */
public ExitFlags doExit(LinkedModeModel environment, VerifyEvent event, int offset, int length) { public ExitFlags doExit(LinkedEnvironment environment, VerifyEvent event, int offset, int length) {
if (event.character == fExitCharacter) { if (event.character == fExitCharacter) {
if (environment.anyPositionContains(offset)) if (environment.anyPositionContains(offset))
return new ExitFlags(ILinkedModeListener.UPDATE_CARET, false); return new ExitFlags(ILinkedListener.UPDATE_CARET, false);
else else
return new ExitFlags(ILinkedModeListener.UPDATE_CARET, true); return new ExitFlags(ILinkedListener.UPDATE_CARET, true);
} }
switch (event.character) { switch (event.character) {
case ';': case ';':
return new ExitFlags(ILinkedModeListener.NONE, true); return new ExitFlags(ILinkedListener.NONE, true);
default: default:
return null; return null;
@ -343,11 +343,11 @@ public class CCompletionProposal implements ICCompletionProposal, ICompletionPro
* @see ICompletionProposal#getAdditionalProposalInfo() * @see ICompletionProposal#getAdditionalProposalInfo()
*/ */
public String getAdditionalProposalInfo() { public String getAdditionalProposalInfo() {
if (fProposalInfo != null) { // if (fProposalInfo != null) {
// return fProposalInfo.getInfo();
// }
return fProposalInfo; return fProposalInfo;
} }
return null;
}
/* /*
* @see ICompletionProposalExtension#getTriggerCharacters() * @see ICompletionProposalExtension#getTriggerCharacters()
@ -374,7 +374,7 @@ public class CCompletionProposal implements ICCompletionProposal, ICompletionPro
/* /*
* @see org.eclipse.jface.text.contentassist.ICompletionProposalExtension3#getCompletionOffset() * @see org.eclipse.jface.text.contentassist.ICompletionProposalExtension3#getCompletionOffset()
*/ */
public int getPrefixCompletionStart(IDocument document, int completionOffset) { public int getCompletionOffset() {
return getReplacementOffset(); return getReplacementOffset();
} }
@ -415,7 +415,7 @@ public class CCompletionProposal implements ICCompletionProposal, ICompletionPro
/* /*
* @see org.eclipse.jface.text.contentassist.ICompletionProposalExtension3#getReplacementText() * @see org.eclipse.jface.text.contentassist.ICompletionProposalExtension3#getReplacementText()
*/ */
public CharSequence getPrefixCompletionText(IDocument document, int completionOffset) { public CharSequence getCompletionText() {
String string= getReplacementString(); String string= getReplacementString();
int pos= string.indexOf('('); int pos= string.indexOf('(');
if (pos > 0) if (pos > 0)