Initial commit from SVN.
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
/*
|
||||
* Copyright (c) 2003,2007 Declarative Engineering LLC.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Declarative Engineering LLC
|
||||
* verson 1 which accompanies this distribution, and is available at
|
||||
* http://declarativeengineering.com/legal/DE_Developer_License_v1.txt
|
||||
*/
|
||||
package com.foundation.tcv.client.view;
|
||||
|
||||
import com.foundation.tcv.view.*;
|
||||
import com.foundation.tcv.client.controller.*;
|
||||
import com.foundation.view.IResourceHolderComponent;
|
||||
|
||||
public interface IAbstractClientViewComponent extends IAbstractRemoteViewComponent, IResourceHolderComponent {
|
||||
/**
|
||||
* Initializes the component.
|
||||
* @param number The component's number.
|
||||
* @param controller The component's view controller.
|
||||
*/
|
||||
public void initialize(int number, SessionViewController sessionViewController);
|
||||
/**
|
||||
* Gets the component's view controller.
|
||||
* @return The view component's view controller.
|
||||
*/
|
||||
public SessionViewController getSessionViewController();
|
||||
}//IAbstractClientViewComponent//
|
||||
@@ -0,0 +1,33 @@
|
||||
/*
|
||||
* Copyright (c) 2006,2009 Declarative Engineering LLC.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Declarative Engineering LLC
|
||||
* verson 1 which accompanies this distribution, and is available at
|
||||
* http://declarativeengineering.com/legal/DE_Developer_License_v1.txt
|
||||
*/
|
||||
package com.foundation.tcv.client.view;
|
||||
|
||||
import com.foundation.view.IResourceHolderComponent;
|
||||
import com.foundation.view.resource.AbstractResourceService;
|
||||
|
||||
/**
|
||||
* Used by components that may receive either a static value or a reference to a resource.
|
||||
* This resource association will take the value, register listeners if it is a resource, get the actual value if it is a resource, and notify the component when the value is set or is changed.
|
||||
* <p><b>Note: It is probably a fair bit more efficient to use an AbstractResourceHolder for each element in collecton style control since the resource manager then performs all the indexing instead of having a middle man.</b></p>
|
||||
*/
|
||||
public class MultiResourceHolder extends com.foundation.view.AbstractMultiResourceHolder {
|
||||
/**
|
||||
* MultiResourceHolder constructor.
|
||||
* @param component The component that will be notified when the resource value changes.
|
||||
*/
|
||||
public MultiResourceHolder(IResourceHolderComponent component) {
|
||||
super(component);
|
||||
}//MultiResourceHolder()//
|
||||
/**
|
||||
* Gets the resource service associated with the application this holder exists under.
|
||||
* @return The application's resource service.
|
||||
*/
|
||||
protected AbstractResourceService getResourceService() {
|
||||
return getComponent().getResourceService();
|
||||
}//getResourceService()//
|
||||
}//MultiResourceHolder//
|
||||
@@ -0,0 +1,45 @@
|
||||
/*
|
||||
* Copyright (c) 2006,2007 Declarative Engineering LLC.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Declarative Engineering LLC
|
||||
* verson 1 which accompanies this distribution, and is available at
|
||||
* http://declarativeengineering.com/legal/DE_Developer_License_v1.txt
|
||||
*/
|
||||
package com.foundation.tcv.client.view;
|
||||
|
||||
import com.foundation.tcv.client.application.AbstractClientApplication;
|
||||
import com.foundation.view.IResourceHolderComponent;
|
||||
import com.foundation.view.resource.AbstractResourceService;
|
||||
import com.foundation.view.resource.ResourceReference;
|
||||
|
||||
/**
|
||||
* Used by components that may receive either a static value or a reference to a resource.
|
||||
* This resource association will take the value, register listeners if it is a resource, get the actual value if it is a resource, and notify the component when the value is set or is changed.
|
||||
*/
|
||||
public class ResourceHolder extends com.foundation.view.AbstractResourceHolder {
|
||||
/**
|
||||
* ResourceHolder constructor.
|
||||
* @param component The component that will be notified when the resource value changes.
|
||||
*/
|
||||
public ResourceHolder(IResourceHolderComponent component) {
|
||||
super(component);
|
||||
}//ResourceHolder()//
|
||||
/**
|
||||
* Gets the resource service associated with the application this holder exists under.
|
||||
* @return The application's resource service.
|
||||
*/
|
||||
protected AbstractResourceService getResourceService() {
|
||||
return getComponent().getResourceService();
|
||||
}//getResourceService()//
|
||||
/**
|
||||
* Gets the resource value for the referenced resource.
|
||||
* <p>Note: This will only get the current value and will not provide notification when the value changes.</p>
|
||||
* @param component The component requesting the value.
|
||||
* @return The value for the referenced resource.
|
||||
*/
|
||||
public static Object getResourceValue(IAbstractClientViewComponent component, ResourceReference reference) {
|
||||
AbstractResourceService resourceService = ((AbstractClientApplication) component.getSessionViewController().getSessionController().getApplication()).getResourceService();
|
||||
|
||||
return resourceService.getResourceValue((ResourceReference) reference);
|
||||
}//getResourceValue()//
|
||||
}//ResourceHolder//
|
||||
Reference in New Issue
Block a user