KDevelop API Documentation

JavaSupportPart Class Reference

This is Java language support plugin. More...

#include <javasupportpart.h>

Inheritance diagram for JavaSupportPart:

KDevLanguageSupport KDevPlugin QObject KXMLGUIClient 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
ProblemReporterproblemReporter ()
BackgroundParserbackgroundParser ()
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::DocumentfindDocument (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

KConfigconfig ()

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 QString &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< ProblemReporterm_problemReporter
BackgroundParserm_backgroundParser
KTextEditor::Documentm_activeDocument
KTextEditor::Viewm_activeView
KTextEditor::SelectionInterfacem_activeSelection
KTextEditor::EditInterfacem_activeEditor
KTextEditor::ViewCursorInterfacem_activeViewCursor
QString m_activeFileName
QWaitCondition m_eventConsumed
bool m_projectClosed
QMap< QString, QDateTimem_timestamp
bool m_valid
QPtrList< Catalogm_catalogList
Driverm_driver
QString m_projectDirectory
ClassDom m_activeClass
FunctionDom m_activeFunction
VariableDom m_activeVariable

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(), JavaSupportPart(), m_backgroundParser, m_catalogList, m_driver, m_eventConsumed, m_problemReporter, KDevPlugin::mainWindow(), KDevPlugin::partController(), partRemoved(), projectClosed(), projectConfigWidget(), projectOpened(), savedFile(), setupCatalog(), and slotNewClass().

Referenced by JavaSupportPart().

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 activePartChanged(), URLUtil::canonicalPath(), KTextEditor::TextHintInterface::enableTextHints(), endl(), 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 activePartChanged(), and 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 addAttribute().

Referenced by addAttribute().

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 addedFilesToProject(), URLUtil::canonicalPath(), m_projectDirectory, and maybeParse().

Referenced by addedFilesToProject(), and 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 addMethod().

Referenced by addMethod().

BackgroundParser* JavaSupportPart::backgroundParser  )  [inline]
 

Definition at line 60 of file javasupportpart.h.

References m_backgroundParser.

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

Definition at line 62 of file javasupportpart.h.

References m_catalogList.

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

Definition at line 388 of file javasupportpart.cpp.

References URLUtil::canonicalPath(), changedFilesInProject(), m_projectDirectory, and maybeParse().

Referenced by changedFilesInProject(), and 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.

References configWidget().

Referenced by configWidget(), and JavaSupportPart().

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

Definition at line 345 of file javasupportpart.cpp.

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

Referenced by contextMenu(), and JavaSupportPart().

void JavaSupportPart::customEvent QCustomEvent ev  )  [virtual]
 

Definition at line 210 of file javasupportpart.cpp.

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

Referenced by customEvent().

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.

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 findDocument(), KDevPlugin::partController(), KParts::PartManager::parts(), and KParts::ReadOnlyPart::url().

Referenced by findDocument().

QString JavaSupportPart::findSourceFile  )  [private]
 

Definition at line 416 of file javasupportpart.cpp.

References endl(), 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.

References formatClassName().

Referenced by formatClassName().

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(), formatModelItem(), FunctionModel::isAbstract(), CodeModelItem::isArgument(), CodeModelItem::isFunction(), CodeModelItem::isVariable(), CodeModelItem::name(), FunctionModel::resultType(), ArgumentModel::type(), and VariableModel::type().

Referenced by formatModelItem().

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.

References formatTag().

Referenced by formatTag().

void JavaSupportPart::initialParse  )  [private, slot]
 

loads, parses and creates both classstores needed

Definition at line 480 of file javasupportpart.cpp.

References endl(), 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.

References m_valid.

bool JavaSupportPart::isValidSource const QString fileName  )  const
 

Definition at line 815 of file javasupportpart.cpp.

References fileExtensions(), and isValidSource().

Referenced by isValidSource(), 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, maybeParse(), Driver::parseFile(), and removeWithReferences().

Referenced by addedFilesToProject(), changedFilesInProject(), maybeParse(), 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, 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(), endl(), file, isValidSource(), kdDebug(), KDEV_PCS_VERSION, m_driver, m_projectClosed, 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(), endl(), kdDebug(), m_backgroundParser, partRemoved(), KURL::path(), BackgroundParser::removeFile(), and KParts::ReadOnlyPart::url().

Referenced by JavaSupportPart(), and partRemoved().

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.

References m_problemReporter.

Referenced by JavaDriver::fileParsed().

void JavaSupportPart::projectClosed  )  [private, slot]
 

Definition at line 333 of file javasupportpart.cpp.

References endl(), 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.

References projectConfigWidget().

Referenced by JavaSupportPart(), and projectConfigWidget().

void JavaSupportPart::projectOpened  )  [private, slot]
 

Definition at line 308 of file javasupportpart.cpp.

References addedFilesToProject(), URLUtil::canonicalPath(), changedFilesInProject(), endl(), 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, removedFilesFromProject(), BackgroundParser::removeFile(), and removeWithReferences().

Referenced by projectOpened(), and removedFilesFromProject().

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

Definition at line 803 of file javasupportpart.cpp.

References KDevPlugin::codeModel(), endl(), CodeModel::hasFile(), kdDebug(), m_timestamp, CodeModel::removeFile(), and removeWithReferences().

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

void JavaSupportPart::savedFile const QString fileName  )  [private, slot]
 

Definition at line 401 of file javasupportpart.cpp.

References KDevProject::allFiles(), endl(), kdDebug(), m_projectDirectory, maybeParse(), KDevPlugin::project(), and savedFile().

Referenced by JavaSupportPart(), and savedFile().

void JavaSupportPart::saveProjectSourceInfo  )  [private]
 

Definition at line 869 of file javasupportpart.cpp.

References KDevPlugin::codeModel(), CodeModel::fileList(), FileList, KDEV_PCS_VERSION, 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(), setPcsVersion(), KConfigBase::sync(), and KConfigBase::writeEntry().

Referenced by setPcsVersion(), and setupCatalog().

void JavaSupportPart::setupCatalog  )  [private, slot]
 

Definition at line 729 of file javasupportpart.cpp.

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

Referenced by JavaSupportPart().

void JavaSupportPart::slotNeedTextHint int  ,
int  ,
QString
[private, slot]
 

Definition at line 647 of file javasupportpart.cpp.

References slotNeedTextHint().

Referenced by activePartChanged(), and slotNeedTextHint().

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 endl(), 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.

References subclassWidget().

Referenced by subclassWidget().

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

The opposite of formatClassName().

Reimplemented from KDevLanguageSupport.

Definition at line 458 of file javasupportpart.cpp.

References unformatClassName().

Referenced by unformatClassName().

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.

References updateWidget().

Referenced by updateWidget().


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 backgroundParser(), customEvent(), JavaSupportPart(), partRemoved(), projectClosed(), removedFilesFromProject(), and ~JavaSupportPart().

QPtrList<Catalog> JavaSupportPart::m_catalogList [private]
 

Definition at line 153 of file javasupportpart.h.

Referenced by catalogList(), 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(), problemReporter(), and ~JavaSupportPart().

bool JavaSupportPart::m_projectClosed [private]
 

Definition at line 148 of file javasupportpart.h.

Referenced by parseProject(), 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(), and isValid().


The documentation for this class was generated from the following files:
KDE Logo
This file is part of the documentation for KDevelop Version 3.0.4.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Tue Oct 19 08:02:04 2004 by doxygen 1.3.7 written by Dimitri van Heesch, © 1997-2003