mirror of
https://github.com/processing/processing4.git
synced 2026-02-14 10:55:38 +01:00
Merge branch 'master' of https://github.com/processing/processing.git
This commit is contained in:
@@ -44,7 +44,6 @@ public class ContributionManagerDialog {
|
||||
static final String ANY_CATEGORY = Language.text("contrib.all");
|
||||
|
||||
JFrame dialog;
|
||||
String title;
|
||||
ContributionFilter filter;
|
||||
JComboBox categoryChooser;
|
||||
JScrollPane scrollPane;
|
||||
@@ -98,9 +97,9 @@ public class ContributionManagerDialog {
|
||||
Editor ed = iter.next();
|
||||
if (ed.getSketch().isModified()) {
|
||||
int option = Base
|
||||
.showYesNoQuestion(editor, title,
|
||||
Language.text("contrib.unsaved_changes"),
|
||||
Language.text("contrib.unsaved_changes.prompt"));
|
||||
.showYesNoQuestion(editor, Language.text("contributions"),
|
||||
Language.text("contributions.unsaved_changes"),
|
||||
Language.text("contributions.unsaved_changes.prompt"));
|
||||
|
||||
if (option == JOptionPane.NO_OPTION)
|
||||
return;
|
||||
|
||||
@@ -14,6 +14,7 @@ menu.file = Bestand
|
||||
menu.file.new = Nieuw
|
||||
menu.file.open = Openen...
|
||||
menu.file.sketchbook = Schetsboek
|
||||
menu.file.sketchbook.empty = Leeg Schetsboek
|
||||
menu.file.recent = Recent
|
||||
menu.file.examples = Voorbeelden...
|
||||
menu.file.close = Sluiten
|
||||
@@ -117,11 +118,20 @@ preferences = Instellingen
|
||||
preferences.button.width = 90
|
||||
preferences.requires_restart = herstart van Processing vereist
|
||||
preferences.sketchbook_location = Schetsboek locatie
|
||||
preferences.sketchbook_location.popup = Schetsboek locatie
|
||||
preferences.language = Taal
|
||||
preferences.editor_and_console_font = Editor en Console lettertype
|
||||
preferences.editor_and_console_font.tip = \
|
||||
Selecteer het gebruikte lettertype in de Editor en de Console.<br>\
|
||||
Alleen monospace lettertypes (dezelfde breedte voor elk karakter)<br>\
|
||||
mogen gebruikt worden, ook al is de lijst wellicht niet geheel correct.
|
||||
preferences.editor_font_size = Editor lettergrootte
|
||||
preferences.console_font_size = Console lettergrootte
|
||||
preferences.background_color = Achtergrond kleur in Presenteer modus
|
||||
preferences.background_color.tip = \
|
||||
Selecteer de achtergrond kleur in Presenteer modus.<br>\
|
||||
De Presenteer modus (te vinden in het Schets menu) wordt gebruikt<br>\
|
||||
om een schets op het volledige scherm te tonen.
|
||||
preferences.use_smooth_text = Gebruik duidelijke tekst in Editor venster
|
||||
preferences.enable_complex_text_input = Complexe tekstkarakters mogelijk maken
|
||||
preferences.enable_complex_text_input_example = i.e. Japans
|
||||
@@ -149,6 +159,13 @@ preferences.file.hint = alleen aanpassen wanneer Processing niet actief is
|
||||
# Sketchbook Location (Frame)
|
||||
sketchbook_location = Selecteer nieuwe schetsboek locatie
|
||||
|
||||
# Sketchbook (Frame)
|
||||
sketchbook = Schetsboek
|
||||
sketchbook.tree = Schetsboek
|
||||
|
||||
# examples (Frame)
|
||||
examples = Examples
|
||||
|
||||
# Export (Frame)
|
||||
export = Exporteer Opties
|
||||
export.platforms = Platforms
|
||||
@@ -213,9 +230,80 @@ editor.header.next_tab = Volgende Tabblad
|
||||
editor.header.delete.warning.title = Waarschuwing
|
||||
editor.header.delete.warning.text = U kunt het laatste tabblad van de laatst geopende schets niet verwijderen.
|
||||
|
||||
# Tabs
|
||||
editor.tab.new = Nieuwe Naam
|
||||
editor.tab.new.description = Naam voor nieuw bestand
|
||||
editor.tab.rename = Nieuwe Naam
|
||||
editor.tab.rename.description = Nieuwe naam voor bestand
|
||||
|
||||
# Sketch
|
||||
editor.sketch.rename.description = Nieuwe naam voor schets
|
||||
|
||||
editor.status.autoformat.no_changes = Geen wijzigingen nodig voor Automatische Opmaak.
|
||||
editor.status.autoformat.finished = Automatische Opmaak gereed.
|
||||
editor.status.find_reference.select_word_first = Selecteer eerst een woord om te zoeken in de handleiding.
|
||||
editor.status.find_reference.not_available = Geen handleiding beschikbaar voor "%s".
|
||||
editor.status.drag_and_drop.files_added.0 = Er zijn geen bestanden toegevoegd aan de schets.
|
||||
editor.status.drag_and_drop.files_added.1 = Een bestand toegevoegd aan de schets.
|
||||
editor.status.drag_and_drop.files_added.n = %d bestanden toegevoegd aan de schets.
|
||||
editor.status.saving = Bezig met opslaan...
|
||||
editor.status.saving.done = Opslaan gereed.
|
||||
editor.status.saving.canceled = Opslaan geannuleerd.
|
||||
editor.status.printing = Bezig met afdrukken...
|
||||
editor.status.printing.done = Afdrukken gereed.
|
||||
editor.status.printing.error = Fout tijdens het afdrukken.
|
||||
editor.status.printing.canceled = Afdrukken geannuleerd.
|
||||
|
||||
|
||||
# ---------------------------------------
|
||||
# Contribution Panel
|
||||
|
||||
contrib = Bijdragen Manager
|
||||
contrib.category = Categorie:
|
||||
contrib.filter_your_search = Filter zoekresultaten...
|
||||
contrib.restart = Processing herstarten
|
||||
contrib.unsaved_changes = Niet opgeslagen wijzigingen gevonden
|
||||
contrib.unsaved_changes.prompt = Weet u zeker dat u Processing wil herstarten zonder eerst op te slaan?
|
||||
contrib.messages.remove_restart = Herstart Processing om het verwijderen van dit item te voltooien.
|
||||
contrib.messages.install_restart = Herstart Processing om het installeren van dit item te voltooien.
|
||||
contrib.messages.update_restart = Herstart Processing om het updaten van dit item te voltooien.
|
||||
contrib.errors.list_download = De lijst met beschikbare bijdragen kon niet worden gedownload.
|
||||
contrib.errors.list_download.timeout = Verbinding time out bij het downloaden van de lijst met bijdragen.
|
||||
contrib.errors.download_and_install = Fout bij het downloaden en installeren.
|
||||
contrib.errors.description_unavailable = Beschrijving niet beschikbaar.
|
||||
contrib.errors.malformed_url = "De van Processing.org verkregen link is niet correct.\nU kunt nog steeds de bibliotheek handmatig installeren door\nde website van de bibliotheek te bezoeken
|
||||
contrib.errors.needs_repackage = %s moet opnieuw worden ingepakt volgens de %s richtlijnen.
|
||||
contrib.errors.no_contribution_found = Kan geen %s vinden in het gedownloade bestand.
|
||||
contrib.errors.overwriting_properties = Fout bij het overschrijven van het .properties bestand.
|
||||
contrib.errors.install_failed = Installatie mislukt.
|
||||
contrib.errors.update_on_restart_failed = Update bij herstart van %s mislukt.
|
||||
contrib.errors.temporary_directory = Kan niet schrijven naar een tijdelijke map.
|
||||
contrib.all = Alles
|
||||
contrib.undo = Ongedaan maken
|
||||
contrib.remove = Verwijderen
|
||||
contrib.install = Installeren
|
||||
contrib.progress.installing = Bezig met installeren
|
||||
contrib.progress.starting = Bezig met starten
|
||||
contrib.progress.downloading = Bezig met downloaden
|
||||
contrib.download_error = Fout bij het downloaden van de bijdrage.
|
||||
contrib.unsupported_operating_system = Uw besturingssyteem wordt schijnbaar niet ondersteund. U kunt de website van de %s bibliotheek bezoeken voor meer informatie.
|
||||
|
||||
|
||||
# ---------------------------------------
|
||||
# Warnings
|
||||
|
||||
warn.delete = Verwijderen
|
||||
warn.delete.sketch = Weet u zeker dat u deze schets wil verwijderen?
|
||||
warn.delete.file = Weet u zeker dat u "%s" wil verwijderen?
|
||||
|
||||
|
||||
# ---------------------------------------
|
||||
# Update Check
|
||||
update_check = Update
|
||||
update_check.updates_available.core = Een nieuwe versie van Processing is beschikbaar,\nwilt u de Processing download pagina bezoeken?
|
||||
update_check.updates_available.contributions = Er zijn updates beschikbaar voor sommige van de door u geïnstalleerde bijdragen,\nwilt u nu de Bijdragen Manager openen?
|
||||
|
||||
|
||||
# ---------------------------------------
|
||||
# Color Chooser
|
||||
color_chooser = Kies een kleur...
|
||||
|
||||
@@ -629,7 +629,7 @@ public class ASTGenerator {
|
||||
/*The type wasn't found in local code, so it might be something like
|
||||
* System.console()., or maybe belonging to super class, etc.
|
||||
*/
|
||||
Class tehClass = findClassIfExists(((SimpleName)mi.getExpression()).toString());
|
||||
Class<?> tehClass = findClassIfExists(((SimpleName)mi.getExpression()).toString());
|
||||
if (tehClass != null) {
|
||||
// Method Expression is a simple name and wasn't located locally, but found in a class
|
||||
// so look for method in this class.
|
||||
@@ -643,7 +643,7 @@ public class ASTGenerator {
|
||||
ASTNode typeDec = findDeclaration2(stp.getName(),nearestNode);
|
||||
if(typeDec == null){
|
||||
log(stp.getName() + " couldn't be found locally..");
|
||||
Class tehClass = findClassIfExists(stp.getName().toString());
|
||||
Class<?> tehClass = findClassIfExists(stp.getName().toString());
|
||||
if (tehClass != null) {
|
||||
// Method Expression is a simple name and wasn't located locally, but found in a class
|
||||
// so look for method in this class.
|
||||
@@ -684,7 +684,7 @@ public class ASTGenerator {
|
||||
/*The type wasn't found in local code, so it might be something like
|
||||
* log(), or maybe belonging to super class, etc.
|
||||
*/
|
||||
Class tehClass = findClassIfExists(qn.getQualifier().toString());
|
||||
Class<?> tehClass = findClassIfExists(qn.getQualifier().toString());
|
||||
if (tehClass != null) {
|
||||
// note how similar thing is called on line 690. Check check.
|
||||
return definedIn3rdPartyClass(new ClassMember(tehClass), qn
|
||||
@@ -699,7 +699,7 @@ public class ASTGenerator {
|
||||
if(typeDec == null){
|
||||
log(stp.getName() + " couldn't be found locally..");
|
||||
|
||||
Class tehClass = findClassIfExists(stp.getName().toString());
|
||||
Class<?> tehClass = findClassIfExists(stp.getName().toString());
|
||||
if (tehClass != null) {
|
||||
// note how similar thing is called on line 690. Check check.
|
||||
return definedIn3rdPartyClass(new ClassMember(tehClass), qn
|
||||
@@ -1045,13 +1045,14 @@ public class ASTGenerator {
|
||||
if (sketchOutline.isVisible()) return;
|
||||
Collections.sort(candidates);
|
||||
// CompletionCandidate[][] candi = new CompletionCandidate[candidates.size()][1];
|
||||
DefaultListModel<CompletionCandidate> defListModel = new DefaultListModel<CompletionCandidate>();
|
||||
|
||||
for (int i = 0; i < candidates.size(); i++) {
|
||||
// candi[i][0] = candidates.get(i);
|
||||
defListModel.addElement(candidates.get(i));
|
||||
}
|
||||
log("Total preds = " + candidates.size());
|
||||
// DefaultListModel<CompletionCandidate> defListModel = new DefaultListModel<CompletionCandidate>();
|
||||
//
|
||||
// for (int i = 0; i < candidates.size(); i++) {
|
||||
//// candi[i][0] = candidates.get(i);
|
||||
// defListModel.addElement(candidates.get(i));
|
||||
// }
|
||||
// log("Total preds = " + candidates.size());
|
||||
DefaultListModel<CompletionCandidate> defListModel = filterPredictions();
|
||||
// DefaultTableModel tm = new DefaultTableModel(candi,
|
||||
// new String[] { "Suggestions" });
|
||||
// if (tableAuto.isVisible()) {
|
||||
@@ -1063,6 +1064,44 @@ public class ASTGenerator {
|
||||
.showSuggestion(defListModel, word);
|
||||
}
|
||||
|
||||
private DefaultListModel<CompletionCandidate> filterPredictions(){
|
||||
DefaultListModel<CompletionCandidate> defListModel = new DefaultListModel<CompletionCandidate>();
|
||||
if (candidates.isEmpty())
|
||||
return defListModel;
|
||||
// check if first & last CompCandidate are the same methods, only then show all overloaded methods
|
||||
if (candidates.get(0).getElementName()
|
||||
.equals(candidates.get(candidates.size() - 1).getElementName())) {
|
||||
log("All CC are methods only: " + candidates.get(0).getElementName());
|
||||
for (int i = 0; i < candidates.size(); i++) {
|
||||
candidates.get(i).regenerateCompletionString();
|
||||
defListModel.addElement(candidates.get(i));
|
||||
}
|
||||
}
|
||||
else {
|
||||
boolean ignoredSome = false;
|
||||
for (int i = 0; i < candidates.size(); i++) {
|
||||
if(i > 0 && (candidates.get(i).getElementName()
|
||||
.equals(candidates.get(i - 1).getElementName()))){
|
||||
if (candidates.get(i).getType() == CompletionCandidate.LOCAL_METHOD
|
||||
|| candidates.get(i).getType() == CompletionCandidate.PREDEF_METHOD) {
|
||||
CompletionCandidate cc = candidates.get(i - 1);
|
||||
String label = cc.getLabel();
|
||||
int x = label.lastIndexOf(')');
|
||||
cc.setLabel(cc.getElementName() + "(...)" + label.substring(x + 1));
|
||||
cc.setCompletionString(cc.getElementName());
|
||||
ignoredSome = true;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
defListModel.addElement(candidates.get(i));
|
||||
}
|
||||
if (ignoredSome) {
|
||||
log("Some suggestions hidden");
|
||||
}
|
||||
}
|
||||
return defListModel;
|
||||
}
|
||||
|
||||
/**
|
||||
* Loads classes from .jar files in sketch classpath
|
||||
*
|
||||
@@ -1256,11 +1295,11 @@ public class ASTGenerator {
|
||||
* @param className
|
||||
* @return
|
||||
*/
|
||||
protected Class findClassIfExists(String className){
|
||||
protected Class<?> findClassIfExists(String className){
|
||||
if(className == null){
|
||||
return null;
|
||||
}
|
||||
Class tehClass = null;
|
||||
Class<?> tehClass = null;
|
||||
// First, see if the classname is a fully qualified name and loads straightaway
|
||||
tehClass = loadClass(className);
|
||||
|
||||
@@ -1328,8 +1367,8 @@ public class ASTGenerator {
|
||||
return tehClass;
|
||||
}
|
||||
|
||||
protected Class loadClass(String className){
|
||||
Class tehClass = null;
|
||||
protected Class<?> loadClass(String className){
|
||||
Class<?> tehClass = null;
|
||||
if (className != null) {
|
||||
try {
|
||||
tehClass = Class.forName(className, false,
|
||||
@@ -1843,7 +1882,7 @@ public class ASTGenerator {
|
||||
@Override
|
||||
public void valueChanged(TreeSelectionEvent e) {
|
||||
log(e);
|
||||
SwingWorker worker = new SwingWorker() {
|
||||
SwingWorker<Object, Object> worker = new SwingWorker<Object, Object>() {
|
||||
|
||||
@Override
|
||||
protected Object doInBackground() throws Exception {
|
||||
@@ -1901,7 +1940,7 @@ public class ASTGenerator {
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
if(txtRenameField.getText().length() == 0)
|
||||
return;
|
||||
SwingWorker worker = new SwingWorker() {
|
||||
SwingWorker<Object, Object> worker = new SwingWorker<Object, Object>() {
|
||||
|
||||
@Override
|
||||
protected Object doInBackground() throws Exception {
|
||||
@@ -1920,7 +1959,7 @@ public class ASTGenerator {
|
||||
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
SwingWorker worker = new SwingWorker() {
|
||||
SwingWorker<Object, Object> worker = new SwingWorker<Object, Object>() {
|
||||
|
||||
@Override
|
||||
protected Object doInBackground() throws Exception {
|
||||
@@ -1940,7 +1979,7 @@ public class ASTGenerator {
|
||||
@Override
|
||||
public void valueChanged(TreeSelectionEvent e) {
|
||||
log(e);
|
||||
SwingWorker worker = new SwingWorker() {
|
||||
SwingWorker<Object, Object> worker = new SwingWorker<Object, Object>() {
|
||||
|
||||
@Override
|
||||
protected Object doInBackground() throws Exception {
|
||||
@@ -2235,13 +2274,13 @@ public class ASTGenerator {
|
||||
}
|
||||
|
||||
public void dfsNameOnly(DefaultMutableTreeNode tnode,ASTNode decl, String name) {
|
||||
Stack temp = new Stack<DefaultMutableTreeNode>();
|
||||
Stack<DefaultMutableTreeNode> temp = new Stack<DefaultMutableTreeNode>();
|
||||
temp.push(codeTree);
|
||||
|
||||
while(!temp.isEmpty()){
|
||||
DefaultMutableTreeNode cnode = (DefaultMutableTreeNode) temp.pop();
|
||||
for (int i = 0; i < cnode.getChildCount(); i++) {
|
||||
temp.push(cnode.getChildAt(i));
|
||||
temp.push((DefaultMutableTreeNode) cnode.getChildAt(i));
|
||||
}
|
||||
|
||||
if(!(cnode.getUserObject() instanceof ASTNodeWrapper))
|
||||
@@ -2334,13 +2373,13 @@ public class ASTGenerator {
|
||||
// Find the first node with this line number, return its offset - jOffset
|
||||
line = pdeLineNumToJavaLineNum(line);
|
||||
log("Looking for line: " + line + ", jOff " + jOffset);
|
||||
Stack temp = new Stack<DefaultMutableTreeNode>();
|
||||
Stack<DefaultMutableTreeNode> temp = new Stack<DefaultMutableTreeNode>();
|
||||
temp.push(codeTree);
|
||||
|
||||
while (!temp.isEmpty()) {
|
||||
DefaultMutableTreeNode cnode = (DefaultMutableTreeNode) temp.pop();
|
||||
for (int i = 0; i < cnode.getChildCount(); i++) {
|
||||
temp.push(cnode.getChildAt(i));
|
||||
temp.push((DefaultMutableTreeNode) cnode.getChildAt(i));
|
||||
}
|
||||
|
||||
if (!(cnode.getUserObject() instanceof ASTNodeWrapper))
|
||||
@@ -3022,9 +3061,9 @@ public class ASTGenerator {
|
||||
|
||||
private Method method;
|
||||
|
||||
private Constructor cons;
|
||||
private Constructor<?> cons;
|
||||
|
||||
private Class thisclass;
|
||||
private Class<?> thisclass;
|
||||
|
||||
private String stringVal;
|
||||
|
||||
@@ -3034,7 +3073,7 @@ public class ASTGenerator {
|
||||
|
||||
private ASTNode declaringNode;
|
||||
|
||||
public ClassMember(Class m) {
|
||||
public ClassMember(Class<?> m) {
|
||||
thisclass = m;
|
||||
stringVal = "Predefined Class " + m.getName();
|
||||
classType = m.getName();
|
||||
@@ -3054,7 +3093,7 @@ public class ASTGenerator {
|
||||
classType = m.getType().getName();
|
||||
}
|
||||
|
||||
public ClassMember(Constructor m) {
|
||||
public ClassMember(Constructor<?> m) {
|
||||
cons = m;
|
||||
stringVal = "Cons " + " " + m.getName() + " defined in "
|
||||
+ m.getDeclaringClass().getName();
|
||||
@@ -3087,7 +3126,7 @@ public class ASTGenerator {
|
||||
}
|
||||
}
|
||||
|
||||
public Class getClass_() {
|
||||
public Class<?> getClass_() {
|
||||
return thisclass;
|
||||
}
|
||||
|
||||
@@ -3103,7 +3142,7 @@ public class ASTGenerator {
|
||||
return method;
|
||||
}
|
||||
|
||||
public Constructor getCons() {
|
||||
public Constructor<?> getCons() {
|
||||
return cons;
|
||||
}
|
||||
|
||||
@@ -3321,7 +3360,7 @@ public class ASTGenerator {
|
||||
.substring(0, candidates.get(i).length() - 6);
|
||||
}
|
||||
if (resources.length >= 1) {
|
||||
final JList classList = new JList(resources);
|
||||
final JList<String> classList = new JList<String>(resources);
|
||||
classList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
|
||||
frmImportSuggest = new JFrame();
|
||||
frmImportSuggest.setSize(350, 200);
|
||||
|
||||
@@ -63,7 +63,8 @@ public class CompletionCandidate implements Comparable<CompletionCandidate>{
|
||||
type = LOCAL_FIELD;
|
||||
else
|
||||
type = LOCAL_VAR;
|
||||
label = svd.getName() + " : " + svd.getType();
|
||||
label = svd.getName() + " : " + svd.getType();
|
||||
wrappedObject = svd;
|
||||
}
|
||||
|
||||
public CompletionCandidate(VariableDeclarationFragment vdf) {
|
||||
@@ -74,6 +75,7 @@ public class CompletionCandidate implements Comparable<CompletionCandidate>{
|
||||
else
|
||||
type = LOCAL_VAR;
|
||||
label = vdf.getName() + " : " + ASTGenerator.extracTypeInfo2(vdf);
|
||||
wrappedObject = vdf;
|
||||
}
|
||||
|
||||
public CompletionCandidate(MethodDeclaration method) {
|
||||
@@ -100,6 +102,7 @@ public class CompletionCandidate implements Comparable<CompletionCandidate>{
|
||||
cstr.append(")");
|
||||
this.label = label.toString();
|
||||
this.completionString = cstr.toString();
|
||||
wrappedObject = method;
|
||||
}
|
||||
|
||||
public CompletionCandidate(TypeDeclaration td){
|
||||
@@ -107,6 +110,7 @@ public class CompletionCandidate implements Comparable<CompletionCandidate>{
|
||||
elementName = td.getName().toString();
|
||||
label = elementName;
|
||||
completionString = elementName;
|
||||
wrappedObject = td;
|
||||
}
|
||||
|
||||
public CompletionCandidate(Field f) {
|
||||
@@ -148,6 +152,18 @@ public class CompletionCandidate implements Comparable<CompletionCandidate>{
|
||||
public int getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public String getLabel() {
|
||||
return label;
|
||||
}
|
||||
|
||||
public void setLabel(String label) {
|
||||
this.label = label;
|
||||
}
|
||||
|
||||
public void setCompletionString(String completionString) {
|
||||
this.completionString = completionString;
|
||||
}
|
||||
|
||||
public int compareTo(CompletionCandidate cc) {
|
||||
if(type != cc.getType()){
|
||||
@@ -155,5 +171,53 @@ public class CompletionCandidate implements Comparable<CompletionCandidate>{
|
||||
}
|
||||
return (elementName.compareTo(cc.getElementName()));
|
||||
}
|
||||
|
||||
public void regenerateCompletionString(){
|
||||
if(wrappedObject instanceof MethodDeclaration) {
|
||||
MethodDeclaration method = (MethodDeclaration)wrappedObject;
|
||||
List<ASTNode> params = (List<ASTNode>) method
|
||||
.getStructuralProperty(MethodDeclaration.PARAMETERS_PROPERTY);
|
||||
StringBuffer label = new StringBuffer(elementName + "(");
|
||||
StringBuffer cstr = new StringBuffer(method.getName() + "(");
|
||||
for (int i = 0; i < params.size(); i++) {
|
||||
label.append(params.get(i).toString());
|
||||
if (i < params.size() - 1) {
|
||||
label.append(",");
|
||||
cstr.append(",");
|
||||
}
|
||||
}
|
||||
if (params.size() == 1) {
|
||||
cstr.append(' ');
|
||||
}
|
||||
label.append(")");
|
||||
if (method.getReturnType2() != null)
|
||||
label.append(" : " + method.getReturnType2());
|
||||
cstr.append(")");
|
||||
this.label = label.toString();
|
||||
this.completionString = cstr.toString();
|
||||
}
|
||||
else if (wrappedObject instanceof Method) {
|
||||
Method method = (Method)wrappedObject;
|
||||
StringBuffer label = new StringBuffer(method.getName() + "(");
|
||||
StringBuffer cstr = new StringBuffer(method.getName() + "(");
|
||||
for (int i = 0; i < method.getParameterTypes().length; i++) {
|
||||
label.append(method.getParameterTypes()[i].getSimpleName());
|
||||
if (i < method.getParameterTypes().length - 1) {
|
||||
label.append(",");
|
||||
cstr.append(",");
|
||||
}
|
||||
}
|
||||
if(method.getParameterTypes().length == 1) {
|
||||
cstr.append(' ');
|
||||
}
|
||||
label.append(")");
|
||||
if(method.getReturnType() != null)
|
||||
label.append(" : " + method.getReturnType().getSimpleName());
|
||||
label.append(" - " + method.getDeclaringClass().getSimpleName());
|
||||
cstr.append(")");
|
||||
this.label = label.toString();
|
||||
this.completionString = cstr.toString();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -61,7 +61,7 @@ public class CompletionPanel {
|
||||
/**
|
||||
* The completion list generated by ASTGenerator
|
||||
*/
|
||||
private JList completionList;
|
||||
private JList<CompletionCandidate> completionList;
|
||||
|
||||
/**
|
||||
* The popup menu in which the suggestion list is shown
|
||||
@@ -97,7 +97,7 @@ public class CompletionPanel {
|
||||
* @param dedit
|
||||
*/
|
||||
public CompletionPanel(final JEditTextArea textarea, int position, String subWord,
|
||||
DefaultListModel items, final Point location, DebugEditor dedit) {
|
||||
DefaultListModel<CompletionCandidate> items, final Point location, DebugEditor dedit) {
|
||||
this.textarea = (TextArea) textarea;
|
||||
editor = dedit;
|
||||
this.insertionPosition = position;
|
||||
@@ -202,10 +202,10 @@ public class CompletionPanel {
|
||||
* @param items
|
||||
* @return
|
||||
*/
|
||||
private JList createSuggestionList(final int position,
|
||||
final DefaultListModel items) {
|
||||
private JList<CompletionCandidate> createSuggestionList(final int position,
|
||||
final DefaultListModel<CompletionCandidate> items) {
|
||||
|
||||
JList list = new JList(items);
|
||||
JList<CompletionCandidate> list = new JList<CompletionCandidate>(items);
|
||||
//list.setBorder(BorderFactory.createLineBorder(Color.DARK_GRAY, 1));
|
||||
list.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
|
||||
list.setSelectedIndex(0);
|
||||
@@ -224,7 +224,7 @@ public class CompletionPanel {
|
||||
}
|
||||
|
||||
// possibly defunct
|
||||
public boolean updateList(final DefaultListModel items, String newSubword,
|
||||
public boolean updateList(final DefaultListModel<CompletionCandidate> items, String newSubword,
|
||||
final Point location, int position) {
|
||||
this.subWord = new String(newSubword);
|
||||
if (subWord.indexOf('.') != -1)
|
||||
@@ -456,7 +456,7 @@ public class CompletionPanel {
|
||||
javax.swing.DefaultListCellRenderer {
|
||||
//protected final ImageIcon classIcon, fieldIcon, methodIcon;
|
||||
|
||||
public Component getListCellRendererComponent(JList list, Object value,
|
||||
public Component getListCellRendererComponent(JList<?> list, Object value,
|
||||
int index,
|
||||
boolean isSelected,
|
||||
boolean cellHasFocus) {
|
||||
|
||||
@@ -32,7 +32,7 @@ public class ErrorMessageSimplifier {
|
||||
|
||||
private static void prepareConstantsList() {
|
||||
constantsMap = new TreeMap<Integer, String>();
|
||||
Class probClass = DefaultProblem.class;
|
||||
Class<DefaultProblem> probClass = DefaultProblem.class;
|
||||
Field f[] = probClass.getFields();
|
||||
for (Field field : f) {
|
||||
if (Modifier.isStatic(field.getModifiers()))
|
||||
|
||||
@@ -193,7 +193,6 @@ public class TextArea extends JEditTextArea {
|
||||
log("BK Key");
|
||||
break;
|
||||
case KeyEvent.VK_SPACE:
|
||||
System.out.println("space: " + evt);
|
||||
if (suggestion != null)
|
||||
if (suggestion.isVisible()) {
|
||||
log("Space bar, hide completion list");
|
||||
@@ -231,11 +230,8 @@ public class TextArea extends JEditTextArea {
|
||||
if (ExperimentalMode.codeCompletionsEnabled
|
||||
&& ExperimentalMode.ccTriggerEnabled) {
|
||||
getDocument().remove(getCaretPosition() - 1, 1); // Remove the typed space
|
||||
log("[KeyEvent]" + evt2.getKeyChar()
|
||||
+ " |Prediction started: " + System.currentTimeMillis());
|
||||
log("Typing: " + fetchPhrase(evt2) + " "
|
||||
+ (evt2.getKeyChar() == KeyEvent.VK_ENTER) + " T: "
|
||||
+ System.currentTimeMillis());
|
||||
log("[KeyEvent]" + evt2.getKeyChar() + " |Prediction started");
|
||||
log("Typing: " + fetchPhrase(evt2));
|
||||
}
|
||||
return null;
|
||||
}
|
||||
@@ -253,11 +249,8 @@ public class TextArea extends JEditTextArea {
|
||||
// Provide completions only if it's enabled
|
||||
if (ExperimentalMode.codeCompletionsEnabled
|
||||
&& (!ExperimentalMode.ccTriggerEnabled || suggestion.isVisible())) {
|
||||
log("[KeyEvent]" + evt2.getKeyChar() + " |Prediction started: "
|
||||
+ System.currentTimeMillis());
|
||||
log("Typing: " + fetchPhrase(evt2) + " "
|
||||
+ (evt2.getKeyChar() == KeyEvent.VK_ENTER) + " T: "
|
||||
+ System.currentTimeMillis());
|
||||
log("[KeyEvent]" + evt2.getKeyChar() + " |Prediction started");
|
||||
log("Typing: " + fetchPhrase(evt2));
|
||||
}
|
||||
return null;
|
||||
}
|
||||
@@ -361,7 +354,15 @@ public class TextArea extends JEditTextArea {
|
||||
int x = getCaretPosition() - getLineStartOffset(line) - 1, x1 = x - 1;
|
||||
if(x >= s.length() || x < 0)
|
||||
return null; //TODO: Does this check cause problems? Verify.
|
||||
|
||||
log2(" x char: " + s.charAt(x));
|
||||
|
||||
if (!(Character.isLetterOrDigit(s.charAt(x)) || s.charAt(x) == '_'
|
||||
|| s.charAt(x) == '(' || s.charAt(x) == '.')) {
|
||||
log("Char before caret isn't a letter/digit/_(. so no predictions");
|
||||
return null;
|
||||
}
|
||||
|
||||
//int xLS = off - getLineStartNonWhiteSpaceOffset(line);
|
||||
|
||||
String word = (x < s.length() ? s.charAt(x) : "") + "";
|
||||
@@ -773,7 +774,7 @@ public class TextArea extends JEditTextArea {
|
||||
* @param defListModel
|
||||
* @param subWord
|
||||
*/
|
||||
protected void showSuggestion(DefaultListModel defListModel,String subWord) {
|
||||
protected void showSuggestion(DefaultListModel<CompletionCandidate> defListModel,String subWord) {
|
||||
hideSuggestion();
|
||||
if (defListModel.size() == 0) {
|
||||
log("TextArea: No suggestions to show.");
|
||||
|
||||
14
todo.txt
14
todo.txt
@@ -5,6 +5,8 @@ X split Preferences and PreferencesFrame
|
||||
X https://github.com/processing/processing/issues/68
|
||||
X http://code.google.com/p/processing/issues/detail?id=29
|
||||
X https://github.com/processing/processing/pull/2716
|
||||
X shouldn't write sketch.properties unless it's a non-default mode
|
||||
X https://github.com/processing/processing/issues/2531
|
||||
|
||||
_ Fix OS X menu to be the same order as the other File menu
|
||||
_ remove toolbar menu references and code to rebuild
|
||||
@@ -18,6 +20,10 @@ X temp folders not always deleting
|
||||
X https://github.com/processing/processing/issues/2606
|
||||
X problem when removing a mode
|
||||
X https://github.com/processing/processing/issues/2507
|
||||
X autocompletion dialog box sticking
|
||||
X https://github.com/processing/processing/issues/2741
|
||||
X Line warning indicators next to scrollbar break after moving around text
|
||||
X https://github.com/processing/processing/issues/2655
|
||||
_ remove dependency on oscp5 library for tweak mode
|
||||
_ https://github.com/processing/processing/issues/2730
|
||||
|
||||
@@ -46,6 +52,11 @@ X Add thread names for easier debugging and profiling
|
||||
X https://github.com/processing/processing/pull/2729
|
||||
X Add missing translations for OS X menu
|
||||
X https://github.com/processing/processing/pull/2726
|
||||
X fix firstLine when modifying lines above it
|
||||
X https://github.com/processing/processing/issues/2654
|
||||
X https://github.com/processing/processing/pull/2674
|
||||
X Style completion panel when using Nimbus LAF
|
||||
X https://github.com/processing/processing/pull/2718
|
||||
|
||||
languages
|
||||
X Japanese https://github.com/processing/processing/pull/2688
|
||||
@@ -55,6 +66,7 @@ X French https://github.com/processing/processing/pull/2695
|
||||
X Portugese https://github.com/processing/processing/pull/2701
|
||||
X Korean https://github.com/processing/processing/commit/7b60e2ded9ca81f6a5a08a818aaf84ee4bb029e3
|
||||
X Turkish https://github.com/processing/processing/pull/2740
|
||||
X Chinese https://github.com/processing/processing/pull/2748
|
||||
|
||||
earlier
|
||||
X repo cleanup
|
||||
@@ -93,8 +105,6 @@ _ IllegalArgumentException when clicking between editor windows
|
||||
_ https://github.com/processing/processing/issues/2530
|
||||
_ "String index out of range" error
|
||||
_ https://github.com/processing/processing/issues/1940
|
||||
_ shouldn't write sketch.properties unless it's a non-default mode
|
||||
_ https://github.com/processing/processing/issues/2531
|
||||
_ closing the color selector makes things freeze (only Linux and Windows?)
|
||||
_ https://github.com/processing/processing/issues/2381
|
||||
_ move sketchbook into its own window
|
||||
|
||||
Reference in New Issue
Block a user