public final class CreateDescriptor
extends java.lang.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 java.lang.String |
FREE_FILE_EXTENSION |
Parameter to enable free file extension mode.
|
static java.lang.String |
PREFORMATTED_TEMPLATE |
Specifies that no formatting or indentation should be performed on the template.
|
| Modifier and Type | Method | Description |
|---|---|---|
java.util.Locale |
getLocale() |
Provides the desired user locale for creating the template
|
java.lang.String |
getName() |
Provides the desired name for the created file.
|
java.util.Map<java.lang.String,java.lang.Object> |
getParameters() |
Provides access to the complete parameter map.
|
java.lang.String |
getProposedName() |
Provides a name proposed for the file.
|
org.openide.filesystems.FileObject |
getTarget() |
|
org.openide.filesystems.FileObject |
getTemplate() |
|
<T> T |
getValue(java.lang.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 java.lang.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 java.lang.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 java.lang.String getName()
null can be
returned to indicate the filename should be derived automatically.@NonNull public java.lang.String getProposedName()
getName(). A handler is encouraged
to use the proposed name if it does not require a certain naming scheme.@NonNull public java.util.Locale getLocale()
@CheckForNull public <T> T getValue(java.lang.String n)
CreateFromTemplateAttributes implementors.T - value type.n - key namenull if the key does not exist/has no value.@NonNull public java.util.Map<java.lang.String,java.lang.Object> getParameters()
public boolean hasFreeExtension()
public boolean isPreformatted()
Built on April 24 2018. | Portions Copyright 1997-2018 Oracle. All rights reserved.