What are the "built-in" filter options for ag-grid? - ag-grid

I see a reference to a built-in filter for "empty" in the doc below. Where can I find documentation for all built-in filter options?
https://www.ag-grid.com/javascript-grid-filtering/#adding-custom-filter-options

I couldn't find it in the documentation either.
However, you can look at the definition of the BaseFilter of the ag-grid here on the GitHub and get all the built-in filters.
export abstract class BaseFilter<T, P extends IFilterParams, M> extends Component implements IFilterComp {
public static EMPTY = 'empty';
public static EQUALS = 'equals';
public static NOT_EQUAL = 'notEqual';
public static LESS_THAN = 'lessThan';
public static LESS_THAN_OR_EQUAL = 'lessThanOrEqual';
public static GREATER_THAN = 'greaterThan';
public static GREATER_THAN_OR_EQUAL = 'greaterThanOrEqual';
public static IN_RANGE = 'inRange';
public static CONTAINS = 'contains'; //1;
public static NOT_CONTAINS = 'notContains'; //1;
public static STARTS_WITH = 'startsWith'; //4;
public static ENDS_WITH = 'endsWith'; //5;
// .....
}

Related

AEM : getSlingScriptHelper().getService returns null

I am trying to use the getSlingScriptHelper().getService in my project but it keeps returning null. I have done this in other projects and the implementation is similar. We are using sightly on AEM 6.3 in the project. My code below:
FOOModel :
public class FOOModel extends WCMUsePojo {
private static final Logger LOGGER = LoggerFactory.getLogger(FOOModel.class);
private String foo;
#Override
public void activate() throws Exception{
FOOInterface fooInterface = getSlingScriptHelper().getService(FOOInterface.class);
LOGGER.info("FOOInterface value is : " + fooInterface);
}
public String getFoo() {
return foo;
}
}
FooInterface :
public interface FOOInterface {
public String getFoo();
}
FOO Implementation :
#Component(metatype = true, immediate = true, label = "FOO Configuration", description = "OSGi Configuration FOO")
#Service(FOOInterface.class)
public class FOOImpl implements FOOInterface {
#Property(label = "FOO", description = "FOO to be provided")
public static final String FOO_URL = "foo.url";
private String foo;
#Activate
public void activate(ComponentContext componentContext){
Dictionary<?, ?> props = componentContext.getProperties();
this.foo = PropertiesUtil.toString(props.get(FOO_URL), StringUtils.EMPTY);
}
#Override
public String getSsoUrl() {
return foo;
}
}
The logs show "FOOInterface value is : null".
I've tried the sling model with class injection method but it did not work either.
EDIT : I have found that the service is not active. Attaching screenshot for the bundle status.
Most probably your FOOInterface service is not active. You can check /system/console/components to see its status.
The bundle that includes that service might not be properly installed. You can check its status at /system/console/bundles.

Way to find all affected locations by variable

I want to find code lines, where a certain property can get.
Consider I have property holder class and in java editor look to some setter method. In code is property readed and setted to entity. And before save to database, do validation on server side. So I want see from client.propertyHolder.setter to server.entityValidator.getter
Simple example
public class Main{
public static void main(String[] args) {
Holder h = new Holder();
h.setHolder("Something"); // Here i want use plugin
Entity e = new Entity();
e.setName(h.getHolder());
// Consider this is on server side in validator and call only if annotation validation is OK
Assert.assertTrue(e.getName().length() > 0)
}
}
public class Holder{
public String holder = null;
public void setHolder(String holder){this.holder = holder}
public void getHolder(){return holder}
}
public class Entity{
#javax.validation.constraints.NotNull
private String name = null;
public void setName(String name){this.name = name}
public void getName(){return name}
}
So i should get lines
e.setName(h.getHolder());
Assert.assertTrue(e.getName().length() > 0)
and be nice if NotNull anotations too
Is there a way, how to achive this? Some good free eclipse-plugin maybye?
Thanks for help. Pavel

Eclipse code formatter customization

I've recently configured my Eclipse Formatter and I'm pretty happy with how it works, except for one thing. I'd like to set it up so my member variables are sorted into 3 distinct group with a blank line between each of the groups. I want the first group to be static final variables (constants), the second to be regular static variables, and in the third I want all the non-static variables (or again split final and non-final ones, I don't mind either way).
For example, I'd like my class to look like this:
public class Foo {
public static final String PATH_TO_BAR = "C:/Drunken/Clam/Bar";
public static final int N_BARS = 42;
public static BufferedWriter logger;
public int foobar;
public String barfoo;
private int lengthOfBarFoo;
...
}
but right now it formats it as
public class Foo {
public static final String PATH_TO_BAR = "C:/Drunken/Clam/Bar";
public static BufferedWriter logger;
private int lengthOfBarFoo;
public String barfoo;
public static final int N_BARS = 42;
public int foobar;
...
}
Is this possible to set up somehow?
Eclipse save actions might come handy here, however not to such of a detail you've been asking for.
i think you can do that via below :
in eclipse you can sort "Members Sort Order" preference:
"Window -> Preferences -> Java -> Appearance -> Members Sort Order"
you can up and down the choice according to your need.
if you have any query or doubt, comment below.

Unity3D Access class from another script

hey how can i access this list of int and strings from another
script?
// Slot One Data
[Serializable]
public class SlotOneStats
{
public string nameOne;
public int roleOne;
public int strengthOne;
public int meleeOne;
public int shootingOne;
public int huntingOne;
public int cookingOne;
public int craftingOne;
public int buildingOne;
public int engineeringOne;
}
i tried changing 'public' to 'static' or 'public static' but whenever i changed to static
it will say
Static member `Main.SlotOneStats.ALLTHESTATICVARIABLEGOESHERE' cannot be accessed with an
instance reference, qualify it with a type name instead
BinaryFormatter bfWriter = new BinaryFormatter();
FileStream file = File.Create(Application.persistentDataPath + "/dataStats" + onSlot + ".fgsv");
if(onSlot == 1)
{
SlotOneStats slotoneStats = new SlotOneStats();
slotoneStats.nameOne = name;
slotoneStats.roleOne = role;
slotoneStats.strengthOne = strength;
slotoneStats.meleeOne = melee;
slotoneStats.shootingOne = shooting;
slotoneStats.huntingOne = hunting;
slotoneStats.cookingOne = cooking;
slotoneStats.craftingOne = crafting;
slotoneStats.buildingOne = building;
slotoneStats.engineeringOne = engineering;
bfWriter.Serialize(file, slotoneStats);
}
I would suggest adding a public instance of the class to the first script:
public class SlotOneStats
{
public string nameOne;
public int roleOne;
public int strengthOne;
public int meleeOne;
public int shootingOne;
public int huntingOne;
public int cookingOne;
public int craftingOne;
public int buildingOne;
public int engineeringOne;
}
public SlotOneStats SOS;
Now just access the public varaible SOS and it should work:
GameObject example = GameObject.Find("Object_with_script").GetComponent<Script_with_class>.SOS;
// do stuff with example

How to ignore a specific warning in PyDev?

How do I ignore a specific warning in Eclipse?
I am doing ZetCode's PyQt4 tutorial LPTHW style (yes, I'm using PyDev), and adding helpful comments so I can use it as a reference. Eclipse is bugging me about an unused variable. (It is being used, because the initialization function automatically runs the code. Just to be clear.)
I don't want to turn it off for the whole file, because that is actually handy in most situations. I just want to ignore that warning.
For suppressing warnings on a specific line, your only option is to add a comment such as ##UnusedVariable to the line:
def foo():
x = 5 # #UnusedVariable
return 10
To suppress a different type of warning, see the list of suppression string constants in the PyDev source code:
public static final String MSG_TO_IGNORE_TYPE_UNUSED_IMPORT = "#UnusedImport";
public static final String MSG_TO_IGNORE_TYPE_UNUSED_WILD_IMPORT = "#UnusedWildImport";
public static final String MSG_TO_IGNORE_TYPE_UNUSED_VARIABLE = "#UnusedVariable";
public static final String MSG_TO_IGNORE_TYPE_UNDEFINED_VARIABLE = "#UndefinedVariable";
public static final String MSG_TO_IGNORE_TYPE_DUPLICATED_SIGNATURE = "#DuplicatedSignature";
public static final String MSG_TO_IGNORE_TYPE_REIMPORT = "#Reimport";
public static final String MSG_TO_IGNORE_TYPE_UNRESOLVED_IMPORT = "#UnresolvedImport";
public static final String MSG_TO_IGNORE_TYPE_NO_SELF = "#NoSelf";
public static final String MSG_TO_IGNORE_TYPE_UNDEFINED_IMPORT_VARIABLE = "#UndefinedVariable";
public static final String MSG_TO_IGNORE_TYPE_UNUSED_PARAMETER = "#UnusedVariable";
public static final String MSG_TO_IGNORE_TYPE_NO_EFFECT_STMT = "#NoEffect";
public static final String MSG_TO_IGNORE_TYPE_INDENTATION_PROBLEM = "#IndentOk";
public static final String MSG_TO_IGNORE_TYPE_ASSIGNMENT_TO_BUILT_IN_SYMBOL = "#ReservedAssignment";
public static final String MSG_TO_IGNORE_TYPE_PEP8 = "#IgnorePep8";
public static final String MSG_TO_IGNORE_TYPE_ARGUMENTS_MISATCH = "#ArgumentMismatch";
For example:
def get_answer(format='string'): # #ReservedAssignment
answer = 42.0
if format == 'string':
return str(answer)
elif format == 'int':
return int(answer)
else:
return answer