custom-component

Use declare styleable to set custom component input type

旧巷老猫 提交于 2019-11-27 20:51:04
问题 I have a CompositeComponent (EditText+ImageButton) When clicking on button the edittext content will be cleared. It is working fine. My problem is setting attributes to my component. I am using declare-styleable to set attributes to my component. I am successful at setting minLines, maxLines and textColor. How can I set inputtype to my component via xml. my attributes.xml <?xml version="1.0" encoding="utf-8"?> <resources> <declare-styleable name="CET"> <attr name="MaxLines" format="integer"/>

Adding Custom Attributes to Primefaces Autocomplete Component in JSF

十年热恋 提交于 2019-11-27 20:35:52
问题 I asked about pass through attributes in a different question and found I could create a custom renderer for the <p:autocomplete> component but the problem is my custom renderer would be used for every p:autocomplete in my project (site-wide). Therefore I have elected to create a custom component which extends org.primefaces.component.autocomplete.AutoComplete and adds the necessary attributes to the text box. My initial thought was to add a constructor but it doesn't seem to work because the

TypeArray in Android - How to store custom objects in xml and retrieve them?

孤街醉人 提交于 2019-11-27 20:08:28
I have a class like public class CountryVO { private String countryCode; private String countryName; private Drawable countryFlag; public String getCountryCode() { return countryCode; } public void setCountryCode(String countryCode) { this.countryCode = countryCode; } public String getCountryName() { return countryName; } public void setCountryName(String countryName) { this.countryName = countryName; } public Drawable getCountryFlag() { return countryFlag; } public void setCountryFlag(Drawable countryFlag) { this.countryFlag = countryFlag; } } and want to store objects of this class in an

Using TOwnedCollection descendant in Delphi

本小妞迷上赌 提交于 2019-11-27 18:40:47
问题 I'm trying to create a custom component with a collection property. However if I try to open the collection editor during design time by clicking "..." button in object inspector, nothing happens. What I am missing? Here's my TCollection descendant: TMyCollection = class(TOwnedCollection) private function GetItem(Index: Integer): TMyCollectionItem; procedure SetItem(Index: Integer; const Value: TMyCollectionItem); public function Add : TMyCollectionItem; property Items[Index: Integer]:

Is “implicitly imported” always a bad thing in Delphi packages?

旧时模样 提交于 2019-11-27 17:24:24
问题 Trying to rearrange my packages for a set of TFrame-descendent components, I'm finding it seemingly necessary to break out some of my utility TFrame descendents separate from the dialog forms which use them, mainly because the former are registered to the palette as true components and that seems to confuse the IDE sometimes with respect to the dialog forms which use them. The dialog forms in turn are called by non-visual components, which are part of a third package. This, so far , seems to

Creating a custom editText with tag-like feature

和自甴很熟 提交于 2019-11-27 11:41:31
I've been searching around but could not find any answers to this. What I'm trying to implement is an EditText similar to the 'To' field found in the composing screen of the ICS gmail app. Here's an image describing what I want: I'm thinking of extending EditText and implementing my own custom EditText class but I'm not really sure how to do that or even if that's the best solution. Any thoughts? bill-x Hm, took a while to find a similar question but nonetheless, here's the closest answer I found . I knew other people had this kind of problem before! Thanks to CommonsWare for pointing me in

Android - Writing a custom (compound) component

孤街醉人 提交于 2019-11-27 10:12:18
The Android app I'm currently developing has a main activity that has grown quite large. This is mainly because it contains a TabWidget with 3 tabs. Each tab has quite a few components. The activity has to control of all those components at once. So I think you can imagine that this Activity has like 20 fields (a field for almost every component). Also it contains a lot of logic (click listeners, logic to fill lists, etc). What I normally do in component based frameworks is to split everything up into custom components. Each custom component would then have a clear responsibility. It would

my Custom View gets drawn only when added in onCreate

拈花ヽ惹草 提交于 2019-11-27 08:39:37
问题 I made a "GraphBar" custom view that is a RelativeLayout with a TextView on the bottom and an ImageView , varying in height, above that. Here is the code: public class GraphBar extends RelativeLayout { private int mAvailHeight; // space for the bar (component minus label) private float mBarHeight; // 0.0-1.0 value public GraphBar(Context context) { this(context, null); } public GraphBar(Context context, AttributeSet attrs) { this(context, attrs, 0); } public GraphBar(Context context,

Creating a component with named sub-components?

二次信任 提交于 2019-11-27 04:34:28
I need to know the basics behind making a component produce and manage sub-components. I originally tried this by creating a TCollection , and tried to put a name on each TCollectionItem . But I learned it's not that easy as I had hoped. So now I am going to start this project from scratch again, and I'd like to get it right this time. These sub-components are not visual components, and should not have any display or window, just based off of TComponent . The main component holding these sub-components will also be based off of TComponent . So nothing here is visual at all, and I don't want a

What is the relationship between component family, component type and renderer type?

◇◆丶佛笑我妖孽 提交于 2019-11-27 03:51:04
When I am learning custom component development in JSF, I got confused with the relationship between component family, component type and renderer type. For example, I registered a renderer and a custom component as shown below. faces-config.xml : <component> <component-type>study.faces.Div</component-type> <component-class>javax.faces.component.UIPanel</component-class> </component> <render-kit> <render-kit-id>HTML_BASIC</render-kit-id> <renderer> <component-family>javax.faces.Panel</component-family> <renderer-type>study.faces.DivRenderer</renderer-type> <renderer-class>com.study.ui