public class ResourceAndContainerGroup extends Object
Modifier and Type | Field and Description |
---|---|
static int |
PROBLEM_CONTAINER_EMPTY
Constant for empty container.
|
static int |
PROBLEM_NAME_INVALID
Constant for invalid name.
|
static int |
PROBLEM_NONE
Constant for no problem.
|
static int |
PROBLEM_PATH_INVALID
Constant for invalid path.
|
static int |
PROBLEM_PATH_OCCUPIED
Constant for path already occupied.
|
static int |
PROBLEM_PROJECT_DOES_NOT_EXIST
Constant for project does not exist.
|
static int |
PROBLEM_RESOURCE_EMPTY
Constant for empty resource.
|
static int |
PROBLEM_RESOURCE_EXIST
Constant for resource already exists.
|
Constructor and Description |
---|
ResourceAndContainerGroup(Composite parent,
Listener client,
String resourceFieldLabel,
String resourceType,
boolean showClosedProjects,
int heightHint)
Create an instance of the group to allow the user to enter/select a
container and specify a resource name.
|
Modifier and Type | Method and Description |
---|---|
boolean |
areAllValuesValid()
Returns a boolean indicating whether all controls in this group contain
valid values.
|
boolean |
getAllowExistingResources()
Returns the flag indicating whether existing resources are permitted.
|
IPath |
getContainerFullPath()
Returns the path of the currently selected container or null if no
container has been selected.
|
String |
getProblemMessage()
Returns an error message indicating the current problem with the value of
a control in the group, or an empty message if all controls in the group
contain valid values.
|
int |
getProblemType()
Returns the type of problem with the value of a control in the group.
|
String |
getResource()
Returns a string that is the name of the chosen resource, or an empty
string if no resource has been entered.
|
void |
handleEvent(Event e)
Handles events for all controls in the group.
|
void |
setAllowExistingResources(boolean value)
Sets the flag indicating whether existing resources are permitted.
|
void |
setContainerFullPath(IPath path)
Sets the value of this page's container.
|
void |
setFocus()
Gives focus to the resource name field and selects its contents
|
void |
setResource(String value)
Sets the value of this page's resource name.
|
void |
setResourceExtension(String value)
Set the only file extension allowed for the resource name field.
|
public static final int PROBLEM_NONE
public static final int PROBLEM_RESOURCE_EMPTY
public static final int PROBLEM_RESOURCE_EXIST
public static final int PROBLEM_PATH_INVALID
public static final int PROBLEM_CONTAINER_EMPTY
public static final int PROBLEM_PROJECT_DOES_NOT_EXIST
public static final int PROBLEM_NAME_INVALID
public static final int PROBLEM_PATH_OCCUPIED
public ResourceAndContainerGroup(Composite parent, Listener client, String resourceFieldLabel, String resourceType, boolean showClosedProjects, int heightHint)
parent
- composite widget to parent the groupclient
- object interested in changes to the group's fields valueresourceFieldLabel
- label to use in front of the resource name fieldresourceType
- one word, in lowercase, to describe the resource to the user
(file, folder, project)showClosedProjects
- whether or not to show closed projectsheightHint
- height hint for the container selection widget grouppublic boolean areAllValuesValid()
public IPath getContainerFullPath()
null
public String getProblemMessage()
public int getProblemType()
public String getResource()
setResourceExtension(String)
public void handleEvent(Event e)
e
- org.eclipse.swt.widgets.Eventpublic void setAllowExistingResources(boolean value)
value
- public void setContainerFullPath(IPath path)
path
- Full path to the container.public void setFocus()
public void setResource(String value)
value
- new valuepublic void setResourceExtension(String value)
value
- The resource extension without the '.' prefix (e.g. 'java',
'xml')public boolean getAllowExistingResources()
setAllowExistingResources(boolean)
Copyright © 2005, 2018 IBM Corporation and others. All Rights Reserved.