This repository has been archived by the owner on Apr 3, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 287
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Initial port of JDT's ContentAssistProcessor and related classes.
- Loading branch information
1 parent
6273e25
commit 675b705
Showing
14 changed files
with
1,699 additions
and
0 deletions.
There are no files selected for viewing
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
40 changes: 40 additions & 0 deletions
40
plugin_ide.ui/src-lang/org/eclipse/jdt/internal/corext/util/Messages.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,40 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2005, 2008 IBM Corporation 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: | ||
* IBM Corporation - initial API and implementation | ||
*******************************************************************************/ | ||
package org.eclipse.jdt.internal.corext.util; | ||
|
||
import java.text.MessageFormat; | ||
|
||
|
||
/** | ||
* Helper class to format message strings. | ||
* | ||
* @since 3.1 | ||
* BM: we modified this to use Java's MessageFormat | ||
*/ | ||
public class Messages { | ||
|
||
public static String format(String message, Object object) { | ||
return MessageFormat.format(message, new Object[] { object}); | ||
} | ||
|
||
public static String format(String message, Object[] objects) { | ||
return MessageFormat.format(message, objects); | ||
} | ||
|
||
public static String format_2(String message, Object... objects) { | ||
return MessageFormat.format(message, objects); | ||
} | ||
|
||
|
||
private Messages() { | ||
// Not for instantiation | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
plugin_ide.ui/src-lang/org/eclipse/jdt/internal/ui/JavaPlugin.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,12 @@ | ||
package org.eclipse.jdt.internal.ui; | ||
|
||
import melnorme.lang.ide.ui.LangUIPlugin; | ||
|
||
|
||
public abstract class JavaPlugin extends LangUIPlugin { | ||
|
||
public static LangUIPlugin getDefault() { | ||
return LangUIPlugin.getInstance(); | ||
} | ||
|
||
} |
20 changes: 20 additions & 0 deletions
20
plugin_ide.ui/src-lang/org/eclipse/jdt/internal/ui/JavaUIMessages.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,20 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2015, 2015 Bruno Medeiros and other Contributors. | ||
* 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: | ||
* Bruno Medeiros - initial API and implementation | ||
*******************************************************************************/ | ||
package org.eclipse.jdt.internal.ui; | ||
|
||
public interface JavaUIMessages { | ||
|
||
String OptionalMessageDialog_dontShowAgain = | ||
"Do not show this &message again"; | ||
String JavaEditor_codeassist_noCompletions = | ||
"No completions available."; | ||
|
||
} |
35 changes: 35 additions & 0 deletions
35
plugin_ide.ui/src-lang/org/eclipse/jdt/internal/ui/text/java/AlphabeticSorter.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,35 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2006, 2011 IBM Corporation 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: | ||
* IBM Corporation - initial API and implementation | ||
*******************************************************************************/ | ||
package org.eclipse.jdt.internal.ui.text.java; | ||
|
||
import org.eclipse.jface.text.contentassist.ICompletionProposal; | ||
|
||
import org.eclipse.jdt.ui.text.java.AbstractProposalSorter; | ||
import org.eclipse.jdt.ui.text.java.CompletionProposalComparator; | ||
|
||
/** | ||
* A alphabetic proposal based sorter. | ||
* | ||
* @since 3.2 | ||
*/ | ||
public final class AlphabeticSorter extends AbstractProposalSorter { | ||
|
||
protected final CompletionProposalComparator fComparator= new CompletionProposalComparator(true); | ||
|
||
public AlphabeticSorter() { | ||
} | ||
|
||
@Override | ||
public int compare(ICompletionProposal p1, ICompletionProposal p2) { | ||
return fComparator.compare(p1, p2); | ||
} | ||
|
||
} |
Oops, something went wrong.