public final class CreateDescriptor extends Object
FileBuilder
and is sent out to
CreateFromTemplateAttributes
and CreateFromTemplateHandler
SPIs as the context for their work.
The class is not thread-safe. Do not access the descriptor from a thread other
than executing the CreateFromTemplateHandler
callbacks.Modifier and Type | Field | Description |
---|---|---|
static String |
FREE_FILE_EXTENSION |
Parameter to enable free file extension mode.
|
static String |
PREFORMATTED_TEMPLATE |
Specifies that no formatting or indentation should be performed on the template.
|
Modifier and Type | Method | Description |
---|---|---|
Locale |
getLocale() |
Provides the desired user locale for creating the template
|
String |
getName() |
Provides the desired name for the created file.
|
Map<String,Object> |
getParameters() |
Provides access to the complete parameter map.
|
String |
getProposedName() |
Provides a name proposed for the file.
|
org.openide.filesystems.FileObject |
getTarget() |
|
org.openide.filesystems.FileObject |
getTemplate() |
|
<T> T |
getValue(String n) |
Provides value for the named key.
|
boolean |
hasFreeExtension() |
Specifies whether the extension should be taken from the specified name,
or the extension is fixed to the template's one.
|
boolean |
isPreformatted() |
public static final String FREE_FILE_EXTENSION
FileBuilder.createFromTemplate(org.openide.filesystems.FileObject, org.openide.filesystems.FileObject, java.lang.String, java.util.Map, org.netbeans.api.templates.FileBuilder.Mode)
is called with this
parameter set to Boolean.TRUE
and the file name already seems to
include an extension (*.*), the handler should not append
any extension from the template.Templates.SimpleTargetChooserBuilder.freeFileExtension
,
Constant Field Valuespublic static final String PREFORMATTED_TEMPLATE
CreateFromTemplateHandler
to pay attention to this value.@NonNull public org.openide.filesystems.FileObject getTemplate()
@NonNull public org.openide.filesystems.FileObject getTarget()
@CheckForNull public String getName()
null
can be
returned to indicate the filename should be derived automatically.@NonNull public String getProposedName()
getName()
. A handler is encouraged
to use the proposed name if it does not require a certain naming scheme.@NonNull public Locale getLocale()
@CheckForNull public <T> T getValue(String n)
CreateFromTemplateAttributes
implementors.T
- value type.n
- key namenull
if the key does not exist/has no value.@NonNull public Map<String,Object> getParameters()
public boolean hasFreeExtension()
public boolean isPreformatted()
Built on April 24 2018. | Portions Copyright 1997-2018 Oracle. All rights reserved.