Jump to a custom property definition - google-chrome-devtools

Is there a way to jump to a CSS custom property definition from a declaration value that uses the property? E.g. in the screenshot below, I want to jump to the definition of --primary-color.

Related

Unity Custom Editor - Add Data Fields Based on Derived Type

Final goal: create a custom editor that will let me select from a list of types and then enter additional parameters specific to that type.
To this end, I have created a pure data type, let's call it BasicData, with a SpecificData parameter of an abstract base type, let's call it ExtraData. The idea is to have the type information in BasicData (enum value), and then populate the SpecificData field in the custom editor code so that when I change selection a new object from a class derived from ExtraData. Then its values can be further edited by additional fields created for that specific type, as shown here.
I started doing the above, but I ran into problems trying to get the actual object being edited in order to set the SpecificData property. My classes are not Unity objects or scripts, and I'd rather not turn them into such just for this. I might be able to use reflection to do this but then changes in the editor won't take effect while it runs, from what I understand.
What is the best way to accomplish this?

Expression Binding for Property in SAPUI5

I'm trying to set the property of a control using another control's property. In my case, I have one <sap.m.Select> and a <sap.m.Input>. The visible of <sap.m.Input> will depend on the selectedItem of the <sap.m.Select>. IMO, there is an available approach using Expression binding in XML View but I don't know how. Any suggestion?
You can use two way binding so that both properties are binding expressions over the same property in the model.
So you can create a JSON model for example and put there a property called selectedItem. The binding of the properties should be: on select selectedItem={mymodel>selectedItem} and on input visible={parts: [{path: "mymodel>selectedItem"}], formatter: function (selectedItem) {<your manipulation>} }.
You can do that with JavaScript and with XML view. In XML view you should reference to a formatter method in the controller.

How to show javadoc warning if the parameters in a method are not declared as final?

I have created a project specific code formatting and code template xml's.
I would like to show javadoc warning to the user if the parameters in a method are not declared as final.
Kindly let me know which attribute do I need to modify in properties window?

Adding and removing Data Annotation attributes dynamically

I have a little bit of a curve ball for you. Maybe just a design issue...maybe even something as simple as me not understanding Data annotation providers.
Anyway here we go:
I have a class which represents some model data. Let's say it represents a package/box/carton.
It actually represents all of these things so I use the class in several different views. Sometimes I want the attribute of the field Package_Description to be
So that it shows up as Box Number : input box here.
Now if i want it to appear as "Carton Name" my only option would be to sub type it. Or use a separate class to have the annotations for this class. My quandary is that some of the field names are user configurable and therefore I cannot have a static definition!
(By the way i am using third party librarys [Telerik MVC Grid] do display these field names so i cannot change the fact that it's looking at data annotation )
So I just need to know is there a way to add attributes dynamically?
Create an anonymous type on the fly, sub class the original and then add attributes using reflection?
Or what other options are open to me, do I need to somehow implement a different annotation provider?
Attributes are part of the definition of the type. Because of that, you can't modify attributes of existing classes during runtime.
You could create a new type during runtime (not an anonymous type), but I think that's not such a good idea. I'm sure whatever component you're using, it allows you to specify the appearance explicitly.

Using Generic Types with MVC2 Templates

I have a model class that is a generic type. I would like to create a custom editor template that would display it (and put it in the Shared folder).
How can I do that?
I can't figure out how to name it so that MVC2 would pick it up over the generic template.
Additionally I am wondering if there is a way to explicitly specify which template a top-level class should use (like you can do with a property using UIHint attribute). Is there a way to override the functionality that picks the templates based on the class name?
Please help.
The easiest way is to accomplish #1 is to specify the template name when displaying the model, as the second parameter:
<%= Html.DisplayFor(m => m.GenericList, "DisplayList")%>
The handling is generics isn't very good in MVC2. The source code says:
// TODO: Make better string names for generic types
So, when rendering a list, it look for a template named List`1 be default to render it, if you don't specify another name.
On the second point, you would would do the same as #1. Specify the templatename or use UIHint when rendering the item.