properties

Why doesn't Java have constants for well-known system property names?

The java.lang.System class defines a number of well-known properties. For example, you can obtain the JVM's temporary directory by looking up the "java.io.tmpdir" property: ... = System.getProperty("java.io.tmpdir"); What I don't understand is why these properties aren't defined as constants (e.g. in the java.lang.System class). This...

How do I find all the property keys of a KVC compliant Objective-C object?

Hello, Is there a method that returns all the keys for an object conforming to the NSKeyValueCoding protocol? Something along the lines of [object getPropertyKeys] that would return an NSArray of NSString objects. It would work for any KVC-compliant object. Does such a method exist? I haven't found anything in searching the Apple docs ...

How to name pure virtual protected property

foreword: I have a component, lets call it IView. This component is implemented by BaseView class which holds most of it's functionality. We are using the template pattern to delegate logic to inheretting classes. The problem: We have a property named IView.Visible, that indicates if the component should or should not be visible. This...

C#: How to get the index of the selected item(and the text) in ListBox

I have a listbox(detailed view).My question is how do I get the index of the selected item? Eventually,how to get the text at the index,but that should be easy. ...

Autorelease and "assign" properties in Objective-C? (On iPhone)

I have an instance of a UITableView, and a separate class that adheres to the delegate and datasource protocols. I'm doing this like so: SubjectTableViewHandler *handler = [[[SubjectTableViewHandler alloc] init] retain]; tv.delegate = handler; tv.dataSource = handler; [handler autorelease]; I don't want to maintain the handler as an i...

Use external Bundle-Localization path in MANIFEST file

The MANIFEST.MF file contains an entry to define which *.properties files are loaded at runtime. These entry defined name and the corresponding properties file is used to translate the plugin strings which start with the prefix "%", like "%plugin.name" Bundle-Localization: plugin plugin.properties than contains a line like %plugin.na...

Should I make this a read only property or a function.

So in my COM wrapper I have a property like this: public string Name { get { //Call the COM object //Work the returned object //Return the name. } } I was doing some reading on read-only properties vs function and was wondering if I should change this to a function instead, something along the lines ...

Public Properties and Private Members C#

What are the benefits of only using public properties instead of using the public property to access a private variable? For example public int iMyInt { get; set; } instead of private int myint; public int iMyInt { get { return myint; } set { myint = value; } } Other than letting .NET manage the variable / memory underneath the ...

Objective-c Iphone how to set default value for a property.

Hi i've got the following code in a ViewController.h: #import <UIKit/UIKit.h> @interface CalcViewController : UIViewController { NSNumber* result; NSString* input; //NSString* input = @""; IBOutlet UITextField* display; } @property (retain) NSNumber* result; @property (retain) NSString* input; @property (nonatomic, re...

mapping data in properties files

I have the following data: User System SubSystem user1 System1 SubSystem1 user2 System1 SubSystem2 user3 N/A N/A and i need to be able to determine the system/subsystem tuple from the user. I must be able to add users at any time without rebuilding and redeploying the system I know the database would be the best option ...

c# marking class property as dirty

The following is a simple example of an enum which defines the state of an object and a class which shows the implementation of this enum. public enum StatusEnum { Clean = 0, Dirty = 1, New = 2, Deleted = 3, Purged = 4 } public class Example_Class { private StatusEnum _Status = StatusEnum.New; private long...

Load java.util.logging.config.file for default initialization

Hi, I'm trying to load a custom log.properties file when my application is started. My properties file is in the same package as my main class, so i assumed that the -Djava.util.logging.config.file=log.properties command line parameter should get the properties file loaded. But the properties are only loaded when i specify a full abso...

Is "assign" the default setup of the @property compiler directive?

If I define an property and just do: @property(nonatomic) UIButton* button; then I think that it's an "assign" property. Is that correct? ...

What's the difference between @property and @synthesize?

Like I understand, @synthesize actually is generating the Getters and Setters. But what's @property then doing? Is it just setting up the parameters for that cool @synthesize magic function? ...

Setting DefaultValue for properties of non-Constant types?

Hi, I have a Windows.Forms component which has a "mySize" property that returns a Size struct. My intention was to have this property calculate the returned mySize automatically based on the size of the component, unless mySize has been explicity set, in which case, return the set value of mySize. Unfortunately, now that I am embedding t...

What is the difference between a property and an instance variable?

I think I've been using these terms interchangably / wrongly! ...

What's the best way to use Obj-C 2.0 Properties with mutable objects, such as NSMutableArray?

I have an Obj-C 2.0 class that has an NSMutableArray property. If I use the following code, then the synthesised setter will give me an immutable copy, not a mutable one: @property (readwrite, copy) NSMutableArray *myArray; Is there any reason that Apple didn't implement the following syntax? @property (readwrite, mutablecopy) NSMuta...

Using Jboss Portal, How do I retrieve page properties in a jsp?

Using Jboss portal, how do I retrieve the page properties in a jsp? I've declared my page like that in *-object.xml file: <page> <page-name>MyPage</page-name> <properties> <property> <name>layout.id</name> <value>generic</value> </property> <property> <name>hidePanel</name> <value>true</value> ...

C# generics list of objects used as a property - can't add values

I'm trying generics for the first time and am having a problem. I have a dll that sends messages in batches there is a "Message" class and a "Batch" class in that dll on the batch class, I have some public properties on of the batch class's public properties is a property called "Messages" which is a list of the "Message" class as fol...

Can I use XAML to set a nested property (property of the value of a property) of a control ?

I've got a WPF Control that exposes one of it's children (from it's ControlTemplate) through a read-only property. At the moment it's just a CLR property, but I don't think that makes any difference. I want to be able to set one of the properties on the child control from the XAML where I'm instantiating the main control. (Actually, I w...