KDevelop API Documentation

JavaSupportPart Class Reference

This is Java language support plugin. More...

#include <javasupportpart.h>

Inheritance diagram for JavaSupportPart:

Inheritance graph
[legend]
Collaboration diagram for JavaSupportPart:

Collaboration graph
[legend]
List of all members.

Signals

void fileParsed (const QString &fileName)

Public Member Functions

 JavaSupportPart (QObject *parent, const char *name, const QStringList &args)
virtual ~JavaSupportPart ()
bool isValid () const
ProblemReporter * problemReporter ()
BackgroundParser * backgroundParser ()
const QPtrList< Catalog > & catalogList ()
bool isValidSource (const QString &fileName) const
QStringList fileExtensions () const
virtual void customEvent (QCustomEvent *ev)
virtual QStringList subclassWidget (const QString &formName)
 Opens an "Subclass Widget" dialog for given Qt .ui file (formName) and propmts to implement it's slots.
virtual QStringList updateWidget (const QString &formName, const QString &fileName)
 Opens and "Update Widget" dialog for given Qt .ui file (formName) and prompts to add missing slot implementations in the subclass located in fileName.
KTextEditor::Document * findDocument (const KURL &url)
virtual QString formatTag (const Tag &tag)
 Formats a Tag as used by the class store to the human-readable convention.
virtual QString formatModelItem (const CodeModelItem *item, bool shortDescription=false)
 Formats a CodeModelItem as used by the CodeModel to the human-readable convention.
virtual void addClass ()
 Opens a "New class" dialog and adds the configured class to the sources.

Static Public Member Functions

KConfig * config ()

Protected Member Functions

virtual KDevLanguageSupport::Features features ()
 Returns the feature set of the language.
virtual KMimeType::List mimeTypes ()
 Returns a typical mimetype list for the support language should be configurable in the languagesupport dialog.
virtual QString formatClassName (const QString &name)
 Formats a canonicalized class path as used by the class store to the human-readable convention.
virtual QString unformatClassName (const QString &name)
 The opposite of formatClassName().
virtual void addMethod (ClassDom klass)
 Opens an "Add method" dialog and adds the configured method to the sources.
virtual void addAttribute (ClassDom klass)
 Opens an "Add attribute" dialog and adds the configured method to the sources.

Private Slots

void activePartChanged (KParts::Part *part)
void partRemoved (KParts::Part *part)
void projectOpened ()
void projectClosed ()
void savedFile (const KURL &fileName)
void configWidget (KDialogBase *dlg)
void projectConfigWidget (KDialogBase *dlg)
void contextMenu (QPopupMenu *popup, const Context *context)
void addedFilesToProject (const QStringList &fileList)
void removedFilesFromProject (const QStringList &fileList)
void changedFilesInProject (const QStringList &fileList)
void slotProjectCompiled ()
void setupCatalog ()
void slotNewClass ()
void slotNeedTextHint (int, int, QString &)
void initialParse ()
 loads, parses and creates both classstores needed
bool parseProject ()
 only parses the current project

Private Member Functions

void maybeParse (const QString &fileName)
 checks if a file has to be parsed
void removeWithReferences (const QString &fileName)
QStringList modifiedFileList ()
QString findSourceFile ()
int pcsVersion ()
void setPcsVersion (int version)
void saveProjectSourceInfo ()

Private Attributes

QString m_contextFileName
QGuardedPtr< ProblemReporter > m_problemReporter
BackgroundParser * m_backgroundParser
KTextEditor::Document * m_activeDocument
KTextEditor::View * m_activeView
KTextEditor::SelectionInterface * m_activeSelection
KTextEditor::EditInterface * m_activeEditor
KTextEditor::ViewCursorInterface * m_activeViewCursor
QString m_activeFileName
QWaitCondition m_eventConsumed
bool m_projectClosed
QMap< QString, QDateTime > m_timestamp
bool m_valid
QPtrList< Catalog > m_catalogList
Driver * m_driver
QString m_projectDirectory
ClassDom m_activeClass
FunctionDom m_activeFunction
VariableDom m_activeVariable

Friends

class KDevJavaSupportIface
class JavaDriver

Detailed Description

This is Java language support plugin.

Put a more detailed description of your part in these lines. It can span over several lines. You can even use some html commands in these lines like: This is code, html links link text, and images.

Author(s):
Jonas Nordin Copyright (C) 1999

Bernd Gehrmann Copyright (C) 2000-2001

Roberto Raggi Copyright (C) 2002-2003

Maintainer(s):
Roberto Raggi Copyright (C) 2002-2003

Feature(s):
Java language support

Consult Programming Languages Support Status for a up to date features/status of this programming language support part.

Bug:
bugs in javasupport component at Bugzilla database

Describe a the 1st bug that you know of, but probably hasn't been reported yet. ..

Describe a the nth bug that you know of, but probably hasn't been reported yet.

Requirement(s):
Describe a the 1st requirement of your part.

Describe a the 2nd requirement of your part. ...

Describe a the nth requirement of your part.

Todo:
Describe a the 1st TODO of your part.

Describe a the 2nd TODO of your part. ...

Describe a the nth TODO of your part.

F.A.Q.:
First frequenly asked question about your part ? Answer.

Second frequenly asked question about your part ? Answer. ...

Last frequenly asked question about your part ? Answer.

Note:
First note text.

Second note text. ...

Last note text.

Warning:
First warning text.

Second warning text. ...

Last warning text.

Definition at line 49 of file javasupportpart.h.


Constructor & Destructor Documentation

JavaSupportPart::JavaSupportPart (  QObject *  parent,
const char *  name,
const QStringList &  args
) 
 

Definition at line 130 of file javasupportpart.cpp.

References KXMLGUIClient::actionCollection(), activePartChanged(), configWidget(), contextMenu(), KDevPlugin::core(), KDevMainWindow::embedOutputView(), JavaDriver, KDevJavaSupportIface, m_backgroundParser, m_catalogList, m_driver, m_eventConsumed, m_problemReporter, KDevPlugin::mainWindow(), KDevPlugin::partController(), partRemoved(), projectClosed(), projectConfigWidget(), projectOpened(), savedFile(), KXMLGUIClient::setInstance(), setupCatalog(), KXMLGUIClient::setXMLFile(), and slotNewClass().

JavaSupportPart::~JavaSupportPart (   )  [virtual]
 

Definition at line 184 of file javasupportpart.cpp.

References BackgroundParser::close(), KDevPlugin::codeRepository(), m_backgroundParser, m_catalogList, m_driver, m_problemReporter, KDevPlugin::mainWindow(), KDevMainWindow::removeView(), KDevCodeRepository::setMainCatalog(), and KDevCodeRepository::unregisterCatalog().


Member Function Documentation

void JavaSupportPart::activePartChanged (  KParts::Part *  part  )  [private, slot]
 

Definition at line 267 of file javasupportpart.cpp.

References URLUtil::canonicalPath(), KTextEditor::TextHintInterface::enableTextHints(), fileExtensions(), kdDebug(), m_activeDocument, m_activeEditor, m_activeFileName, m_activeSelection, m_activeView, m_activeViewCursor, KURL::path(), slotNeedTextHint(), KParts::ReadOnlyPart::url(), and KParts::Part::widget().

Referenced by JavaSupportPart().

void JavaSupportPart::addAttribute (  ClassDom  klass  )  [protected, virtual]
 

Opens an "Add attribute" dialog and adds the configured method to the sources.

Reimplemented from KDevLanguageSupport.

Definition at line 476 of file javasupportpart.cpp.

References ClassDom.

void JavaSupportPart::addClass (   )  [virtual]
 

Opens a "New class" dialog and adds the configured class to the sources.

Todo:
Use KDevNode stuff for this

Reimplemented from KDevLanguageSupport.

Definition at line 864 of file javasupportpart.cpp.

References slotNewClass().

void JavaSupportPart::addedFilesToProject (  const QStringList &  fileList  )  [private, slot]
 

Definition at line 364 of file javasupportpart.cpp.

References KDevLanguageSupport::addedSourceInfo(), URLUtil::canonicalPath(), m_projectDirectory, and maybeParse().

Referenced by projectOpened().

void JavaSupportPart::addMethod (  ClassDom  klass  )  [protected, virtual]
 

Opens an "Add method" dialog and adds the configured method to the sources.

Reimplemented from KDevLanguageSupport.

Definition at line 472 of file javasupportpart.cpp.

References ClassDom.

BackgroundParser* JavaSupportPart::backgroundParser (   )  [inline]
 

Definition at line 60 of file javasupportpart.h.

const QPtrList<Catalog>& JavaSupportPart::catalogList (   )  [inline]
 

Definition at line 62 of file javasupportpart.h.

void JavaSupportPart::changedFilesInProject (  const QStringList &  fileList  )  [private, slot]
 

Definition at line 388 of file javasupportpart.cpp.

References KDevLanguageSupport::addedSourceInfo(), URLUtil::canonicalPath(), m_projectDirectory, and maybeParse().

Referenced by projectOpened().

KConfig* JavaSupportPart::config (   )  [static]
 

Referenced by pcsVersion(), and setPcsVersion().

void JavaSupportPart::configWidget (  KDialogBase *  dlg  )  [private, slot]
 

Definition at line 263 of file javasupportpart.cpp.

Referenced by JavaSupportPart().

void JavaSupportPart::contextMenu (  QPopupMenu *  popup,
const Context *  context
)  [private, slot]
 

Definition at line 345 of file javasupportpart.cpp.

References Context::hasType(), CodeModelItem::isClass(), CodeModelItem::isFunction(), CodeModelItemContext::item(), m_activeClass, m_activeFunction, and m_activeVariable.

Referenced by JavaSupportPart().

void JavaSupportPart::customEvent (  QCustomEvent *  ev  )  [virtual]
 

Definition at line 210 of file javasupportpart.cpp.

References KDevLanguageSupport::addedSourceInfo(), CodeModel::addFile(), KDevPlugin::codeModel(), JavaStoreWalker::compilationUnit(), CodeModel::create(), Event_FileParsed, file, CodeModel::fileByName(), FileDom, FileParsedEvent::fileName(), fileParsed(), CodeModel::hasFile(), Problem::level(), BackgroundParser::lock(), m_backgroundParser, m_problemReporter, FileParsedEvent::problems(), RefJavaAST, removeWithReferences(), JavaStoreWalker::setCodeModel(), JavaStoreWalker::setFile(), BackgroundParser::translationUnit(), and BackgroundParser::unlock().

KDevLanguageSupport::Features JavaSupportPart::features (   )  [protected, virtual]
 

Returns the feature set of the language.

This is e.g. used by the class view to decide which organizer items to display and which not.

Reimplemented from KDevLanguageSupport.

Definition at line 448 of file javasupportpart.cpp.

References KDevLanguageSupport::Features.

QStringList JavaSupportPart::fileExtensions (   )  const
 

Definition at line 463 of file javasupportpart.cpp.

Referenced by activePartChanged(), isValidSource(), and modifiedFileList().

void JavaSupportPart::fileParsed (  const QString &  fileName  )  [signal]
 

Referenced by customEvent().

KTextEditor::Document * JavaSupportPart::findDocument (  const KURL &  url  ) 
 

Definition at line 712 of file javasupportpart.cpp.

References KDevPlugin::partController(), KParts::PartManager::parts(), and KParts::ReadOnlyPart::url().

QString JavaSupportPart::findSourceFile (   )  [private]
 

Definition at line 416 of file javasupportpart.cpp.

References kdDebug(), and m_activeFileName.

QString JavaSupportPart::formatClassName (  const QString &  name  )  [protected, virtual]
 

Formats a canonicalized class path as used by the class store to the human-readable convention.

For example, the C++ support part formats the string "KParts.Part" into "KParts::Part".

Reimplemented from KDevLanguageSupport.

Definition at line 453 of file javasupportpart.cpp.

QString JavaSupportPart::formatModelItem (  const CodeModelItem *  item,
bool  shortDescription = false
)  [virtual]
 

Formats a CodeModelItem as used by the CodeModel to the human-readable convention.

Reimplemented from KDevLanguageSupport.

Definition at line 821 of file javasupportpart.cpp.

References FunctionModel::argumentList(), ArgumentList, ArgumentModel::defaultValue(), KDevLanguageSupport::formatModelItem(), FunctionModel::isAbstract(), CodeModelItem::isArgument(), CodeModelItem::isFunction(), CodeModelItem::isVariable(), CodeModelItem::name(), FunctionModel::resultType(), ArgumentModel::type(), and VariableModel::type().

QString JavaSupportPart::formatTag (  const Tag &  tag  )  [virtual]
 

Formats a Tag as used by the class store to the human-readable convention.

Reimplemented from KDevLanguageSupport.

Definition at line 798 of file javasupportpart.cpp.

void JavaSupportPart::initialParse (   )  [private, slot]
 

loads, parses and creates both classstores needed

Definition at line 480 of file javasupportpart.cpp.

References kdDebug(), m_valid, parseProject(), KDevPlugin::project(), and KDevLanguageSupport::updatedSourceInfo().

Referenced by projectOpened().

bool JavaSupportPart::isValid (   )  const [inline]
 

Definition at line 57 of file javasupportpart.h.

bool JavaSupportPart::isValidSource (  const QString &  fileName  )  const
 

Definition at line 815 of file javasupportpart.cpp.

References fileExtensions().

Referenced by maybeParse(), and parseProject().

void JavaSupportPart::maybeParse (  const QString &  fileName  )  [private]
 

checks if a file has to be parsed

Definition at line 624 of file javasupportpart.cpp.

References URLUtil::canonicalPath(), isValidSource(), m_driver, m_timestamp, Driver::parseFile(), and removeWithReferences().

Referenced by addedFilesToProject(), changedFilesInProject(), and savedFile().

KMimeType::List JavaSupportPart::mimeTypes (   )  [protected, virtual]
 

Returns a typical mimetype list for the support language should be configurable in the languagesupport dialog.

Reimplemented from KDevLanguageSupport.

Definition at line 771 of file javasupportpart.cpp.

References KMimeType::List, KMimeType::mimeType(), and KMimeType::Ptr.

QStringList JavaSupportPart::modifiedFileList (   )  [private]
 

Definition at line 685 of file javasupportpart.cpp.

References KDevProject::allFiles(), URLUtil::canonicalPath(), fileExtensions(), m_projectDirectory, m_timestamp, and KDevPlugin::project().

Referenced by parseProject().

bool JavaSupportPart::parseProject (   )  [private, slot]
 

only parses the current project

Definition at line 515 of file javasupportpart.cpp.

References CodeModel::addFile(), URLUtil::canonicalPath(), KDevPlugin::codeModel(), CodeModel::create(), KDevPlugin::d, file, FileDom, isValidSource(), kdDebug(), m_driver, m_projectDirectory, m_timestamp, KDevPlugin::mainWindow(), modifiedFileList(), Driver::parseFile(), KDevPlugin::project(), KDevMainWindow::statusBar(), toTime_t(), and KDevLanguageSupport::updatedSourceInfo().

Referenced by initialParse(), and slotProjectCompiled().

void JavaSupportPart::partRemoved (  KParts::Part *  part  )  [private, slot]
 

Definition at line 663 of file javasupportpart.cpp.

References BackgroundParser::addFile(), URLUtil::canonicalPath(), kdDebug(), m_backgroundParser, KURL::path(), BackgroundParser::removeFile(), and KParts::ReadOnlyPart::url().

Referenced by JavaSupportPart().

int JavaSupportPart::pcsVersion (   )  [private]
 

Definition at line 783 of file javasupportpart.cpp.

References config(), and KConfigBase::readNumEntry().

Referenced by setupCatalog().

ProblemReporter* JavaSupportPart::problemReporter (   )  [inline]
 

Definition at line 59 of file javasupportpart.h.

Referenced by JavaDriver::fileParsed().

void JavaSupportPart::projectClosed (   )  [private, slot]
 

Definition at line 333 of file javasupportpart.cpp.

References kdDebug(), m_backgroundParser, m_projectClosed, BackgroundParser::removeAllFiles(), and saveProjectSourceInfo().

Referenced by JavaSupportPart().

void JavaSupportPart::projectConfigWidget (  KDialogBase *  dlg  )  [private, slot]
 

Definition at line 259 of file javasupportpart.cpp.

Referenced by JavaSupportPart().

void JavaSupportPart::projectOpened (   )  [private, slot]
 

Definition at line 308 of file javasupportpart.cpp.

References addedFilesToProject(), URLUtil::canonicalPath(), changedFilesInProject(), initialParse(), kdDebug(), m_projectClosed, m_projectDirectory, m_timestamp, KDevPlugin::project(), removedFilesFromProject(), and slotProjectCompiled().

Referenced by JavaSupportPart().

void JavaSupportPart::removedFilesFromProject (  const QStringList &  fileList  )  [private, slot]
 

Definition at line 377 of file javasupportpart.cpp.

References URLUtil::canonicalPath(), m_backgroundParser, m_projectDirectory, BackgroundParser::removeFile(), and removeWithReferences().

Referenced by projectOpened().

void JavaSupportPart::removeWithReferences (  const QString &  fileName  )  [private]
 

Definition at line 803 of file javasupportpart.cpp.

References KDevLanguageSupport::aboutToRemoveSourceInfo(), KDevPlugin::codeModel(), CodeModel::hasFile(), kdDebug(), m_timestamp, and CodeModel::removeFile().

Referenced by customEvent(), JavaDriver::fileParsed(), maybeParse(), and removedFilesFromProject().

void JavaSupportPart::savedFile (  const KURL &  fileName  )  [private, slot]
 

Definition at line 401 of file javasupportpart.cpp.

References KDevLanguageSupport::addedSourceInfo(), KDevProject::allFiles(), kdDebug(), m_projectDirectory, maybeParse(), KURL::path(), and KDevPlugin::project().

Referenced by JavaSupportPart().

void JavaSupportPart::saveProjectSourceInfo (   )  [private]
 

Definition at line 869 of file javasupportpart.cpp.

References KDevPlugin::codeModel(), FileDom, CodeModel::fileList(), FileList, m_timestamp, KDevPlugin::project(), and toTime_t().

Referenced by projectClosed().

void JavaSupportPart::setPcsVersion (  int  version  )  [private]
 

Definition at line 790 of file javasupportpart.cpp.

References config(), KConfigBase::sync(), and KConfigBase::writeEntry().

Referenced by setupCatalog().

void JavaSupportPart::setupCatalog (   )  [private, slot]
 

Definition at line 729 of file javasupportpart.cpp.

References GCatalog< Tp >::addIndex(), KDevPlugin::codeRepository(), KStandardDirs::findAllResources(), kdDebug(), KDEV_DB_VERSION, m_catalogList, GCatalog< Tp >::open(), pcsVersion(), KMessageBox::questionYesNoList(), KDevCodeRepository::registerCatalog(), and setPcsVersion().

Referenced by JavaSupportPart().

void JavaSupportPart::slotNeedTextHint (  int  ,
int  ,
QString & 
)  [private, slot]
 

Definition at line 647 of file javasupportpart.cpp.

Referenced by activePartChanged().

void JavaSupportPart::slotNewClass (   )  [private, slot]
 

Definition at line 468 of file javasupportpart.cpp.

Referenced by addClass(), and JavaSupportPart().

void JavaSupportPart::slotProjectCompiled (   )  [private, slot]
 

Definition at line 679 of file javasupportpart.cpp.

References kdDebug(), and parseProject().

Referenced by projectOpened().

QStringList JavaSupportPart::subclassWidget (  const QString &  formName  )  [virtual]
 

Opens an "Subclass Widget" dialog for given Qt .ui file (formName) and propmts to implement it's slots.

Returns a list of newly created files.

Reimplemented from KDevLanguageSupport.

Definition at line 651 of file javasupportpart.cpp.

QString JavaSupportPart::unformatClassName (  const QString &  name  )  [protected, virtual]
 

The opposite of formatClassName().

Reimplemented from KDevLanguageSupport.

Definition at line 458 of file javasupportpart.cpp.

QStringList JavaSupportPart::updateWidget (  const QString &  formName,
const QString &  fileName
)  [virtual]
 

Opens and "Update Widget" dialog for given Qt .ui file (formName) and prompts to add missing slot implementations in the subclass located in fileName.

Returns a list of newly created files.

Reimplemented from KDevLanguageSupport.

Definition at line 657 of file javasupportpart.cpp.


Friends And Related Function Documentation

friend class JavaDriver [friend]
 

Definition at line 162 of file javasupportpart.h.

Referenced by JavaSupportPart().

friend class KDevJavaSupportIface [friend]
 

Definition at line 161 of file javasupportpart.h.

Referenced by JavaSupportPart().


Member Data Documentation

ClassDom JavaSupportPart::m_activeClass [private]
 

Definition at line 157 of file javasupportpart.h.

Referenced by contextMenu().

KTextEditor::Document* JavaSupportPart::m_activeDocument [private]
 

Definition at line 140 of file javasupportpart.h.

Referenced by activePartChanged().

KTextEditor::EditInterface* JavaSupportPart::m_activeEditor [private]
 

Definition at line 143 of file javasupportpart.h.

Referenced by activePartChanged().

QString JavaSupportPart::m_activeFileName [private]
 

Definition at line 145 of file javasupportpart.h.

Referenced by activePartChanged(), and findSourceFile().

FunctionDom JavaSupportPart::m_activeFunction [private]
 

Definition at line 158 of file javasupportpart.h.

Referenced by contextMenu().

KTextEditor::SelectionInterface* JavaSupportPart::m_activeSelection [private]
 

Definition at line 142 of file javasupportpart.h.

Referenced by activePartChanged().

VariableDom JavaSupportPart::m_activeVariable [private]
 

Definition at line 159 of file javasupportpart.h.

Referenced by contextMenu().

KTextEditor::View* JavaSupportPart::m_activeView [private]
 

Definition at line 141 of file javasupportpart.h.

Referenced by activePartChanged().

KTextEditor::ViewCursorInterface* JavaSupportPart::m_activeViewCursor [private]
 

Definition at line 144 of file javasupportpart.h.

Referenced by activePartChanged().

BackgroundParser* JavaSupportPart::m_backgroundParser [private]
 

Definition at line 138 of file javasupportpart.h.

Referenced by customEvent(), JavaSupportPart(), partRemoved(), projectClosed(), removedFilesFromProject(), and ~JavaSupportPart().

QPtrList<Catalog> JavaSupportPart::m_catalogList [private]
 

Definition at line 153 of file javasupportpart.h.

Referenced by JavaSupportPart(), setupCatalog(), and ~JavaSupportPart().

QString JavaSupportPart::m_contextFileName [private]
 

Definition at line 135 of file javasupportpart.h.

Driver* JavaSupportPart::m_driver [private]
 

Definition at line 154 of file javasupportpart.h.

Referenced by JavaSupportPart(), maybeParse(), parseProject(), and ~JavaSupportPart().

QWaitCondition JavaSupportPart::m_eventConsumed [private]
 

Definition at line 147 of file javasupportpart.h.

Referenced by JavaSupportPart().

QGuardedPtr< ProblemReporter > JavaSupportPart::m_problemReporter [private]
 

Definition at line 137 of file javasupportpart.h.

Referenced by customEvent(), JavaSupportPart(), and ~JavaSupportPart().

bool JavaSupportPart::m_projectClosed [private]
 

Definition at line 148 of file javasupportpart.h.

Referenced by projectClosed(), and projectOpened().

QString JavaSupportPart::m_projectDirectory [private]
 

Definition at line 155 of file javasupportpart.h.

Referenced by addedFilesToProject(), changedFilesInProject(), modifiedFileList(), parseProject(), projectOpened(), removedFilesFromProject(), and savedFile().

QMap<QString, QDateTime> JavaSupportPart::m_timestamp [private]
 

Definition at line 150 of file javasupportpart.h.

Referenced by maybeParse(), modifiedFileList(), parseProject(), projectOpened(), removeWithReferences(), and saveProjectSourceInfo().

bool JavaSupportPart::m_valid [private]
 

Definition at line 151 of file javasupportpart.h.

Referenced by initialParse().


The documentation for this class was generated from the following files:
KDE Logo
This file is part of the documentation for KDevelop Version 3.1.2.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Tue Feb 22 09:43:55 2005 by doxygen 1.3.9.1 written by Dimitri van Heesch, © 1997-2003