org.kde.koala
Class KDirOperator

java.lang.Object
  extended by org.kde.qt.Qt
      extended by org.kde.qt.QObject
          extended by org.kde.qt.QWidget
              extended by org.kde.koala.KDirOperator
All Implemented Interfaces:
org.kde.qt.QPaintDeviceInterface, org.kde.qt.QtSupport

public class KDirOperator
extends org.kde.qt.QWidget

This widget works as a network transparent filebrowser. You specify a URL to display and this url will be loaded via KDirLister. The user can browse through directories, highlight and select files, delete or rename files. It supports different views, e.g. a detailed view (see KFileDetailView), a simple icon view (see KFileIconView), a combination of two views, separating directories and files ( KCombiView). Additionally, a preview view is available (see KFilePreview), which can show either a simple or detailed view and additionally a preview widget (see setPreviewWidget()). KImageFilePreview is one implementation of a preview widget, that displays previews for all supported filetypes utilizing KIO.PreviewJob. Currently, those classes don't support Drag&Drop out of the box -- there you have to use your own view-classes. You can use some DnD-aware views from Bj???n Sahlstr??? until they will be integrated into this library. See http://devel-home.kde.org/~pfeiffer/DnD-classes.tar.gz This widget is the one used in the KFileDialog. Basic usage is like this:

   KDirOperator op = new KDirOperator( KURL( "file:/home/gis" ), this );
   // some signals you might be interested in
   connect(op, SIGNAL("urlEntered(KURL)"),
           SLOT("urlEntered(KURL)"));
   connect(op, SIGNAL("fileHighlighted(const KFileItem )"),
           SLOT("fileHighlighted(const KFileItem )"));
   connect(op, SIGNAL("fileSelected(const KFileItem )"),
           SLOT("fileSelected(const KFileItem )"));
   connect(op, SIGNAL("finishedLoading()"),
           SLOT("slotLoadingFinished()"));
   op.readConfig( KGlobal.config(), "Your KDiroperator ConfigGroup" );
   op.setView(KFile.Default);
 
This will create a childwidget of 'this' showing the directory contents of /home/gis in the default-view. The view is determined by the readConfig() call, which will read the KDirOperator settings, the user left your program with (and which you saved with op.writeConfig()). See KDirOperatorSignals for signals emitted by KDirOperator

Author:
Stephan Kulow , Carsten Pfeiffer

Field Summary
static int AllActions
           
static int FileActions
           
static int NavActions
           
static int SortActions
          The various action types.
static int ViewActions
           
 
Fields inherited from class org.kde.qt.QWidget
AncestorOrigin, ClickFocus, NoFocus, ParentOrigin, StrongFocus, TabFocus, WheelFocus, WidgetOrigin, WindowOrigin
 
Fields inherited from class org.kde.qt.Qt
AlignAuto, AlignBottom, AlignCenter, AlignHCenter, AlignHorizontal_Mask, AlignJustify, AlignLeft, AlignRight, AlignTop, AlignVCenter, AlignVertical_Mask, AlphaDither_Mask, ALT, AltButton, AnchorHref, AnchorName, AndNotROP, AndROP, ArrowCursor, Ascending, ASCII_ACCEL, AutoColor, AutoDither, AutoText, AvoidDither, BDiagPattern, BeginsWith, BevelJoin, BitmapCursor, BlankCursor, Bottom, BottomLeft, BottomRight, BreakAnywhere, BusyCursor, CaseSensitive, ClearROP, ColorMode_Mask, ColorOnly, Contains, ControlButton, CopyROP, CrossCursor, CrossPattern, CTRL, CustomPattern, DashDotDotLine, DashDotLine, DashLine, Dense1Pattern, Dense2Pattern, Dense3Pattern, Dense4Pattern, Dense5Pattern, Dense6Pattern, Dense7Pattern, Descending, DiagCrossPattern, DiffuseAlphaDither, DiffuseDither, Dither_Mask, DitherMode_Mask, DockBottom, DockLeft, DockMinimized, DockRight, DockTop, DockTornOff, DockUnmanaged, DontClip, DontPrint, DotLine, DownArrow, EndsWith, EraseROP, ExactMatch, ExpandTabs, FDiagPattern, FixedColor, FixedPixmap, FlatCap, ForbiddenCursor, HiEnglishUnit, HiMetricUnit, Horizontal, HorPattern, IbeamCursor, Identical, IncludeTrailingSpaces, ISODate, Key_0, Key_1, Key_2, Key_3, Key_4, Key_5, Key_6, Key_7, Key_8, Key_9, Key_A, Key_aacute, Key_Aacute, Key_acircumflex, Key_Acircumflex, Key_acute, Key_adiaeresis, Key_Adiaeresis, Key_ae, Key_AE, Key_agrave, Key_Agrave, Key_Alt, Key_Ampersand, Key_Any, Key_Apostrophe, Key_aring, Key_Aring, Key_AsciiCircum, Key_AsciiTilde, Key_Asterisk, Key_At, Key_atilde, Key_Atilde, Key_B, Key_Back, Key_Backslash, Key_Backspace, Key_BackSpace, Key_Backtab, Key_BackTab, Key_Bar, Key_BassBoost, Key_BassDown, Key_BassUp, Key_BraceLeft, Key_BraceRight, Key_BracketLeft, Key_BracketRight, Key_brokenbar, Key_C, Key_CapsLock, Key_ccedilla, Key_Ccedilla, Key_cedilla, Key_cent, Key_Clear, Key_Colon, Key_Comma, Key_Control, Key_copyright, Key_currency, Key_D, Key_degree, Key_Delete, Key_diaeresis, Key_Direction_L, Key_Direction_R, Key_division, Key_Dollar, Key_Down, Key_E, Key_eacute, Key_Eacute, Key_ecircumflex, Key_Ecircumflex, Key_ediaeresis, Key_Ediaeresis, Key_egrave, Key_Egrave, Key_End, Key_Enter, Key_Equal, Key_Escape, Key_eth, Key_ETH, Key_Exclam, Key_exclamdown, Key_F, Key_F1, Key_F10, Key_F11, Key_F12, Key_F13, Key_F14, Key_F15, Key_F16, Key_F17, Key_F18, Key_F19, Key_F2, Key_F20, Key_F21, Key_F22, Key_F23, Key_F24, Key_F25, Key_F26, Key_F27, Key_F28, Key_F29, Key_F3, Key_F30, Key_F31, Key_F32, Key_F33, Key_F34, Key_F35, Key_F4, Key_F5, Key_F6, Key_F7, Key_F8, Key_F9, Key_Favorites, Key_Forward, Key_G, Key_Greater, Key_guillemotleft, Key_guillemotright, Key_H, Key_Help, Key_Home, Key_HomePage, Key_Hyper_L, Key_Hyper_R, Key_hyphen, Key_I, Key_iacute, Key_Iacute, Key_icircumflex, Key_Icircumflex, Key_idiaeresis, Key_Idiaeresis, Key_igrave, Key_Igrave, Key_Insert, Key_J, Key_K, Key_L, Key_Launch0, Key_Launch1, Key_Launch2, Key_Launch3, Key_Launch4, Key_Launch5, Key_Launch6, Key_Launch7, Key_Launch8, Key_Launch9, Key_LaunchA, Key_LaunchB, Key_LaunchC, Key_LaunchD, Key_LaunchE, Key_LaunchF, Key_LaunchMail, Key_LaunchMedia, Key_Left, Key_Less, Key_M, Key_macron, Key_masculine, Key_MediaLast, Key_MediaNext, Key_MediaPlay, Key_MediaPrev, Key_MediaRecord, Key_MediaStop, Key_Menu, Key_Meta, Key_Minus, Key_mu, Key_multiply, Key_N, Key_Next, Key_nobreakspace, Key_notsign, Key_ntilde, Key_Ntilde, Key_NumberSign, Key_NumLock, Key_O, Key_oacute, Key_Oacute, Key_ocircumflex, Key_Ocircumflex, Key_odiaeresis, Key_Odiaeresis, Key_ograve, Key_Ograve, Key_onehalf, Key_onequarter, Key_onesuperior, Key_Ooblique, Key_OpenUrl, Key_ordfeminine, Key_oslash, Key_otilde, Key_Otilde, Key_P, Key_PageDown, Key_PageUp, Key_paragraph, Key_ParenLeft, Key_ParenRight, Key_Pause, Key_Percent, Key_Period, Key_periodcentered, Key_Plus, Key_plusminus, Key_Print, Key_Prior, Key_Q, Key_Question, Key_questiondown, Key_QuoteDbl, Key_QuoteLeft, Key_R, Key_Refresh, Key_registered, Key_Return, Key_Right, Key_S, Key_ScrollLock, Key_Search, Key_section, Key_Semicolon, Key_Shift, Key_Slash, Key_Space, Key_ssharp, Key_Standby, Key_sterling, Key_Stop, Key_Super_L, Key_Super_R, Key_SysReq, Key_T, Key_Tab, Key_thorn, Key_THORN, Key_threequarters, Key_threesuperior, Key_TrebleDown, Key_TrebleUp, Key_twosuperior, Key_U, Key_uacute, Key_Uacute, Key_ucircumflex, Key_Ucircumflex, Key_udiaeresis, Key_Udiaeresis, Key_ugrave, Key_Ugrave, Key_Underscore, Key_unknown, Key_Up, Key_V, Key_VolumeDown, Key_VolumeMute, Key_VolumeUp, Key_W, Key_X, Key_Y, Key_yacute, Key_Yacute, Key_ydiaeresis, Key_yen, Key_Z, KeyButtonMask, Keypad, LastCursor, LastROP, Left, LeftArrow, LeftButton, LocalDate, LocalTime, LoEnglishUnit, LogText, LoMetricUnit, MacStyle, META, MetaButton, MidButton, Minimized, MiterJoin, MODIFIER_MASK, MonoOnly, MotifStyle, MouseButtonMask, MPenCapStyle, MPenJoinStyle, MPenStyle, MV_10_DOT_0, MV_10_DOT_1, MV_10_DOT_2, MV_10_DOT_3, MV_10_DOT_4, MV_9, MV_CHEETAH, MV_JAGUAR, MV_PANTHER, MV_PUMA, MV_TIGER, MV_Unknown, NandROP, NoAccel, NoAlpha, NoBackground, NoBrush, NoButton, NoMatch, NoPen, NopROP, NorROP, NotAndROP, NotCopyROP, NotEraseROP, NotOrROP, NotROP, NotXorROP, OpaqueMode, OrderedAlphaDither, OrderedDither, OrNotROP, OrROP, Overline, PaletteBackground, PaletteBase, PaletteBrightText, PaletteButton, PaletteButtonText, PaletteDark, PaletteForeground, PaletteHighlight, PaletteHighlightedText, PaletteLight, PaletteLink, PaletteLinkVisited, PaletteMid, PaletteMidlight, PaletteShadow, PaletteText, PartialMatch, PixelUnit, PlainText, PMStyle, PointingHandCursor, PreferDither, RichText, Right, RightArrow, RightButton, RoundCap, RoundJoin, SetROP, SHIFT, ShiftButton, ShowPrefix, SingleLine, SizeAllCursor, SizeBDiagCursor, SizeFDiagCursor, SizeHorCursor, SizeVerCursor, SolidLine, SolidPattern, SplitHCursor, SplitVCursor, SquareCap, StrikeOut, TextDate, ThresholdAlphaDither, ThresholdDither, Top, TopLeft, TopRight, TornOff, TransparentMode, TwipsUnit, UI_AnimateCombo, UI_AnimateMenu, UI_AnimateToolBox, UI_AnimateTooltip, UI_FadeMenu, UI_FadeTooltip, UI_General, Underline, UNICODE_ACCEL, Unmanaged, UpArrow, UpArrowCursor, UTC, VerPattern, Vertical, WaitCursor, WDestructiveClose, WGroupLeader, WhatsThisCursor, Win3Style, WindowActive, WindowFullScreen, WindowMaximized, WindowMinimized, WindowNoState, WindowsStyle, WMacDrawer, WMacNoSheet, WMouseNoMask, WNoAutoErase, WNoMousePropagation, WNorthWestGravity, WordBreak, WPaintClever, WPaintDesktop, WPaintUnclipped, WRepaintNoErase, WResizeNoErase, WShowModal, WState_AutoMask, WState_BlockUpdates, WState_CompressKeys, WState_ConfigPending, WState_Created, WState_CreatedHidden, WState_Disabled, WState_DND, WState_Exposed, WState_ForceDisabled, WState_ForceHide, WState_FullScreen, WState_HasMouse, WState_InPaintEvent, WState_Maximized, WState_Minimized, WState_MouseTracking, WState_OwnCursor, WState_OwnSizePolicy, WState_Polished, WState_Reparented, WState_Reserved0, WState_Resized, WState_Visible, WStaticContents, WStyle_ContextHelp, WStyle_Customize, WStyle_Dialog, WStyle_DialogBorder, WStyle_Mask, WStyle_Maximize, WStyle_Minimize, WStyle_MinMax, WStyle_NoBorder, WStyle_NoBorderEx, WStyle_NormalBorder, WStyle_Reserved, WStyle_Splash, WStyle_StaysOnTop, WStyle_SysMenu, WStyle_Title, WStyle_Tool, WSubWindow, WType_Desktop, WType_Dialog, WType_Mask, WType_Modal, WType_Popup, WType_TopLevel, WV_2000, WV_2003, WV_32s, WV_95, WV_98, WV_CE, WV_CE_based, WV_CENET, WV_DOS_based, WV_Me, WV_NT, WV_NT_based, WV_XP, WWinOwnDC, WX11BypassWM, X11ParentRelative, XorROP
 
Constructor Summary
  KDirOperator()
           
protected KDirOperator(java.lang.Class dummy)
           
  KDirOperator(KURL urlName)
           
  KDirOperator(KURL urlName, org.kde.qt.QWidget parent)
           
  KDirOperator(KURL urlName, org.kde.qt.QWidget parent, java.lang.String name)
          Constructs the KDirOperator with no initial view.
 
Method Summary
 KActionCollection actionCollection()
          an accessor to a collection of all available Actions.
protected  void activatedMenu(KFileItem arg1, org.kde.qt.QPoint pos)
          Called upon right-click to activate the popupmenu.
 void back()
          Goes one step back in the history and opens that url.
 void cdUp()
          Goes one directory up from the current url.
protected  boolean checkPreviewSupport()
          Checks if there support from KIO.PreviewJob for the currently shown files, taking mimeFilter() and nameFilter() into account Enables/disables the preview-action accordingly.
 java.lang.String className()
           
 void clearFilter()
          Clears both the namefilter and mimetype filter, so that all files and directories will be shown.
 void clearHistory()
          Clears the forward and backward history.
 boolean close(boolean alsoDelete)
           
 void closeLoading()
          Stops loading immediately.
 KCompletion completionObject()
           
protected  KFileViewInterface createView(org.kde.qt.QWidget parent, int view)
          A view factory for creating predefined fileviews.
 DeleteJob del(java.util.ArrayList items)
           
 DeleteJob del(java.util.ArrayList items, boolean ask)
           
 DeleteJob del(java.util.ArrayList items, boolean ask, boolean showProgress)
          Starts and returns a KIO.DeleteJob to delete the given items.
 DeleteJob del(java.util.ArrayList items, org.kde.qt.QWidget parent)
           
 DeleteJob del(java.util.ArrayList items, org.kde.qt.QWidget parent, boolean ask)
           
 DeleteJob del(java.util.ArrayList items, org.kde.qt.QWidget parent, boolean ask, boolean showProgress)
          Starts and returns a KIO.DeleteJob to delete the given items.
 void deleteSelected()
          Deletes the currently selected files/directories.
 KCompletion dirCompletionObject()
           
 boolean dirHighlighting()
          Default is false.
 KDirLister dirLister()
           
 boolean dirOnlyMode()
           
static boolean dirOnlyMode(int mode)
           
 void dispose()
          Delete the wrapped C++ instance ahead of finalize()
protected  void finalize()
          Deletes the wrapped C++ instance
 void forward()
          Goes one step forward in the history and opens that url.
protected  void highlightFile(KFileItem i)
          Emits fileHighlighted( i )
 void home()
          Enters the home directory.
protected  void insertNewFiles(java.util.ArrayList newone)
          Adds a new list of KFileItems to the view (coming from KDirLister)
 boolean isDisposed()
          Has the wrapped C++ instance been deleted?
 boolean isRoot()
           
 boolean isSelected(KFileItem item)
           
protected  void itemDeleted(KFileItem arg1)
          Removes the given KFileItem item from the view (usually called from KDirLister).
 java.lang.String makeCompletion(java.lang.String arg1)
          Tries to complete the given string (only completes files).
 java.lang.String makeDirCompletion(java.lang.String arg1)
          Tries to complete the given string (only completes directores).
 org.kde.qt.QMetaObject metaObject()
           
 java.util.ArrayList mimeFilter()
           
 void mkdir()
          Opens a dialog to create a new directory.
 boolean mkdir(java.lang.String directory)
           
 boolean mkdir(java.lang.String directory, boolean enterDirectory)
          Creates the given directory/url.
 int mode()
           
 java.lang.String nameFilter()
           
 int numDirs()
           
 int numFiles()
           
 boolean onlyDoubleClickSelectsFiles()
           
protected  void pathChanged()
          Called after setURL() to load the directory, update the history, etc.
protected  void prepareCompletionObjects()
          Synchronizes the completion objects with the entries of the currently listed url.
 KProgress progressBar()
           
 void readConfig(KConfig arg1)
           
 void readConfig(KConfig arg1, java.lang.String group)
          Reads the default settings for a view, i.e.
 void rereadDir()
          Re-reads the current url.
protected  void resetCursor()
          Restores the normal cursor after showing the busy-cursor.
protected  void resizeEvent(org.kde.qt.QResizeEvent arg1)
           
protected  void selectDir(KFileItem item)
          Enters the directory specified by the given item.
 java.util.ArrayList selectedItems()
           
protected  void selectFile(KFileItem item)
          Emits fileSelected( item )
 void setAcceptDrops(boolean b)
          Reimplemented - allow dropping of files if b is true
 void setCurrentItem(java.lang.String filename)
          Clears the current selection and attempts to set filename the current file.
protected  void setDirLister(KDirLister lister)
          Sets a custom KDirLister to list directories.
 void setDropOptions(int options)
          Sets the options for dropping files.
 void setEnableDirHighlighting(boolean enable)
          When going up in the directory hierarchy, KDirOperator can highlight the directory that was just left.
 void setMimeFilter(java.lang.String[] mimetypes)
          Sets a list of mimetypes as filter.
 void setMode(int m)
          Sets the listing/selection mode for the views, an OR'ed combination of File Directory Files ExistingOnly LocalOnly You cannot mix File and Files of course, as the former means single-selection mode, the latter multi-selection.
 void setNameFilter(java.lang.String filter)
          Sets a filter like "*.cpp .h .o".
 void setOnlyDoubleClickSelectsFiles(boolean enable)
          This is a KFileDialog specific hack: we want to select directories with single click, but not files.
 void setPreviewWidget(org.kde.qt.QWidget w)
          Sets a preview-widget to be shown next to the file-view.
 void setShowHiddenFiles(boolean s)
          Enables/disables showing hidden files.
 void setSorting(int arg1)
          Sets the way to sort files and directories.
protected  void setupActions()
          Sets up all the actions.
protected  void setupMenu()
          Sets up the context-menu with all the necessary actions.
 void setupMenu(int whichActions)
          Sets up the action menu.
 void setURL(KURL url, boolean clearforward)
          Sets a new url to list.
 void setView(int view)
          Sets one of the predefined fileviews
 void setView(KFileViewInterface view)
          Sets a new KFileView to be used for showing and browsing files.
 void setViewConfig(KConfig config, java.lang.String group)
          Sets the config object and the to be used group in KDirOperator.
 boolean showHiddenFiles()
           
protected  void slotCompletionMatch(java.lang.String match)
          Tries to make the given match as current item in the view and emits completion( match )
protected  void sortByDate()
          Changes sorting to sort by date
protected  void sortByName()
          Changes sorting to sort by name
protected  void sortBySize()
          Changes sorting to sort by size
 int sorting()
           
protected  void sortReversed()
          Changes sorting to reverse sorting
protected  void toggleDirsFirst()
          Toggles showing directories first / having them sorted like files.
protected  void toggleIgnoreCase()
          Toggles case sensitive / case insensitive sorting
 CopyJob trash(java.util.ArrayList items, org.kde.qt.QWidget parent)
           
 CopyJob trash(java.util.ArrayList items, org.kde.qt.QWidget parent, boolean ask)
           
 CopyJob trash(java.util.ArrayList items, org.kde.qt.QWidget parent, boolean ask, boolean showProgress)
          Starts and returns a KIO.CopyJob to trash the given items.
 void trashSelected(int arg1, int arg2)
          Trashes the currently selected files/directories.
 void updateDir()
          to update the view after changing the settings
 void updateSelectionDependentActions()
          Enables/disables actions that are selection dependent.
protected  void updateSortActions()
          Updates the sorting-related actions to comply with the current sorting
protected  void updateViewActions()
          Updates the view-related actions to comply with the current KFile.FileView
 KURL url()
           
 KFileViewInterface view()
           
 KConfig viewConfig()
          Returns the KConfig object used for saving and restoring view's configuration.
 java.lang.String viewConfigGroup()
          Returns the group name used for saving and restoring view's configuration.
 org.kde.qt.QWidget viewWidget()
          Returns the widget of the current view.
 void writeConfig(KConfig arg1)
           
 void writeConfig(KConfig arg1, java.lang.String group)
          Saves the current settings like sorting, simple or detailed view.
 
Methods inherited from class org.kde.qt.QWidget
acceptDrops, adjustSize, autoMask, backgroundBrush, backgroundColor, backgroundMode, backgroundOffset, backgroundOrigin, backgroundPixmap, baseSize, caption, childAt, childAt, childAt, childAt, childrenRect, childrenRegion, clearFocus, clearMask, clearWFlags, clearWState, clipRegion, close, closeEvent, colorGroup, constPolish, contextMenuEvent, create, create, create, create, cursor, customWhatsThis, destroy, destroy, destroy, devType, dragEnterEvent, dragLeaveEvent, dragMoveEvent, drawText, drawText, dropEvent, enabledChange, enterEvent, erase, erase, erase, erase, eraseColor, erasePixmap, event, find, focusData, focusInEvent, focusNextPrevChild, focusOutEvent, focusPolicy, focusProxy, focusWidget, font, fontChange, fontInf, fontInfo, fontMet, fontMet, fontMet, fontMetrics, foregroundColor, frameGeometry, frameSize, geometry, getWFlags, getWState, grabKeyboard, grabMouse, grabMouse, hasFocus, hasMouse, hasMouseTracking, height, heightForWidth, hide, hideEvent, icon, iconify, iconText, imComposeEvent, imEndEvent, imStartEvent, isActiveWindow, isDesktop, isDialog, isEnabled, isEnabledTo, isEnabledToTLW, isExtDev, isFocusEnabled, isFullScreen, isHidden, isInputMethodEnabled, isMaximized, isMinimized, isModal, isPopup, isShown, isTopLevel, isUpdatesEnabled, isVisible, isVisibleTo, isVisibleToTLW, keyboardGrabber, keyPressEvent, keyReleaseEvent, layout, leaveEvent, lower, mapFrom, mapFromGlobal, mapFromParent, mapTo, mapToGlobal, mapToParent, maximumHeight, maximumSize, maximumWidth, metric, microFocusHint, minimumHeight, minimumSize, minimumSizeHint, minimumWidth, mouseDoubleClickEvent, mouseGrabber, mouseMoveEvent, mousePressEvent, mouseReleaseEvent, move, move, moveEvent, ownCursor, ownFont, ownPalette, paintDevice, paintEvent, paintingActive, palette, paletteBackgroundColor, paletteBackgroundPixmap, paletteChange, paletteForegroundColor, parentWidget, parentWidget, polish, pos, raise, recreate, recreate, rect, releaseKeyboard, releaseMouse, repaint, repaint, repaint, repaint, repaint, repaint, repaint, repaint, reparent, reparent, reparent, reparent, resetInputContext, resize, resize, resolution, scroll, scroll, setActiveWindow, setAutoMask, setBackgroundColor, setBackgroundMode, setBackgroundMode, setBackgroundOrigin, setBackgroundPixmap, setBaseSize, setBaseSize, setCaption, setCursor, setDisabled, setEnabled, setEraseColor, setErasePixmap, setFixedHeight, setFixedSize, setFixedSize, setFixedWidth, setFocus, setFocusPolicy, setFocusProxy, setFont, setFont, setGeometry, setGeometry, setHidden, setIcon, setIconText, setInputMethodEnabled, setKeyCompression, setMask, setMask, setMaximumHeight, setMaximumSize, setMaximumSize, setMaximumWidth, setMicroFocusHint, setMicroFocusHint, setMicroFocusHint, setMinimumHeight, setMinimumSize, setMinimumSize, setMinimumWidth, setMouseTracking, setName, setPalette, setPalette, setPaletteBackgroundColor, setPaletteBackgroundPixmap, setPaletteForegroundColor, setResolution, setShown, setSizeIncrement, setSizeIncrement, setSizePolicy, setSizePolicy, setSizePolicy, setStyle, setStyle, setTabOrder, setUpdatesEnabled, setWFlags, setWindowOpacity, setWindowState, setWState, show, showEvent, showFullScreen, showMaximized, showMinimized, showNormal, size, sizeHint, sizeIncrement, sizePolicy, stackUnder, style, styleChange, tabletEvent, testWFlags, testWState, topLevelWidget, tr, tr, unsetCursor, unsetFont, unsetPalette, update, update, update, updateGeometry, updateMask, visibleRect, wheelEvent, width, windowActivationChange, windowOpacity, windowState, winId, x, y
 
Methods inherited from class org.kde.qt.QObject
activate_filters, activate_signal_bool, activate_signal, activate_signal, activate_signal, activate_signal, blockSignals, checkConnectArgs, child, child, child, childEvent, children, connect, connect, connectInternal, connectNotify, customEvent, deleteLater, disconnect, disconnect, disconnect, disconnect, disconnect, disconnect, disconnect, disconnectInternal, disconnectNotify, dumpObjectInfo, dumpObjectTree, emit, emit, emit, emit, emit, emit, emit, emit, emit, emit, emit, emit, emit, emit, emit, emit, emit, emit, emit, emit, emit, emit, eventFilter, highPriority, i18n, inherits, insertChild, installEventFilter, isA, isWidgetType, killTimer, killTimers, name, name, normalizeSignalSlot, objectTrees, parent, property, queryList, queryList, queryList, queryList, queryList, registerUserData, removeChild, removeEventFilter, sender, setProperty, signalsBlocked, startTimer, timerEvent
 
Methods inherited from class org.kde.qt.Qt
arrowCursor, bin, bitBlt, bitBlt, bitBlt, bitBlt, bitBlt, bitBlt, bitBlt, bitBlt, bitBlt, bitBlt, bitBlt, bitBlt, bitBlt, bitBlt, bitBlt, bitBlt, bitBlt, bitBlt, bitBlt, bitBlt, bitBlt, bitBlt, bitBlt, black, blankCursor, blue, color0, color1, copyBlt, copyBlt, copyBlt, copyBlt, copyBlt, crossCursor, cyan, darkBlue, darkCyan, darkGray, darkGreen, darkMagenta, darkRed, darkYellow, dec, dynamicCast, endl, flush, forbiddenCursor, fromUtf8, gray, green, hex, ibeamCursor, lightGray, magenta, oct, op_div, op_div, op_div, op_div, op_equals, op_equals, op_equals, op_equals, op_minus, op_minus, op_minus, op_mult, op_mult, op_mult, op_mult, op_mult, op_mult, op_mult, op_mult, op_mult, op_not_equals, op_not_equals, op_not_equals, op_not_equals, op_plus, op_plus, op_read, op_read, op_read, op_read, op_read, op_read, op_read, op_read, op_read, op_read, op_read, op_read, op_read, op_read, op_read, op_read, op_read, op_read, op_read, op_read, op_read, op_read, op_read, op_read, op_read, op_read, op_write, op_write, op_write, op_write, op_write, op_write, op_write, op_write, op_write, op_write, op_write, op_write, op_write, op_write, op_write, op_write, op_write, op_write, op_write, op_write, op_write, op_write, op_write, op_write, op_write, op_write, op_write, pointingHandCursor, qAlpha, qApp, qAppName, qBlue, qCompress, qCompress, qDebug, qDebug, qDrawArrow, qDrawItem, qDrawItem, qDrawItem, qDrawPlainRect, qDrawPlainRect, qDrawPlainRect, qDrawPlainRect, qDrawPlainRect, qDrawPlainRect, qDrawShadeLine, qDrawShadeLine, qDrawShadeLine, qDrawShadeLine, qDrawShadeLine, qDrawShadeLine, qDrawShadeLine, qDrawShadeLine, qDrawShadePanel, qDrawShadePanel, qDrawShadePanel, qDrawShadePanel, qDrawShadePanel, qDrawShadePanel, qDrawShadePanel, qDrawShadePanel, qDrawShadeRect, qDrawShadeRect, qDrawShadeRect, qDrawShadeRect, qDrawShadeRect, qDrawShadeRect, qDrawShadeRect, qDrawShadeRect, qDrawShadeRect, qDrawShadeRect, qDrawWinButton, qDrawWinButton, qDrawWinButton, qDrawWinButton, qDrawWinButton, qDrawWinButton, qDrawWinPanel, qDrawWinPanel, qDrawWinPanel, qDrawWinPanel, qDrawWinPanel, qDrawWinPanel, qFatal, qFatal, qGLVersion, qGray, qGray, qGreen, qInitNetworkProtocols, qInstallPath, qInstallPathBins, qInstallPathData, qInstallPathDocs, qInstallPathHeaders, qInstallPathLibs, qInstallPathPlugins, qInstallPathSysconf, qInstallPathTranslations, qItemRect, qItemRect, qObsolete, qObsolete, qObsolete, qRed, qRgb, qRgba, qRound, qSharedBuild, qSuppressObsoleteWarnings, qSuppressObsoleteWarnings, qSysInfo, qSystemWarning, qSystemWarning, qUncompress, qUncompress, qVersion, qWarning, qWarning, red, reset, SIGNAL, sizeAllCursor, sizeBDiagCursor, sizeFDiagCursor, sizeHorCursor, sizeVerCursor, SLOT, splitHCursor, splitVCursor, upArrowCursor, waitCursor, whatsThisCursor, white, ws, yellow
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SortActions

public static final int SortActions
The various action types. These values can be or'd together

See Also:
Constant Field Values

ViewActions

public static final int ViewActions
See Also:
Constant Field Values

NavActions

public static final int NavActions
See Also:
Constant Field Values

FileActions

public static final int FileActions
See Also:
Constant Field Values

AllActions

public static final int AllActions
See Also:
Constant Field Values
Constructor Detail

KDirOperator

protected KDirOperator(java.lang.Class dummy)

KDirOperator

public KDirOperator(KURL urlName,
                    org.kde.qt.QWidget parent,
                    java.lang.String name)
Constructs the KDirOperator with no initial view. As the views are configurable, call readConfig() to load the user's configuration and then setView to explicitly set a view. This constructor doesn't start loading the url, setView will do it.


KDirOperator

public KDirOperator(KURL urlName,
                    org.kde.qt.QWidget parent)

KDirOperator

public KDirOperator(KURL urlName)

KDirOperator

public KDirOperator()
Method Detail

metaObject

public org.kde.qt.QMetaObject metaObject()
Overrides:
metaObject in class org.kde.qt.QWidget

className

public java.lang.String className()
Overrides:
className in class org.kde.qt.QWidget

setShowHiddenFiles

public void setShowHiddenFiles(boolean s)
Enables/disables showing hidden files.


showHiddenFiles

public boolean showHiddenFiles()
Returns:
true when hidden files are shown or false otherwise.

closeLoading

public void closeLoading()
Stops loading immediately. You don't need to call this, usually.


close

public boolean close(boolean alsoDelete)
Overrides:
close in class org.kde.qt.QWidget

setNameFilter

public void setNameFilter(java.lang.String filter)
Sets a filter like "*.cpp .h .o". Only files matching that filter will be shown. Call updateDir() to apply it.

See Also:
KDirLister.setNameFilter(java.lang.String), nameFilter()

nameFilter

public java.lang.String nameFilter()
Returns:
the current namefilter.
See Also:
setNameFilter(java.lang.String)

setMimeFilter

public void setMimeFilter(java.lang.String[] mimetypes)
Sets a list of mimetypes as filter. Only files of those mimetypes will be shown. Example:
                 ArrayList filter;
                 filter << "text/html" << "image/png" << "inode/directory";
                 dirOperator.setMimefilter( filter );
                 
Node: Without the mimetype inode/directory, only files would be shown. Call updateDir() to apply it.

See Also:
KDirLister.setMimeFilter(java.lang.String[]), mimeFilter()

mimeFilter

public java.util.ArrayList mimeFilter()
Returns:
the current mime filter.

clearFilter

public void clearFilter()
Clears both the namefilter and mimetype filter, so that all files and directories will be shown. Call updateDir() to apply it.

See Also:
setMimeFilter(java.lang.String[]), setNameFilter(java.lang.String)

url

public KURL url()
Returns:
the current url

setURL

public void setURL(KURL url,
                   boolean clearforward)
Sets a new url to list.

Parameters:
clearforward - specifies whether the "forward" history should be cleared.
url - the URL to set

setCurrentItem

public void setCurrentItem(java.lang.String filename)
Clears the current selection and attempts to set filename the current file. filename is just the name, no path or url.


setView

public void setView(KFileViewInterface view)
Sets a new KFileView to be used for showing and browsing files. Note: this will read the current url() to fill the view.

See Also:
KFileView, KFileIconView, KFileDetailView, KCombiView, view()

view

public KFileViewInterface view()
Returns:
the currently used view.
See Also:
setView(org.kde.koala.KFileViewInterface)

viewWidget

public org.kde.qt.QWidget viewWidget()
Returns the widget of the current view. null if there is no view/widget. (KFileView itself is not a widget.)


setView

public void setView(int view)
Sets one of the predefined fileviews

See Also:
KFile#FileView

setSorting

public void setSorting(int arg1)
Sets the way to sort files and directories.


sorting

public int sorting()
Returns:
the current way of sorting files and directories

isRoot

public boolean isRoot()
Returns:
true if we are displaying the root directory of the current url

dirLister

public KDirLister dirLister()
Returns:
the object listing the directory

progressBar

public KProgress progressBar()
Returns:
the progress widget, that is shown during directory listing. You can for example reparent() it to put it into a statusbar.

setMode

public void setMode(int m)
Sets the listing/selection mode for the views, an OR'ed combination of
  • File
  • Directory
  • Files
  • ExistingOnly
  • LocalOnly
  • You cannot mix File and Files of course, as the former means single-selection mode, the latter multi-selection.


    mode

    public int mode()
    Returns:
    the listing/selection mode.

    setPreviewWidget

    public void setPreviewWidget(org.kde.qt.QWidget w)
    Sets a preview-widget to be shown next to the file-view. The ownership of w is transferred to KDirOperator, so don't delete it yourself!


    selectedItems

    public java.util.ArrayList selectedItems()
    Returns:
    a list of all currently selected items. If there is no view, then 0L is returned.

    isSelected

    public boolean isSelected(KFileItem item)
    Returns:
    true if item is currently selected, or false otherwise.

    numDirs

    public int numDirs()
    Returns:
    the number of directories in the currently listed url. Returns 0 if there is no view.

    numFiles

    public int numFiles()
    Returns:
    the number of files in the currently listed url. Returns 0 if there is no view.

    completionObject

    public KCompletion completionObject()
    Returns:
    a KCompletion object, containing all filenames and directories of the current directory/URL. You can use it to insert it into a KLineEdit or KComboBox Note: it will only contain files, after prepareCompletionObjects() has been called. It will be implicitly called from makeCompletion() or makeDirCompletion()

    dirCompletionObject

    public KCompletion dirCompletionObject()
    Returns:
    a KCompletion object, containing only all directories of the current directory/URL. You can use it to insert it into a KLineEdit or KComboBox Note: it will only contain directories, after prepareCompletionObjects() has been called. It will be implicitly called from makeCompletion() or makeDirCompletion()

    actionCollection

    public KActionCollection actionCollection()
    an accessor to a collection of all available Actions. The actions are static, they will be there all the time (no need to connect to the signals KActionCollection.inserted() or removed(). There are the following actions:
  • popupMenu : an ActionMenu presenting a popupmenu with all actions
  • up : changes to the parent directory
  • back : goes back to the previous directory
  • forward : goes forward in the history
  • home : changes to the user's home directory
  • reload : reloads the current directory
  • separator : a separator
  • mkdir : opens a dialog box to create a directory
  • delete : deletes the selected files/directories
  • sorting menu : an ActionMenu containing all sort-options
  • by name : sorts by name
  • by date : sorts by date
  • by size : sorts by size
  • reversed : reverses the sort order
  • dirs first : sorts directories before files
  • case insensitive : sorts case insensitively
  • view menu : an ActionMenu containing all actions concerning the view
  • short view : shows a simple fileview
  • detailed view : shows a detailed fileview (dates, permissions ,...)
  • show hidden : shows hidden files
  • separate dirs : shows directories in a separate pane
  • preview : shows a preview next to the fileview
  • single : hides the separate view for directories or the preview
  • properties : shows a KPropertiesDialog for the selected files
  • The short and detailed view are in an exclusive group. The sort-by actions are in an exclusive group as well. Also the "separate dirs", "preview" and "single" actions are in an exclusive group. You can e.g. use
                     actionCollection().action( "up" ).plug( someToolBar );
                     
    to add a button into a toolbar, which makes the dirOperator change to its parent directory.

    Returns:
    all available Actions

    setViewConfig

    public void setViewConfig(KConfig config,
                              java.lang.String group)
    Sets the config object and the to be used group in KDirOperator. This will be used to store the view's configuration via KFileView.writeConfig() (and for KFileView.readConfig()). If you don't set this, the views cannot save and restore their configuration. Usually you call this right after KDirOperator creation so that the view instantiation can make use of it already. Note that KDirOperator does NOT take ownership of that object (typically it's KGlobal.config() anyway.

    See Also:
    viewConfig(), viewConfigGroup()

    viewConfig

    public KConfig viewConfig()
    Returns the KConfig object used for saving and restoring view's configuration.

    Returns:
    the KConfig object used for saving and restoring view's configuration.

    viewConfigGroup

    public java.lang.String viewConfigGroup()
    Returns the group name used for saving and restoring view's configuration.

    Returns:
    the group name used for saving and restoring view's configuration.

    readConfig

    public void readConfig(KConfig arg1,
                           java.lang.String group)
    Reads the default settings for a view, i.e. the default KFile.FileView. Also reads the sorting and whether hidden files should be shown. Note: the default view will not be set - you have to call
                     setView( KFile.Default )
                     
    to apply it.

    See Also:
    setView(org.kde.koala.KFileViewInterface), setViewConfig(org.kde.koala.KConfig, java.lang.String), writeConfig(org.kde.koala.KConfig, java.lang.String)

    readConfig

    public void readConfig(KConfig arg1)

    writeConfig

    public void writeConfig(KConfig arg1,
                            java.lang.String group)
    Saves the current settings like sorting, simple or detailed view.

    See Also:
    readConfig(org.kde.koala.KConfig, java.lang.String), setViewConfig(org.kde.koala.KConfig, java.lang.String)

    writeConfig

    public void writeConfig(KConfig arg1)

    setOnlyDoubleClickSelectsFiles

    public void setOnlyDoubleClickSelectsFiles(boolean enable)
    This is a KFileDialog specific hack: we want to select directories with single click, but not files. But as a generic class, we have to be able to select files on single click as well. This gives us the opportunity to do both. The default is false, set it to true if you don't want files selected with single click.


    onlyDoubleClickSelectsFiles

    public boolean onlyDoubleClickSelectsFiles()
    Returns:
    whether files (not directories) should only be select()ed by double-clicks.
    See Also:
    setOnlyDoubleClickSelectsFiles(boolean)

    mkdir

    public boolean mkdir(java.lang.String directory,
                         boolean enterDirectory)
    Creates the given directory/url. If it is a relative path, it will be completed with the current directory. If enterDirectory is true, the directory will be entered after a successful operation. If unsuccessful, a messagebox will be presented to the user.

    Returns:
    true if the directory could be created.

    mkdir

    public boolean mkdir(java.lang.String directory)

    del

    public DeleteJob del(java.util.ArrayList items,
                         boolean ask,
                         boolean showProgress)
    Starts and returns a KIO.DeleteJob to delete the given items.

    Parameters:
    items - the list of items to be deleted
    ask - specifies whether a confirmation dialog should be shown
    showProgress - passed to the DeleteJob to show a progress dialog

    del

    public DeleteJob del(java.util.ArrayList items,
                         boolean ask)

    del

    public DeleteJob del(java.util.ArrayList items)

    del

    public DeleteJob del(java.util.ArrayList items,
                         org.kde.qt.QWidget parent,
                         boolean ask,
                         boolean showProgress)
    Starts and returns a KIO.DeleteJob to delete the given items.

    Parameters:
    items - the list of items to be deleted
    parent - the parent widget used for the confirmation dialog
    ask - specifies whether a confirmation dialog should be shown
    showProgress - passed to the DeleteJob to show a progress dialog

    del

    public DeleteJob del(java.util.ArrayList items,
                         org.kde.qt.QWidget parent,
                         boolean ask)

    del

    public DeleteJob del(java.util.ArrayList items,
                         org.kde.qt.QWidget parent)

    clearHistory

    public void clearHistory()
    Clears the forward and backward history.


    setEnableDirHighlighting

    public void setEnableDirHighlighting(boolean enable)
    When going up in the directory hierarchy, KDirOperator can highlight the directory that was just left. I.e. when you go from /home/gis/src to /home/gis, the item "src" will be made the current item. Default is off.


    dirHighlighting

    public boolean dirHighlighting()
    Default is false.

    Returns:
    whether the last directory will be made the current item when going up in the directory hierarchy.

    dirOnlyMode

    public boolean dirOnlyMode()
    Returns:
    true if we are in directory-only mode, that is, no files are shown.

    setupMenu

    public void setupMenu(int whichActions)
    Sets up the action menu.

    Parameters:
    whichActions - is an value of OR'd ActionTypes that controls which actions to show in the action menu

    setAcceptDrops

    public void setAcceptDrops(boolean b)
    Reimplemented - allow dropping of files if b is true

    Overrides:
    setAcceptDrops in class org.kde.qt.QWidget
    Parameters:
    b - true if the widget should allow dropping of files

    setDropOptions

    public void setDropOptions(int options)
    Sets the options for dropping files.

    See Also:
    KFileView#DropOptions

    trash

    public CopyJob trash(java.util.ArrayList items,
                         org.kde.qt.QWidget parent,
                         boolean ask,
                         boolean showProgress)
    Starts and returns a KIO.CopyJob to trash the given items.

    Parameters:
    items - the list of items to be trashed
    parent - the parent widget used for the confirmation dialog
    ask - specifies whether a confirmation dialog should be shown
    showProgress - passed to the CopyJob to show a progress dialog

    trash

    public CopyJob trash(java.util.ArrayList items,
                         org.kde.qt.QWidget parent,
                         boolean ask)

    trash

    public CopyJob trash(java.util.ArrayList items,
                         org.kde.qt.QWidget parent)

    back

    public void back()
    Goes one step back in the history and opens that url.


    forward

    public void forward()
    Goes one step forward in the history and opens that url.


    home

    public void home()
    Enters the home directory.


    cdUp

    public void cdUp()
    Goes one directory up from the current url.


    updateDir

    public void updateDir()
    to update the view after changing the settings


    rereadDir

    public void rereadDir()
    Re-reads the current url.


    mkdir

    public void mkdir()
    Opens a dialog to create a new directory.


    deleteSelected

    public void deleteSelected()
    Deletes the currently selected files/directories.


    updateSelectionDependentActions

    public void updateSelectionDependentActions()
    Enables/disables actions that are selection dependent. Call this e.g. when you are about to show a popup menu using some of KDirOperators actions.


    makeCompletion

    public java.lang.String makeCompletion(java.lang.String arg1)
    Tries to complete the given string (only completes files).


    makeDirCompletion

    public java.lang.String makeDirCompletion(java.lang.String arg1)
    Tries to complete the given string (only completes directores).


    trashSelected

    public void trashSelected(int arg1,
                              int arg2)
    Trashes the currently selected files/directories.


    dirOnlyMode

    public static boolean dirOnlyMode(int mode)

    createView

    protected KFileViewInterface createView(org.kde.qt.QWidget parent,
                                            int view)
    A view factory for creating predefined fileviews. Called internally by setView , but you can also call it directly. Reimplement this if you depend on self defined fileviews.

    Parameters:
    parent - is the QWidget to be set as parent
    view - is the predefined view to be set, note: this can be several ones OR:ed together.
    Returns:
    the created KFileView
    See Also:
    KFileView, KCombiView, KFileDetailView, KFileIconView, KFilePreview, KFile#FileView, setView(org.kde.koala.KFileViewInterface)

    setDirLister

    protected void setDirLister(KDirLister lister)
    Sets a custom KDirLister to list directories.


    resizeEvent

    protected void resizeEvent(org.kde.qt.QResizeEvent arg1)
    Overrides:
    resizeEvent in class org.kde.qt.QWidget

    setupActions

    protected void setupActions()
    Sets up all the actions. Called from the constructor, you usually better not call this.


    updateSortActions

    protected void updateSortActions()
    Updates the sorting-related actions to comply with the current sorting

    See Also:
    sorting()

    updateViewActions

    protected void updateViewActions()
    Updates the view-related actions to comply with the current KFile.FileView


    setupMenu

    protected void setupMenu()
    Sets up the context-menu with all the necessary actions. Called from the constructor, you usually don't need to call this.


    prepareCompletionObjects

    protected void prepareCompletionObjects()
    Synchronizes the completion objects with the entries of the currently listed url. Automatically called from makeCompletion() and makeDirCompletion()


    checkPreviewSupport

    protected boolean checkPreviewSupport()
    Checks if there support from KIO.PreviewJob for the currently shown files, taking mimeFilter() and nameFilter() into account Enables/disables the preview-action accordingly.


    resetCursor

    protected void resetCursor()
    Restores the normal cursor after showing the busy-cursor. Also hides the progressbar.


    pathChanged

    protected void pathChanged()
    Called after setURL() to load the directory, update the history, etc.


    insertNewFiles

    protected void insertNewFiles(java.util.ArrayList newone)
    Adds a new list of KFileItems to the view (coming from KDirLister)


    itemDeleted

    protected void itemDeleted(KFileItem arg1)
    Removes the given KFileItem item from the view (usually called from KDirLister).


    selectDir

    protected void selectDir(KFileItem item)
    Enters the directory specified by the given item.


    selectFile

    protected void selectFile(KFileItem item)
    Emits fileSelected( item )


    highlightFile

    protected void highlightFile(KFileItem i)
    Emits fileHighlighted( i )


    activatedMenu

    protected void activatedMenu(KFileItem arg1,
                                 org.kde.qt.QPoint pos)
    Called upon right-click to activate the popupmenu.


    sortByName

    protected void sortByName()
    Changes sorting to sort by name


    sortBySize

    protected void sortBySize()
    Changes sorting to sort by size


    sortByDate

    protected void sortByDate()
    Changes sorting to sort by date


    sortReversed

    protected void sortReversed()
    Changes sorting to reverse sorting


    toggleDirsFirst

    protected void toggleDirsFirst()
    Toggles showing directories first / having them sorted like files.


    toggleIgnoreCase

    protected void toggleIgnoreCase()
    Toggles case sensitive / case insensitive sorting


    slotCompletionMatch

    protected void slotCompletionMatch(java.lang.String match)
    Tries to make the given match as current item in the view and emits completion( match )


    finalize

    protected void finalize()
                     throws java.lang.InternalError
    Deletes the wrapped C++ instance

    Overrides:
    finalize in class org.kde.qt.QWidget
    Throws:
    java.lang.InternalError

    dispose

    public void dispose()
    Delete the wrapped C++ instance ahead of finalize()

    Overrides:
    dispose in class org.kde.qt.QWidget

    isDisposed

    public boolean isDisposed()
    Has the wrapped C++ instance been deleted?

    Overrides:
    isDisposed in class org.kde.qt.QWidget