Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference
11g Release 1 (11.1.1)

E13403-04

oracle.ide.db.util
Class NameController

java.lang.Object
  extended by oracle.ide.db.util.NameController

public class NameController
extends java.lang.Object

A name controller is used by the UI for controlling name fields. A name field can :

Since:
11.0

Constructor Summary
NameController()
           
 
Method Summary
 boolean canHaveDuplicateNames()
          Returns false by default.
 java.lang.String getDefaultName(java.lang.String type, java.lang.String objName)
          Returns a default name for the given object type and name.
static java.lang.String getEntityName(java.lang.String databaseName)
          Given the name of a database object (typically uppercase with no spaces) this method constructs a default java-like entity name.
 java.lang.String getExternalName(java.lang.String name)
           
 java.lang.String getInternalName(java.lang.String name)
           
 java.lang.String getItemLabel(java.lang.String objectName, java.lang.String otherName)
          Returns the label for the item in the shuttle picker that should be displayed for an item representing an object (e.g.
 java.lang.String getNameLabel()
           
 void validateName(java.lang.String type, java.lang.String name)
          Validates the given name entered by the user and throws an Exception if it isn't valid.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NameController

public NameController()
Method Detail

getNameLabel

public java.lang.String getNameLabel()
Returns:
the label (inc mnemonic) for the name field.

canHaveDuplicateNames

public boolean canHaveDuplicateNames()
Returns false by default. Override to allow different db objects to have the same name field value.

Returns:
whether or not different objects can have the same name field value.

validateName

public void validateName(java.lang.String type,
                         java.lang.String name)
                  throws InvalidNameException
Validates the given name entered by the user and throws an Exception if it isn't valid. This method does not have to search for duplicates in the list - that is done by the picker given the value returned by canHaveDuplicateNames().

Throws:
InvalidNameException - if the name is invalid. The message should detail why it is invalid.

getDefaultName

public java.lang.String getDefaultName(java.lang.String type,
                                       java.lang.String objName)
Returns a default name for the given object type and name. The name provided should be of internal form, if there is a difference for this name provider.

By default this method produces an init-capped version of the database object name.

Parameters:
type - - the object type that we're dealing with
objName - - the object name we're creating a default from
Returns:
a suitable default value for the name field.

getInternalName

public java.lang.String getInternalName(java.lang.String name)
Returns:
the representation to be stored in the model for the given user entered name.

getExternalName

public java.lang.String getExternalName(java.lang.String name)
Returns:
the external, editable, version of the name from the model that we can give to the user in the text field.

getItemLabel

public java.lang.String getItemLabel(java.lang.String objectName,
                                     java.lang.String otherName)
Returns the label for the item in the shuttle picker that should be displayed for an item representing an object (e.g. Table) that has been given another name.

Parameters:
objectName - the name of the real database object chosen
otherName - the extra name provided by the user through the text field
Returns:
the String to use in the item in the shuttle list.

getEntityName

public static final java.lang.String getEntityName(java.lang.String databaseName)
Given the name of a database object (typically uppercase with no spaces) this method constructs a default java-like entity name.

Parameters:
databaseName - the database object name to convert.

Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference
11g Release 1 (11.1.1)

E13403-04

Copyright © 1997, 2010, Oracle. All rights reserved.