|
Sweet Home 3D 4.1 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.eteks.sweethome3d.swing.FileContentManager
public class FileContentManager
Content manager for files with Swing file choosers.
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface com.eteks.sweethome3d.viewcontroller.ContentManager |
---|
ContentManager.ContentType |
Constructor Summary | |
---|---|
FileContentManager(UserPreferences preferences)
|
Method Summary | |
---|---|
protected boolean |
confirmOverwrite(View parentView,
String path)
Displays a dialog that let user choose whether he wants to overwrite file path or not. |
Content |
getContent(String contentPath)
Returns a URL content object that references
the given file path. |
String |
getDefaultFileExtension(ContentManager.ContentType contentType)
Returns the default file extension of a given content type. |
protected String |
getFileDialogTitle(boolean save)
Returns default file dialog title. |
protected FileFilter[] |
getFileFilter(ContentManager.ContentType contentPath)
Returns the file filters available for a given content type. |
protected File |
getLastDirectory(ContentManager.ContentType contentType)
Returns the last directory used for the given content type. |
String |
getPresentationName(String contentPath,
ContentManager.ContentType contentType)
Returns the file name of the file path in parameter. |
boolean |
isAcceptable(String contentPath,
ContentManager.ContentType contentType)
Returns true if the file path in parameter is accepted
for contentType . |
protected boolean |
isDirectory(ContentManager.ContentType contentType)
Returns true if the given content type is for directories. |
protected void |
setLastDirectory(ContentManager.ContentType contentType,
File directory)
Stores the last directory for the given content type. |
String |
showOpenDialog(View parentView,
String dialogTitle,
ContentManager.ContentType contentType)
Returns the file path chosen by user with an open file dialog. |
String |
showSaveDialog(View parentView,
String dialogTitle,
ContentManager.ContentType contentType,
String path)
Returns the file path chosen by user with a save file dialog. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public FileContentManager(UserPreferences preferences)
Method Detail |
---|
public Content getContent(String contentPath) throws RecorderException
URL content
object that references
the given file path.
getContent
in interface ContentManager
RecorderException
public String getPresentationName(String contentPath, ContentManager.ContentType contentType)
getPresentationName
in interface ContentManager
protected FileFilter[] getFileFilter(ContentManager.ContentType contentPath)
public String getDefaultFileExtension(ContentManager.ContentType contentType)
null
this extension will be appended automatically
to the file name chosen by user in save dialog.
This method may be overridden to change the default file extension of an existing content type
or to define the default file extension of a user defined content type.
public boolean isAcceptable(String contentPath, ContentManager.ContentType contentType)
true
if the file path in parameter is accepted
for contentType
.
isAcceptable
in interface ContentManager
protected boolean isDirectory(ContentManager.ContentType contentType)
true
if the given content type is for directories.
public String showOpenDialog(View parentView, String dialogTitle, ContentManager.ContentType contentType)
showOpenDialog
in interface ContentManager
null
if user canceled its choice.public String showSaveDialog(View parentView, String dialogTitle, ContentManager.ContentType contentType, String path)
showSaveDialog
in interface ContentManager
null
if user canceled its choice.protected File getLastDirectory(ContentManager.ContentType contentType)
contentType
or the default last directory
if it's not set. If contentType
is null
, the
returned directory will be the default last one or null
if it's not set yet.protected void setLastDirectory(ContentManager.ContentType contentType, File directory)
protected String getFileDialogTitle(boolean save)
protected boolean confirmOverwrite(View parentView, String path)
path
or not.
true
if user confirmed to overwrite.
|
Sweet Home 3D 4.1 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
![]() |
© Copyrights 2006-2013 eTeks - All rights reserved
Distributed under GNU General Public License |