Skip to content

Commit

Permalink
Merge pull request #50 from grizeldi/master
Browse files Browse the repository at this point in the history
Moved strings from codechecks to bundle.properties
  • Loading branch information
MeFisto94 committed Apr 8, 2016
2 parents be46130 + 2b2b7d1 commit 16922cd
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 16 deletions.
16 changes: 16 additions & 0 deletions jme3-code-check/src/com/jme3/gde/codecheck/hints/Bundle.properties
@@ -0,0 +1,16 @@
UpdateHint.display-name=Updating is not needed in jME3, check your update order if you need to call this.
UpdateHint.id=Update States / Bound
UpdateHint.description=Checks for calls to updateGeometricState(), updateLogicalState() and updateModelBound().
UpdateHint.fix-text=Remove this call
TempVarsHint.display-name=TempVars might not be released
TempVarsHint.id=TempVars release check
TempVarsHint.description=Checks for calls TempVars.get() and search for correspondinng release() call
TempVarsHint.fix-text=Add a release() call at the end of the method
ReadOnlyPrimitiveHint.display-name=This primitive is read only and should not be modified!
ReadOnlyPrimitiveHint.id=ReadOnly Primitives
ReadOnlyPrimitiveHint.description=Checks for modifications to readonly primitives. (getLocalTranslation().set())
ReadOnlyPrimitiveHint.fix-text=Remove this call
InternalMethodHint.display-name=You should not call this method, its for internal use only!
InternalMethodHint.id=Internal Methods
InternalMethodHint.description=Checks for calls to internal methods.
InternalMethodHint.fix-text=Remove this call
Expand Up @@ -22,6 +22,7 @@
import org.netbeans.spi.editor.hints.ErrorDescriptionFactory;
import org.netbeans.spi.editor.hints.Fix;
import org.openide.awt.StatusDisplayer;
import org.openide.util.NbBundle;

public class InternalMethodHint extends AbstractHint {

Expand Down Expand Up @@ -84,19 +85,19 @@ public void cancel() {
//Message that the user sees in the left sidebar:
@Override
public String getDisplayName() {
return "You should not call this method, its for internal use only!";
return NbBundle.getMessage(InternalMethodHint.class, "InternalMethodHint.display-name");
}

//Name of the hint in the Options window:
@Override
public String getId() {
return "Internal Methods";
return NbBundle.getMessage(InternalMethodHint.class, "InternalMethodHint.id");
}

//Description of the hint in the Options window:
@Override
public String getDescription() {
return "Checks for calls to internal methods.";
return NbBundle.getMessage(InternalMethodHint.class, "InternalMethodHint.description");
}

class MessagesFix implements EnhancedFix {
Expand All @@ -118,7 +119,7 @@ public CharSequence getSortText() {

@Override
public String getText() {
return "Remove this call";
return NbBundle.getMessage(InternalMethodHint.class, "InternalMethodHint.fix-text");
}

@Override
Expand Down
Expand Up @@ -21,6 +21,7 @@
import org.netbeans.spi.editor.hints.ErrorDescriptionFactory;
import org.netbeans.spi.editor.hints.Fix;
import org.openide.awt.StatusDisplayer;
import org.openide.util.NbBundle;

public class ReadOnlyPrimitiveHint extends AbstractHint {

Expand Down Expand Up @@ -94,19 +95,19 @@ public void cancel() {
//Message that the user sees in the left sidebar:
@Override
public String getDisplayName() {
return "This primitive is read only and should not be modified!";
return NbBundle.getMessage(ReadOnlyPrimitiveHint.class, "ReadOnlyPrimitiveHint.display-name");
}

//Name of the hint in the Options window:
@Override
public String getId() {
return "ReadOnly Primitives";
return NbBundle.getMessage(ReadOnlyPrimitiveHint.class, "ReadOnlyPrimitiveHint.id");
}

//Description of the hint in the Options window:
@Override
public String getDescription() {
return "Checks for modifications to readonly primitives. (getLocalTranslation().set())";
return NbBundle.getMessage(ReadOnlyPrimitiveHint.class, "ReadOnlyPrimitiveHint.description");
}

class MessagesFix implements EnhancedFix {
Expand All @@ -128,7 +129,7 @@ public CharSequence getSortText() {

@Override
public String getText() {
return "Remove this call";
return NbBundle.getMessage(ReadOnlyPrimitiveHint.class, "ReadOnlyPrimitiveHint.fix-text");
}

@Override
Expand Down
Expand Up @@ -24,6 +24,7 @@
import org.netbeans.spi.editor.hints.ErrorDescriptionFactory;
import org.netbeans.spi.editor.hints.Fix;
import org.openide.awt.StatusDisplayer;
import org.openide.util.NbBundle;

public class TempVarsHint extends AbstractHint {

Expand Down Expand Up @@ -135,19 +136,19 @@ public void cancel() {
//Message that the user sees in the left sidebar:
@Override
public String getDisplayName() {
return "TempVars might not be released";
return NbBundle.getMessage(TempVarsHint.class, "TempVarsHint.display-name");
}

//Name of the hint in the Options window:
@Override
public String getId() {
return "TempVars release check";
return NbBundle.getMessage(TempVarsHint.class, "TempVarsHint.id");
}

//Description of the hint in the Options window:
@Override
public String getDescription() {
return "Checks for calls TempVars.get() and search for correspondinng release() call";
return NbBundle.getMessage(TempVarsHint.class, "TempVarsHint.description");
}

class MessagesFix implements EnhancedFix {
Expand All @@ -169,7 +170,7 @@ public CharSequence getSortText() {

@Override
public String getText() {
return "Add a release() call at the end of the method";
return NbBundle.getMessage(TempVarsHint.class, "TempVarsHint.fix-text");
}

@Override
Expand Down
Expand Up @@ -21,6 +21,7 @@
import org.netbeans.spi.editor.hints.ErrorDescriptionFactory;
import org.netbeans.spi.editor.hints.Fix;
import org.openide.awt.StatusDisplayer;
import org.openide.util.NbBundle;

public class UpdateHint extends AbstractHint {

Expand Down Expand Up @@ -86,19 +87,19 @@ public void cancel() {
//Message that the user sees in the left sidebar:
@Override
public String getDisplayName() {
return "Updating is not needed in jME3, check your update order if you need to call this.";
return NbBundle.getMessage(UpdateHint.class, "UpdateHint.display-name");
}

//Name of the hint in the Options window:
@Override
public String getId() {
return "Update States / Bound";
return NbBundle.getMessage(UpdateHint.class, "UpdateHint.id");
}

//Description of the hint in the Options window:
@Override
public String getDescription() {
return "Checks for calls to updateGeometricState(), updateLogicalState() and updateModelBound().";
return NbBundle.getMessage(UpdateHint.class, "UpdateHint.description");
}

class MessagesFix implements EnhancedFix {
Expand All @@ -120,7 +121,7 @@ public CharSequence getSortText() {

@Override
public String getText() {
return "Remove this call";
return NbBundle.getMessage(UpdateHint.class, "UpdateHint.fix-text");
}

@Override
Expand Down

0 comments on commit 16922cd

Please sign in to comment.