Compare commits

...
287 Commits
Author SHA1 Message Date
malte_langkabel 7271e30434 ui: state required Java version
* revised texts in application preferences and documentation to state the currently required Java version
* update deploy script on windows to use UPX with "--best" instead of "--brute"
2016-09-01 13:40:06 +02:00
malte_langkabel a014f9f7a6 web: documentation update for Coati 0.8 2016-09-01 13:15:48 +02:00
Eberhard Graether ef24f528c3 build: Added Java files and sample project to Mac Bundle 2016-09-01 10:28:03 +02:00
malte_langkabel 464ed518d8 build: update windows installers
* updated version numbers of installers on windows
* renamed start menu entries from trail to trial
2016-09-01 10:10:56 +02:00
malte_langkabel 850be396aa build: windows deploy fixes
* added javaparser.coatidb to app setup project
* clearing javaparser.coatidb before building it in headless more for deploy
* added all plugins to windows deploy script
2016-08-31 16:37:45 +02:00
Andreas Stallinger 2e9422a8cf src: add READMES for ide plugins and linux jars 2016-08-31 12:47:50 -01:00
Eberhard Graether bb5372efce build: Added changelog for 0.8.0 2016-08-31 14:52:38 +02:00
Andreas Stallinger 251eab6e9e ui: prefill headers from compilation database
dialog for selecting header paths from compilation database
2016-08-31 14:37:28 +02:00
malte_langkabel d2de395ed5 logic: revised loading Java library
* implemented a dynamic way (that does not involve the linker) to load the Java runtime library
* implemented JavaPathDetectorLinux
* Filepicker for Java runtime library now asks to pick JVM library instead of folder
* extended error handling for JavaEnvironmentFactory
2016-08-31 12:16:29 +02:00
Eberhard Graether eb621eea33 ui: Fixed correct delimiter per language used in search field 2016-08-31 11:37:53 +02:00
malte_langkabel ad719aeaa8 ui: revised project setup descriptions
* revised texts in project setup ui
* fixed crash during project setup when CDB file is empty
* fixed row height of project location in CDB project setup
2016-08-30 16:52:28 +02:00
Eberhard Graether ebdc2d3382 ui: Revised project setup
* changed help texts
* use help buttons instead of descriptions in dialogs
* fixed show files button not up-to-date with directory list box
* fixed source file extensions shown in cdb setup
* refactored size and content setting for project content classes
2016-08-30 11:20:32 +02:00
Eberhard Graether d4131ce92c data: Fixed error locations not saved with absolute filepaths in CDB projects 2016-08-29 23:30:59 +02:00
Eberhard Graether 0143268f90 test: Enabled Java tests and fixed clang warnings 2016-08-29 12:24:17 +02:00
malte_langkabel d9c9e4b3eb logic: using javapath on windows fix
* fixed usage of javapath on windows: search in provided path before resorting to content of path variable
2016-08-29 12:05:40 +02:00
malte_langkabel 9701332fd0 logic: using source folders for header search
* adding folders form source paths to header search paths for convenience. We are using system header search paths here so that users can also use "<..>" in their includes.
2016-08-29 11:29:03 +02:00
malte_langkabel 4bac37096a logic: moved javapath validation
* moved creation of java environment factory to build index method. This fixes a bug where project refresh was not working when setting the java path after loading the project.
2016-08-29 10:49:59 +02:00
Eberhard Graether d3b10bc5fd ui: Fixed font colors in indexing dialogs and line breaks in status bar 2016-08-26 15:31:57 +02:00
Eberhard Graether 00980f73af ui: Added missing source files extensions setting to edit project dialog
bug id = 132
2016-08-26 15:08:32 +02:00
Eberhard Graether 892df2abac ui: Changed default colors for UI elements to black
bug id = 140
2016-08-26 14:59:21 +02:00
Eberhard Graether ca0a1ffb89 ui: Added plugin ports to preferences
bug id = 145
2016-08-26 14:41:39 +02:00
Eberhard Graether 401c23f572 ui: Smaller fonts in indexing dialogs 2016-08-26 13:45:05 +02:00
Eberhard Graether 55ae17af29 ui: Added Java Path detector for Mac 2016-08-26 13:27:34 +02:00
Eberhard Graether f719212678 logic: Fixed project refresh to acknowledge project state 2016-08-26 12:42:57 +02:00
malte_langkabel d25bba4b59 ui: java not found popup 2016-08-25 15:44:55 +02:00
malte_langkabel 0268e924aa data: java sample project
* added javaparser as sample project
* fixed crash in utility::isPrefix when prefix is longer than the actual string
* fixed crash when inserting a meta value that contains a special character
* added "language" to project settings of tutorial
* changed separators in serialized name hierarchy
* added javaparser project to windows installers
* enabled the checkbox for start menu shortcut in installer by default
* removed autorefresh icon
* removed JavaSmallTest project
2016-08-25 15:18:00 +02:00
Eberhard Graether 520a1b2d48 ui: Fixed regex for system includes used mistakenly 2016-08-25 15:11:48 +02:00
Eberhard Graether a15dccb219 src: Fixed clang warnings 2016-08-25 14:45:18 +02:00
Eberhard Graether 2fa75f46cd fix: Fixed logging 2016-08-25 14:13:35 +02:00
Eberhard Graether bff9430fa2 logic: Enable/Disable Logging in Preferences
* disabled by default
2016-08-25 13:44:43 +02:00
Eberhard Graether 03bbce45c9 logic: Application settings migration system
* Added version number to ApplicationSettings
* Added SettingsMigrator for defining migration rules for different ApplicationSettings versions
* Migrate ApplicationSettings when loading
2016-08-25 12:40:54 +02:00
Eberhard Graether cc8ea7c8fb ui: Fixed error locations and messages not matching 2016-08-24 18:04:20 +02:00
malte_langkabel 8dfc1ea9d9 ui: autodetect java on windows
* implemented a more generic approach to detecting filepaths
* reimplemented standard header detection using this approach
* added auto detection of JVM dynamic library on windows
* fixed java tests that were broken when updating the java_indexer project before this commit.
2016-08-24 15:21:04 +02:00
Eberhard Graether 01f740276b ui: removed auto refresh 2016-08-24 13:28:28 +02:00
malte_langkabel 994a749b80 build: added missing include
* added missing include for indexing UI feature
2016-08-24 11:38:09 +02:00
Eberhard Graether 2c90b75a9f ui: Indexing UI
* Added DialogView with QtDialogView implementation to handle information dialogs
* Implemented QtIndexingDialog class that covers all different dialogs for indexing
* Directly communicate with DialogView from Prpject and all Tasks involved in indexing
* Block QtMainWindow UI while indexing
2016-08-23 23:45:45 +02:00
Manuel Dobusch 377f0ef34f logic: project setup fix
Checking whether a project is currently loaded before accessing it...
2016-08-23 16:47:57 +02:00
malte_langkabel 0ad7585811 data: removed java import errors
* removed error recording when import not found because of false positives
2016-08-23 15:58:22 +02:00
Manuel Dobusch a1277a92f4 logic: added language setting to vs project parser
Language setting was missing from projectSettings created by the vs solution parser
2016-08-23 15:50:24 +02:00
malte_langkabel c3355f3c1a ui: hide name qualifiers for java graph nodes
* removed name qualifiers in non-package graph nodes for java projects
2016-08-22 16:38:23 +02:00
malte_langkabel 274eca0e5d ui: added java licenses
* added license info for 3rd party jars to license ui
* removed unused jars for java indexer
2016-08-22 15:57:54 +02:00
malte_langkabel 858364b385 logic: handle java not found on windows and mac
* implemented java will not be used if it is not found on system
* add jni libraries weak linked for Mac
* use dlopen for lazy library loading
* added java path to preferences
2016-08-22 14:24:53 +02:00
malte_langkabel 98eb3f124d logic: fix jar not found exception
not found jars or classpath items are not handed forward to the java indexer because the java code throws exceptions when attempting to create a jar type solver for these.
2016-08-22 10:34:26 +02:00
Eberhard Graether c43e074c9e ui: Added plain text editing dialog to list boxes in project setup UI
* Added class QtTextEditDialog for displaying text content
* Added edit button to QtDirectoryListBox
* Replaced show files button dialog using QtProjectWizzardContentSourceList with QtTextEditDialog
2016-08-20 00:46:09 +02:00
malte_langkabel e508741c9a data: refresh with java imports
* coati regards import dependencies when refreshing a project
2016-08-19 13:48:02 +02:00
malte_langkabel 9255d45b94 ui: language dependent symbol name delimiter
* implemented symbol delimiter as static field of NameHierarchy which is set when a project is created.
2016-08-18 15:22:25 +02:00
Eberhard Graether c269493942 ui: Added scroll speed setting to preferences 2016-08-18 12:12:19 +02:00
malte_langkabel 3d40f4ed4e data: error for java import not found
* added recording an error in this case.
* added test for this case.
2016-08-17 17:04:23 +02:00
Eberhard Graether a3001b2b72 ui: Added Java project setup UI 2016-08-17 13:12:26 +02:00
Eberhard Graether 566cface6c build: java indexing fixes for MacOSX 2016-08-17 10:46:18 +02:00
malte_langkabel 783e0ac060 data: recording braces in java
* implemented recording of scope braces as local symbols for java
2016-08-16 15:22:59 +02:00
malte_langkabel 77848a3d67 build: java indexing fixes for linux 2016-08-16 10:10:18 +02:00
malte_langkabel ae5a6a5d46 data: unresolved type names
changed names of unresolved types from "error-type" to "unresolved-type" because it's easier for the user to understand what that means.
2016-08-12 15:50:25 +02:00
malte_langkabel 5c0ed7f7f2 data: avoid duplicate access components
* added check to make sure that an access component does not already exist before inserting it into the database
2016-08-12 15:36:48 +02:00
malte_langkabel 279fc7ae82 data: shortened local symbol names
* removed var name from local symbol names that get stored in the db
2016-08-12 09:58:35 +02:00
Andreas Stallinger 8776a8e285 data: separate table for filecontent 2016-08-12 09:55:46 +02:00
Manuel Dobusch c6a6e6d028 build: wix installer integration
Updated wix installer to better facilitate the integration into the deploy process.
2016-08-11 15:14:15 +02:00
malte_langkabel c847fba568 src: Project Refactoring
* Added language specific Project and ProjectSettings
* moved project specific code from Application to Project
* made Application a singleton
* added handleDialog method to Application which displays a dialog window and waits for user input
* Added ScopedFunctor that executes a function when deleted
2016-08-11 12:17:13 +02:00
Eberhard Graether 6b51c7cfe4 logic: Fixed scrolling to line from plug-in and moved all code view scrolling into QtCodeNavigator 2016-08-10 16:16:32 +02:00
Eberhard Graether 2800c072ff logic: Cache graph and stats of overview in StorageCache 2016-08-10 13:15:45 +02:00
Manuel Dobusch d0cf500c8e build: new windows installer
Created new windows installer based on the WiX Toolset
2016-08-09 16:32:27 +02:00
Eberhard Graether 9cda1e773d logic: Fixed graph nodes restoring their expand state
bug id = 118
2016-08-09 15:32:14 +02:00
Eberhard Graether b9f518feed ui: Fixed content disappears when switching color scheme in preferences 2016-08-09 14:07:59 +02:00
Eberhard Graether d0a063a3b6 ui: Added shortcuts for navigating to next and previous reference in code view
* Added new class QtCodeNavigator between QtCodeView and QtCodeFileList that handles active ids and navigation
* Pass all files as initially collapsed to code view and decide in QtCodeNavigator which ones show content
* Rewrote requesting of active snippet display to top down approach
* Display other locations focused when active location changes
* Show corresponding edges when navigating references
2016-08-09 13:29:14 +02:00
malte_langkabel 210c5b1245 src: java exception handling for override edges
* added exception handling when resolving override edges.
2016-08-08 15:33:34 +02:00
Andreas Stallinger d36a0fc07a documentation: plugin repos added
* repo urls added
* eclipse manually installation instruction added
2016-08-08 11:01:25 +02:00
Eberhard Graether 17fece804b ui: Tab in search completes up to next ::, Delete erases to last ::
bug id = 133
2016-08-06 16:39:43 +02:00
Eberhard Graether fae418897c ui: sub bundle for anonymous namespaces
bug id = 126
2016-08-06 14:47:38 +02:00
Eberhard Graether 7616e07eeb ui: Added help menu actions to show log and data folders 2016-08-06 13:14:30 +02:00
Eberhard Graether 3c88998c10 src: fixed clang warnings 2016-08-06 12:53:17 +02:00
Eberhard Graether f7de8d017a ui: Added new load gif with higher resolution 2016-08-04 17:02:48 +02:00
malte_langkabel 19d6ca3079 data: type alias indexing
* added recording of type aliases (note: template type alias does not work properly right now)
2016-08-04 13:12:54 +02:00
malte_langkabel b072972b50 data: indexing java
* expanded appsettings to include java specific stuff
* added java indexer as separate project that can be build via its build script
* added dependencies for java indexer to the setup folder
* added license files for these dependencies.
* added sample project for java. this is just to test java on other machines and can be removed again in the future.
* the java parser test suite is currently uncommented because java is not running on every machine.
* added some more node types
* removed TokenComponentAccess::AccessType and replaced all its usages by using AccessKind
* moved access components from edges to nodes
* using recordReference of ParserClient for java
* removed recording access specifier of inheritance edges.
* added styles for new node types
2016-08-04 09:20:13 +02:00
Eberhard Graether 05c06a6102 ui: Changed graph access public icon and added default icon 2016-08-03 18:06:30 +02:00
Andreas Stallinger 66e48d5608 documentation: Atom added and Melpa(Emacs repo)
* add atom plugin to docu
 * emacs plugin is now on melpa(online package archive)
2016-08-02 11:51:46 +02:00
Eberhard Graether b32836c58f blog: Google story blog post 2016-07-30 00:36:24 +02:00
Andreas Stallinger f88cc16a36 docu: plugin section updated
emacs, vim, ...
2016-07-28 17:08:15 +02:00
Andreas Stallinger d5e9cecef3 logic: scroll code when no symbol
Scrolling to line, when comming from plugin and the file is was modified.
Since there we dont know from the position data if the symbol on position is the right one,
we scroll to the line if modified.
2016-07-28 14:16:15 +02:00
Andreas Stallinger acaf58c3f8 ui: Shortcut for Preferences on Linux/Windows 2016-07-28 14:12:09 +02:00
Eberhard Graether 2672299a58 ui: Stay at original line when expanding scope in the code view
bug id = 82
2016-07-22 14:57:36 +02:00
Eberhard Graether f4677a902d ui: Pan graph view to name of active symbol after activation
bug id = 80
2016-07-22 13:57:58 +02:00
Eberhard Graether b2cb95de1b ui: Moved color scheme selection to preferences
* removed 'Switch Color Scheme' action from View menu
* added dropdown with all fetched color schemes to preferences

bug id = 114
2016-07-20 17:27:53 +02:00
Eberhard Graether 6e9a6f9a8d ui: Moved Preferences to Edit menu
bug id = 113
2016-07-20 15:57:45 +02:00
Eberhard Graether cb869c2465 data: Store separate storage version number in SqliteStorage for managing migrations
* deprecated the third version number as storage update number
* version can now have either 3 or 4 numbers
* whether a .coatidb file is outdated is now solely determined by the SqliteStorage::STORAGE_VERSION
2016-07-20 14:14:21 +02:00
Eberhard Graether eb8808b624 logic: Hide non-fatal errors in unindexed files
* added database field indexed to error to tell if the error occured within an indexed file
* added checkbox to Preferences for showing them
2016-07-20 12:24:46 +02:00
Eberhard Graether f93b31a942 ui: Fixed file out-of-date star disappearing when showing snippets after minimized state, AKA star bug 2016-07-19 14:42:04 +02:00
Eberhard Graether 46be24ab26 web: Added page navigation top and bottom to blog 2016-07-18 17:33:52 +02:00
malte_langkabel 11a1ccc822 web: updated blog post "Parameter or Argument?" 2016-07-14 17:17:19 +02:00
malte_langkabel ca31eda54e web: Blogpost Parameter or Argument? 2016-07-14 11:12:08 +02:00
Andreas Stallinger 5813e3dcf8 docu: Linux install script 2016-07-11 12:45:01 +02:00
Andreas Stallinger 255cb252d6 docu: update for eclipse and clion/intellij plugin 2016-07-11 12:30:13 +02:00
Eberhard Graether 8b770b0c71 ui: Increase code view performance by caching line lengths in QtCodeArea 2016-07-08 14:36:12 +02:00
Eberhard Graether 06255286ae data: No implicit nodes in search autocompletion 2016-07-08 11:08:56 +02:00
Eberhard Graether 8a13aebc3f build: Added changelog for release 0.7.0.22 2016-07-07 14:32:01 +02:00
malte_langkabel 5bfd0ecbbe build: added size grip image to windows installer 2016-07-07 13:16:18 +02:00
Eberhard Graether e604c3b025 build: Fixes for release
* show custom icon for size grip
* add small margin at bottom of windows to show full shadow on Windows
* remove color_scheme_test keyword from autocompletions
* commented failing vs solution parser tests
2016-07-07 12:25:20 +02:00
Manuel Dobusch b683d7b2d6 logic: VS Solution Macro Handling
Added handling of project specific VS macros
2016-07-07 00:14:29 +02:00
malte_langkabel dbcb8f449c ui: removed clang warnings from console
* disabled clang warnings to be dumped into the console
* changed logging type of storage stats from WARNING to INFO
2016-07-06 18:22:02 +02:00
Andreas Stallinger 592cc99cee src: fix missing include
include memory for shared_ptr
2016-07-04 15:14:54 +02:00
Eberhard Graether 4e18389d38 ui: Added singleton QtContextMenu with global back and forward actions
* QtContextMenu holds default actions for back and forward
* additional actions can be passed to extend the default menu
* currently used in QtMainWindow and QtCodeArea
* fixed crash on undo when only view actions happened since project load

bug id = 108
2016-06-30 16:49:16 +02:00
Eberhard Graether 32f894422d ui: Made QtWindow resizeable with resize grip
* added size grip to bottom right corner of QtWindow
* use layouts on start screen
* added close button in about window to layout

bug id = 102
2016-06-30 13:52:18 +02:00
Eberhard Graether b5d9d20bc9 ui: fixed flickering of search autocompletions popup 2016-06-29 22:15:00 +02:00
Eberhard Graether cba0cfad65 logic: Fixed crashes and halting during indexing
* Fixed CPPSqliteException being thrown due to not properly destructed statement in addError
* Fixed indexer getting stuck after building caches because MessageFinishedParsing was interrupted
* removed Message::cancel() method and all related code

bug id = 105
2016-06-29 14:10:26 +02:00
Eberhard Graether ba3316008a build: Fixed MacOSX build crashing on launch due to unknown command line option
bug id = 103
2016-06-28 17:50:36 +02:00
Eberhard Graether 8ca54f2091 ui: removed 'Save Project' and 'Save Project As' actions
* removed save actions from menu in QtMainWindow
* removed MessageSaveProject and all Listeners
* updated project loading to ask whether old project and db file should be kept at old location
* fixed crash for missing include files
* fixed simple header search within source paths was broken
2016-06-28 15:59:22 +02:00
Eberhard Graether 2cf033d43a data: Speed up include parsing by reusing current path in PreprocessorCallbacks 2016-06-24 14:41:17 +02:00
Eberhard Graether 3430ed2a1b logic: Fixed spaces not working in search bar
The QShortcut members of QtMainWindow did not propagate the keypress events further. The keyPressEvent of QtMainWindow
is now used instead.
2016-06-24 13:54:54 +02:00
Eberhard Graether 140d4a406a logic: Fixed detected global search paths keep original order
The global header search paths were sorted alphabetically after detection due to checking for uniqueness. This caused
problems with #include_next directives in certain std header files that relied on the correct header search path order.

bug id = 101
2016-06-24 13:35:16 +02:00
Eberhard Graether 44cee3d130 web: Fixed syntax highlighting did not work on Mac due to missing language specification 2016-06-24 12:44:11 +02:00
malte_langkabel 5161455355 web: fixed clang post
<description>
2016-06-24 11:56:13 +02:00
malte_langkabel e7efff8843 web: indexing clang with coati using clang
* added new blog post
* implemented play button for gifs
2016-06-23 17:53:36 +02:00
Eberhard Graether 7f867bf889 ui: added color_scheme_test command displaying all graph node types and states
implementations for other views comming.
2016-06-22 16:14:06 +02:00
malte_langkabel 36c504d8a0 build: added missing include 2016-06-21 10:35:38 +02:00
Eberhard Graether 9560cc4ea6 utility: Added Tracer for collecting time measurements
* define TRACING_ENABLED in utility/tracing.h to enable tracing
* invoke TraceEvent by writing TRACE() at start of function or scope
* provide an event name with TRACE("name")
* press SPACE to show collected traces history and report with accumulated times
2016-06-16 12:03:34 +02:00
Eberhard Graether 6b31a43f75 blog: post for release 0.7 2016-06-16 10:03:05 +02:00
Eberhard Graether b4c094e784 docs: Updated documentation to 0.7.0 2016-06-16 10:00:50 +02:00
Eberhard Graether 7227a47b49 build: Changelog for 0.7.0 2016-06-16 09:57:15 +02:00
malte_langkabel 0aa97adb17 data: fixed tutorial includes 2016-06-14 17:21:55 +02:00
malte_langkabel 247be13650 build: updated windows deploy
* added vim plugin directory to package
* changed version number of installer
2016-06-14 16:19:09 +02:00
malte_langkabel 2b93bdc283 src: headless crash
* fixed crash when loading project in headless mode
2016-06-14 16:02:40 +02:00
malte_langkabel 98b13ef24d ui: overlay window base size
* added property in application settings to define a basic width and height that is used when creating new overlay windows.
* fixed crash in tests
2016-06-14 15:27:03 +02:00
Eberhard Graether b7ba10e119 script: Added vim to plugins in Mac bundle 2016-06-14 12:50:15 +02:00
Eberhard Graether 253af27067 ui: changed wording in the UI to indexing instead of analysing 2016-06-14 12:45:13 +02:00
Andreas Stallinger 83e4bcd049 build: vim plugin readme added to linux package
<description>
2016-06-14 12:41:23 +02:00
Andreas Stallinger 2125396665 utility: vim plugin
readme for vim plugin added to ide_plugins
2016-06-14 12:34:43 +02:00
Eberhard Graether 1c0c2e78df data: Cache current file path in PreprocessorCallbacks to avoid lookup for every macro directive 2016-06-14 10:41:41 +02:00
Eberhard Graether b9c0f9ed3e data: Fixed macro expand location was wrong when used within expansion of different file 2016-06-14 00:01:36 +02:00
Eberhard Graether 72a48f997f logic: Avoid reparsing when no project files nothing changed 2016-06-13 23:21:35 +02:00
Eberhard Graether 986f67df8e data: Removed error logs in CxxDeclNameResolver.cpp
bug id = 94
2016-06-13 22:50:02 +02:00
Eberhard Graether 208f2b1158 ui: Changed full text search character to ? and added shortcut CTRL+SHIFT+F 2016-06-13 21:07:14 +02:00
Eberhard Graether b07d03692d logic: Reworked CDB project setup
* added separate step for project name, project location and cdb path
* added description that project stays up-to-date under cdb path picker.
* added include and framework paths to advanced settings
* disregard source extensions for cdb projects

bug id = 70
2016-06-13 16:43:37 +02:00
Eberhard Graether aae388d8ee logic: Check compilation database path before refreshing 2016-06-12 11:21:18 +02:00
Eberhard Graether b57171552f ui: Added download link to start screen 2016-06-12 10:12:27 +02:00
Eberhard Graether be3ba0ba23 ui: Added status messages for fulltext search 2016-06-12 09:35:11 +02:00
Eberhard Graether 19e26268cf build: Added Qt gif plugin to fix loader gif in release build not working 2016-06-11 04:14:10 +02:00
Eberhard Graether 77080464d7 data: Analyze all types of macro usage 2016-06-11 03:46:44 +02:00
Eberhard Graether 594bb41a6f logic: Fixed app can't find user data after parsing CDB because working directory changed 2016-06-11 03:09:04 +02:00
Eberhard Graether c5af4ed4e5 data: Fixed files being consumed by multiple threads 2016-06-11 02:25:19 +02:00
Eberhard Graether 6821fd1c9a data: Fixed macro expands not saved within macro expands 2016-06-10 22:24:14 +02:00
Eberhard Graether 7e3b2622ec src: miscellaneous bug fixes for upcoming release
* only randomize parsing order of source files for multithreaded indexing
* fixed overview not displayed when switching projects due to MessageScrollCode being dispatched
* avoid adding duplicate TokenLocations that causes highlighting to break in QtCodeArea
* clear all controllers when switching project
* maximize unindexed file when clicking title instead of activating it
2016-06-09 12:30:00 +02:00
Eberhard Graether 5173400b8d logic: Showing annotations in fulltext search results
* new LocationType for errors
* refactored CodeController
* cache active locations in CodeController for later manipulations
2016-06-08 20:33:34 +02:00
Eberhard Graether c6fa1f0969 ui: Defined colors for fulltext search and fulltext code highlights 2016-06-07 15:10:09 +02:00
Eberhard Graether b10c55e7f9 src: Added logic and UI for excluding files and directories from analysis
bug id = 68, 47
2016-06-07 10:46:36 +02:00
Andreas Stallinger 6edcd77eb2 logic: fulltextsearch with suffixarray
* delete test.sqlite in storagetestsuite in desstructor
* remove new and delete from suffixarray
* case sensitive fts
* fixed fulltext results annotated like errors
* lazy suffix array building
* fulltextsearch folder added
* go back too branch without _publish
* suffixarray working
* logic: Improved code view performance
2016-06-07 08:49:34 +02:00
Eberhard Graether 53120cf270 ui: fixed autocompletion list highlights wrong for large indices 2016-06-06 15:40:46 +02:00
Eberhard Graether 468e55f078 ui: Repaint graph view after animation to remove artifacts
bug id = 75
2016-05-31 16:44:24 +02:00
Eberhard Graether ab43d309cb data: optimize memory of sqlite database
* use sqlite "VACUUM" after analysis to reduce memory size
* only add filename to name of local symbol
2016-05-31 15:49:12 +02:00
Eberhard Graether da01855b68 ui: Fixed edge name showing when undoing and redoing 2016-05-31 14:15:50 +02:00
Eberhard Graether 2660465b31 ui: Fixed derived bundle layouted to wrong bucket 2016-05-31 14:02:30 +02:00
Eberhard Graether dfcb9214f4 build: Fixed broken code view style due to app changing working directory while analysing from compilation database 2016-05-31 13:17:36 +02:00
Eberhard Graether d6e2c46420 data: Catch sqlite database close exception that happens sometimes 2016-05-31 12:34:07 +02:00
Eberhard Graether 8222729bb9 logic: Removed undo step for graph and code view manipulations
* graph node moving
* graph node expanding
* code file expanding
* scope expanding
2016-05-31 12:12:05 +02:00
Eberhard Graether 3f032ea822 data: Fixed macro definition not connected to file 2016-05-30 17:06:35 +02:00
Eberhard Graether 5a6e042c8f logic: Removed ActivationTranslator and show old token names in search field 2016-05-30 16:00:55 +02:00
Eberhard Graether 5bb6902cdf src: remove unused stuff
* PersistenStorage::removeUnusedNames
* Dictionary
* DictionaryTestSuite
2016-05-30 14:23:50 +02:00
Eberhard Graether 71cf6bb5f4 logic: randomize source file parsing order to reduce header file double parsing
saves 20% parsing time for Coati
2016-05-30 12:21:39 +02:00
malte_langkabel f02169b08e data: more compiled statements
* added some more statement compilations regarding dangerous names.
2016-05-27 17:20:33 +02:00
Andreas Stallinger 4b734a05f9 utility: Sublime Plugin, import idna encoding
* include fileinfo in fileregister instead of include (for unordered_map)
* sublimeplugin import idna encoading
2016-05-27 12:26:52 +02:00
Eberhard Graether 6165d2fffa ui: Fixed edge drawn wrong when leaving from child nod of smaller node 2016-05-27 12:06:16 +02:00
Eberhard Graether 4e08d86602 logic: Fixed base and derived classes not correctly at top or bottom
Prioritize inheritance and override over all other edges.
2016-05-23 15:58:31 +02:00
malte_langkabel d80a123a5a logic: PARSING files are UNPARSED
* changed ***FileIsUnparsed in FileRegister to disregard files that are currently parsing.
* made Cach more generic by adding the option of providing a custom hasher
2016-05-23 14:58:48 +02:00
Eberhard Graether badad741b0 logic: Fixed slow aggregation click and nodes not staying expanded 2016-05-21 04:44:31 +02:00
Eberhard Graether 5d2a476813 logic: Improved graph and code view performance
* added sql index for component_access
* improved policy for expanded code files
* reduced amount of initially expanded code files
* faster DummyEdge creation
* faster DummyNode search by token id
* switched GraphController DummyNodes and DummyEdges to shared_ptr for memory safety
2016-05-21 00:01:46 +02:00
malte_langkabel 4a6f8cf420 src: crash fixes
* fixed crash when snippet has no code.
* fixed crash when saving a filenode with special characters in its name
* fixed crash when aborting the parsing
2016-05-20 13:52:37 +02:00
Eberhard Graether 946be38fa2 utility: Fixed FilePath::contains 2016-05-20 12:52:37 +02:00
Eberhard Graether 86d1ff2905 logic: Changed include files being analyzed solely by path
* removed header extensions
* added source extensions to source path setup screen
* added caching to hasFilePath check
* don't show header list in CDB setup
* removed TestSettings.xml
2016-05-19 21:47:09 +02:00
Manuel Dobusch 5295267513 ui: generic solution parser
completed first version of generic solution parsers
2016-05-18 16:50:26 +02:00
Manuel Dobusch 2f25279662 logic: vs solution parsing fix
Fixed issue with vs internal macros
2016-05-18 14:19:41 +02:00
Eberhard Graether e943ef149e ui: Added more settings to the preferences
Added font face, font size, tab width, analysis threads
2016-05-18 11:15:28 +02:00
malte_langkabel e40459e71d src: storage refactoring
* used the getFirst/getAll template methods throughout the SqliteStorage.
* renamed LambdaTask to TaskLambda to match our naming convention.
2016-05-17 17:09:18 +02:00
malte_langkabel cb9dde6641 logic: fix local symbols in lambda
* fixed the isImplicit method of the ASTVisitor to use the parent context to determine if a lambda record is implicit.
2016-05-17 16:30:26 +02:00
Eberhard Graether 4097493181 ui: Sort snippets to always show definition on top 2016-05-17 15:26:45 +02:00
Eberhard Graether 9f80bcbcb7 ui: Fixed nodes not sorted when expanding in overview 2016-05-17 14:47:36 +02:00
Eberhard Graether 79f788db2e ui: sort buckets in graph layout alphabetically and put bundles at end 2016-05-17 14:28:22 +02:00
malte_langkabel 67e4d84631 logic: indexer count and fixes
* added option to define the amount of parallel indexers in the appsettings
* fixed unparsed files query in ASTVisitor
* fixed: to update a node's type in the storage the node does not have to be defined anymore
2016-05-13 16:30:16 +02:00
Eberhard Graether 7bb40f2630 logic: Simplified node bundling by collecting relevant data upfront 2016-05-13 14:17:20 +02:00
malte_langkabel c61efbbcde logic: multithreaded parsing
* modified the TaskParseCxx to be able to run multiple times in parallel
* made FileRegister threadsafe and changed a lot of its mechanisms
* added TaskGroupParallel that runs all children in parallel
* added TaskParseWrapper that acts as a decorator to execute some code before and after parsing.
* implemented task setup in project with 4 parsing threads
* removed SimpleTask as it was only used as interface for the LambdaTask
2016-05-13 13:23:54 +02:00
Eberhard Graether 245cafdc7b logic: Improved code view performance
* fixed bottleneck in TokenLocationCollection::findLocationFile()
* cache file ids and paths in PersistenStorage
2016-05-12 22:50:14 +02:00
malte_langkabel 6a576bccc9 src: storage refactoring
* renamed Storage to PersistentStorage
* added Storage as baseclass that implements data injection
* cleaned ParserClient interface
* added default constructors for storage types
* cleaned SqlteStorage by implementing the private getAll methods as template specializations
* added CXX flags to CMakeLists (this is needed for sqlite with visual studio)
* removed TestStorage.h/.cpp since these files were not used anymore.
2016-05-11 13:23:31 +02:00
Andreas Stallinger 2a73c42a18 ui: Colorscheme update for Fulltextsearch 2016-05-10 15:34:06 +02:00
Eberhard Graether 9148a4fafb ui: Fixed file button in code file title bar not visible 2016-05-10 14:25:39 +02:00
Eberhard Graether c4ef18fb6d web: Added jekyll blog with hpstr theme and first post for release 0.6
The README contains the commands for building the blog in all different configurations.
2016-05-10 14:10:21 +02:00
Andreas Stallinger e775ae1ecd logic: Fulltextsearch
* fulltextsearch enabled in sqlite
* fulltextsearch start search with @
* codeview performance improved
* strip sRGB profile from png files to get rid of libpng warning at runtime
2016-05-10 11:10:13 +02:00
malte_langkabel 30faa7e52f ui: fix codeview scrollbar and search crash
* fixed size policies of codeview elements to prevent the codeview from having a global scrollbar
* fixed crash in sorting of search results
* removed debug log when panning a codesnippet
2016-05-04 18:38:53 +02:00
malte_langkabel 75ced4b775 build: update to clang 3.8
* removed unsupported method from ASTVisitor after updating to clang 3.8
2016-05-03 15:59:59 +02:00
malte_langkabel 8ef6d77c50 web: documentation updates 2016-04-27 15:14:48 +02:00
Andreas Stallinger bdf713f078 documentation: Use Bear to generate compilation database 2016-04-27 14:58:57 +02:00
Eberhard Graether 999522ca20 docs: updated changelog and documentation 2016-04-27 12:15:03 +02:00
malte_langkabel 000938cf8c build: installer fix
<description>
2016-04-26 18:50:55 +02:00
Eberhard Graether 3ef9db3a84 ui: removed us of utf8 circle due to Linux issues
* Use dot.png in status bar again
* use * for out-dated files
2016-04-26 18:36:50 +02:00
Eberhard Graether 3d2d434125 ui: Added cancel button to enter license window 2016-04-26 18:28:57 +02:00
malte_langkabel 9a92422984 ui: fixed error circle for windows
<description>
2016-04-26 17:36:14 +02:00
Eberhard Graether 32dc545a60 ui: Added welcome message to trial 2016-04-26 17:33:47 +02:00
malte_langkabel bfb6b458b3 build: windows version number updates
* updated version number of windows installers for app and trial
* updated visual studio plugin version number and plugin meta information
2016-04-26 17:23:38 +02:00
Eberhard Graether fd905f76e5 ui: Updates for release
* updated color scheme highlight colors
* fixed highlight color resetting
* prevent project file being save with no changes
* fixed MessageListener crash due to alive flag being set too late
* new edit project icon
2016-04-26 16:40:09 +02:00
malte_langkabel 279f7410d3 build: optional start menu shortcut on windows 2016-04-26 14:28:35 +02:00
malte_langkabel 4063afb3b0 ui: codeview fixes
* fixed file out of date icon to be displayed correctly on windows
* added tooltip for edit project button when codeview is in overview state
2016-04-26 12:21:09 +02:00
malte_langkabel 038991ce39 ui: linux high dpi fix
* disabled qt high dpi auto scaling on every platform but windows since it doesn't do anything on mac and screws up everything on linux.
2016-04-26 10:30:35 +02:00
Andreas Stallinger c3a148833b src: string replace fix in filepath 2016-04-26 08:51:46 +02:00
Eberhard Graether f9aed67776 src: Various fixes from testing
* fixed deleted project could still be selected in the recent project menu
* fixed project file not loaded when declining for reload
* fixed main in tutorial description not clickable
* fixed clang warnings
* fixed commands not showing up in autocompletion
* fixed classes were expanded when activating aggregation
* fixed crash when messagelisteners tried to unregister after messagequeue was destructed
2016-04-25 17:27:20 +02:00
malte_langkabel e17c42b2ef ui: fixed show files in project settings
* FilePath::relativeTo(...) did not return correct results for non-canonical paths (for a base path containing "/foo/.." it would prepend "../" two times instead of omitting it).
2016-04-25 16:45:29 +02:00
malte_langkabel 932ef67fc7 build: deploy edit icon on windows
* added edit icon to windows setup projects.
2016-04-25 15:41:39 +02:00
malte_langkabel e86479be20 data: implicit local symbol fix
* prevented recording of local symbols that are part of implicit code (like the parameter of an implicit copy constructor).
2016-04-25 15:32:57 +02:00
malte_langkabel 4b4d2157eb build: windows deploy fixes
* added home button icon to windows installer projects
* changed deploy script to build the coati dbs in headless mode
2016-04-25 13:30:41 +02:00
Eberhard Graether 69925917bc ui: Added edit project button to stats in overview 2016-04-25 12:39:10 +02:00
malte_langkabel 55660563c8 ui: fixed panning in code
* fixed bug where panning stopped when hovering the line number area in the code view.
* when relasing the mouse button on a clickable code location after panning the location is not activated.
2016-04-25 10:29:55 +02:00
Eberhard Graether 6bca5d2964 ui: Removed simple setup as distinct step from project setup and moved it to include paths 2016-04-24 23:58:48 +02:00
Eberhard Graether 6be207a68a logic: Ask user before reparsing the project
While the message box with the question is visible the ui is blocked. A message appears when:
* when project was edited
* when preferences were edited
* when project file has more recent changes than db
* when db has a different version than Coati
2016-04-24 22:47:39 +02:00
Eberhard Graether a6e57a6564 logic: Show error message when license expired
* moved all license checking logic to LicenseChecker
* create LicenseChecker instance in app
* Notify MainView with MessageForceEnterLicense
2016-04-22 13:58:13 +02:00
malte_langkabel 73973cb4a3 logic: headless license check
* added license check when running coati in headless more.
2016-04-22 13:45:56 +02:00
malte_langkabel 3e90b62c82 build: qt dll update
* updated qt dlls to our current version of qt (before the dlls of the qt 5.6 beta release have been used).
2016-04-22 11:03:49 +02:00
Eberhard Graether 1b23a44f20 logic: Fixed bundling of referencing types 2016-04-22 00:09:43 +02:00
Eberhard Graether 780530ba3c ui: Show undefined nodes when activating namespace 2016-04-21 23:25:07 +02:00
Eberhard Graether 96ec7e9fa3 build: updated Mac bundle script to Qt 5.6 2016-04-21 23:14:38 +02:00
malte_langkabel 013d528c6b web: added local variables to documentation 2016-04-21 16:29:21 +02:00
Eberhard Graether 526f966356 ui: Fixed path checking in project setup wizzard 2016-04-21 16:11:00 +02:00
malte_langkabel b5bcabb494 ui: qt high dpi scaling
* Enabled automatic scaling for high dpi systems that has been introduced with qt 5.6. This is only a temporary solution. We should change the ui code to use only em scales instead of pixels.
2016-04-21 15:41:57 +02:00
Eberhard Graether 3fe3bcb25d ui: Improved style of error label in status bar
* use utf8 circle instead of dot.png
* underline on hover
2016-04-21 14:47:58 +02:00
Eberhard Graether 2417d27069 ui: Show circle next to file that are out of date 2016-04-21 14:29:10 +02:00
Eberhard Graether 5c52bc6060 ui: Removed Code Blocks project type button 2016-04-21 13:31:45 +02:00
malte_langkabel 19d91da108 build: more dlls for windows installer
* manually added some dlls that may be missing on some windows systems.
2016-04-21 13:18:31 +02:00
malte_langkabel 4ec89e71ca src: code refactoring
* added SymbolType that can be used by ASTVisitor and ParserClient
* reordered some of the ParserClient's methods.
* removed return type of ParserClient methods.
2016-04-21 12:26:49 +02:00
Eberhard Graether 36d17123f3 data: Added sql index for local symbol names to speed up analysis 2016-04-21 11:00:08 +02:00
Eberhard Graether 40144bbcb9 logic: Retrieving StorageNodes for Autocompletion and FileInfos for modification time at once
Had only a small impact on performance unfortunately.
2016-04-20 23:39:21 +02:00
Eberhard Graether 03675e1658 logic: Fixed declaration locations sometimes not visible 2016-04-20 21:41:26 +02:00
malte_langkabel 1bf721588b build: windows installer dlls
* removed redistributable as prerequisit from installer
* added merge module for these dlls to the installer
* added "my_next_step.h" for the tutorial project to the installer
* renamed visual studio plugin
* updated deploy_windows script to use vs14 to build the installers
2016-04-20 18:18:10 +02:00
Eberhard Graether c380854b34 utility: removed unused flag :isFromSystem from MessageActivateNodes/Tokens 2016-04-20 16:34:21 +02:00
Eberhard Graether 3ee5f261d6 utility: Fixed utility::append for vector was actually prepending 2016-04-20 16:28:29 +02:00
Eberhard Graether 1a843db3b7 logic: Tweaked autocompletions results
* mix command and token results
* tweaked scoring
* added scoring for matched letters after non letters like _
* increased performance by removing separate sort step using single results vector in recursive search
* made sorting alphabetical: A < a < B < b
2016-04-20 16:00:26 +02:00
malte_langkabel ea4acef2de logic: codeview activation policy
* changed activation policy of codeview to activate implicit nodes only when no explicit or undefined nodes are found for the clicked code location.
2016-04-20 13:24:03 +02:00
Eberhard Graether ce5c3e8626 ui: Added timer stopper to QtGraphicsView to stop movement if keyup event not registered 2016-04-19 23:13:41 +02:00
Eberhard Graether f19cdc3bb9 ui: Fixed text color resetting in code view 2016-04-19 22:49:49 +02:00
malte_langkabel 6069dfedc1 src: fixed redo crash
* fixed crash when redoing the last action on redostack
2016-04-19 16:40:49 +02:00
Eberhard Graether 661dbd844c ui: Show undefined child nodes in graph
So far pure virtual methods where not shown when activating the interface class.
2016-04-19 16:37:44 +02:00
Eberhard Graether deccf2734c utility: Fixed FilePath::canonical() still used uninitialized m_exists 2016-04-19 14:53:50 +02:00
Eberhard Graether 5cb06c9bb0 data: Fixed ASTVisitor to not use Node::NodeType 2016-04-19 14:52:08 +02:00
malte_langkabel 29ef349f61 data: recording function pointers
* added recording of references to the ASTVisitor.
* refactored reference recording in ASTVisitor.
* merged all the onXxxUsageParsed methods of the ParserClient.
2016-04-19 13:32:09 +02:00
Eberhard Graether 5d71536bb1 logic: Fixed sorting of search results and crash in undo redo controller 2016-04-19 12:38:03 +02:00
Eberhard Graether 7cd38f8e56 logic: Fixed FilePath to not expand environment variables in constructor 2016-04-19 00:13:02 +02:00
Eberhard Graether a57f24b2b2 logic: rewrote UndoRedoController to differentiate 3 types of priority
ORDER_ACTIVATE for messages that change active symbols
ORDER_ADAPT for graph and code view expanding and collapsing
ORDER_VIEW for scrolling and local symbol activation
2016-04-18 22:38:20 +02:00
malte_langkabel c7940eb34f ui: sorting search results
* search results are sorted by: score > length > name
* fixed crash that occurred when trying to get a node by id with id == 0
2016-04-18 14:05:27 +02:00
Eberhard Graether 325bc6ac83 ui: Text color for highlights in code view
* Deactivate local symbols by clicking into void
* Refactored QtHightlighter to only highlight once
* Removed undo for local symbol activation
2016-04-18 12:34:35 +02:00
malte_langkabel 985be86da0 ui: tutorial update
* mentioned local symbols in tutorial
* mentioned home button in tutorial
2016-04-18 11:50:44 +02:00
Andreas Stallinger 298fd6cf3e ui: Enterlicense quit button
Quit button only for forced enterlicensewindow
2016-04-18 11:08:44 +02:00
malte_langkabel 530e20ede6 logic: added include path detector for visual studio 2016-04-15 14:06:17 +02:00
malte_langkabel 3cb15f1754 build: script fixes
* regex removed in hook since it was not working on windows.
* fixed method for getting the script's path for windows. using this in setup and clean script.
* fixed missing include in cmakelists
2016-04-15 13:57:46 +02:00
Eberhard Graether e68177b634 ui: Fixed backspace not working when focus is on graph 2016-04-15 11:16:38 +02:00
Andreas Stallinger 637cbf88ac fix: handle boost error while recursive directory iteration
handle boostrecursive directory search error
ption>
2016-04-14 16:38:46 +02:00
malte_langkabel 73ee3a27d9 logic: iterated on license checking
- moved LicenseChecker from App to Lib project
- added MessageDispatchWhenLicenseValid. This message takes another message as an argument which is dispatched once the LicenseChecher confirms the current license key or (if the key is invalid) once the user entered a valid key. This message is used when messages are sent that should not be working when no license key has been entered (LoadProject or ActivateTokenLocation via the IDE communication).
- added MessageShowStartScreen which makes the MainView display this screen. This message is also sent via the MessageDispatchWhenLicenseValid.
- removed startup project from appsettings.
2016-04-14 15:25:40 +02:00
Andreas Stallinger a2cba0b94f logic: enviroment variable handling
* expanding env vars for existsens check
* expand source paths in filemanager
2016-04-14 13:39:48 +02:00
Eberhard Graether 9534ccb454 ui: fixed QtDirectoryListBox not sized correctly when overwriting list 2016-04-14 12:57:13 +02:00
Andreas Stallinger 23fbe6c384 script: move forced test to precommit hook
NOTE: run setup.sh script to update the hooks
* commit message after building and testing
* pushing tags does not run builds and tests
2016-04-14 11:46:53 +02:00
Eberhard Graether bee3961040 logic: Fixed implict children of implicit classes not shown in graph 2016-04-13 14:44:39 +02:00
Eberhard Graether 8d2709a2ad ui: added shortcut and menu item for "To overview" and updated documentation 2016-04-13 13:45:39 +02:00
Eberhard Graether ad8abd9182 ui: Added home button left of search bar to return to overview
bug id = 40
2016-04-13 13:05:02 +02:00
Eberhard Graether fcc39f4a77 ui: Improved user experience of error display
* label errors as errors instead of references in file snippet headers
* show number of fatal errors in file snippet headers as well
* only show the first 10 error snippets open, remaining collapsed
* don't show status message after parsing in red on errors
* don't show stats of parsing when project was only loaded
2016-04-13 12:14:55 +02:00
Andreas Stallinger 4eef42d15c ui: Startscreen Messagebox to delete missing coatiprojectfiles 2016-04-12 14:13:15 +02:00
Eberhard Graether b088ca6adf logic: show subnamespaces as nodes instead of their children 2016-04-12 13:39:42 +02:00
malte_langkabel b9c4bd05cd data: showing local symbols
- added local symbols to storage
- added tests for local symbol parsing
- added MessageActivateLocalSymbols to activate local symbols in code view
- TokenLocations now store their LocationType instead of a plain bool "isScope"
- moved LocationType from TokenLocation to separate file, since it is also used in Annotations now.
- added local_symbol in stylesheet to define a style for hovering and activating these elements
- renamed location to token in stylesheet
2016-04-12 13:28:37 +02:00
Andreas Stallinger a448485b35 build: linux package change to qt5.6 2016-04-12 12:58:06 +02:00
Eberhard Graether 9307d6d855 logic: Refactored namespace activation
* show namespace name in search view when activated
* show namespace definitions in code view when activated
* no children in namespace
* no implicit nodes in overview or namespace
* Show a maximum of 10 open snippets
* Fixed bug causing nodes in GraphView to be stacked at 0,0
2016-04-12 11:59:37 +02:00
Eberhard Graether e8e6b909a8 logic: Fixed referencing of nodes in GraphController::bundleNodesByType 2016-04-12 11:05:29 +02:00
Eberhard Graether 78287dd694 logic: increased performance of bundleEdgesByType for overview 2016-04-08 14:31:46 +02:00
Eberhard Graether ae6cd6e02c logic: don't show implicit or undefined child nodes in graph unless connected
* visit implicit declarations in ASTVisitor
* show implicit and undefined child nodes only when connected
* fixed some bundle edges couldn't be split
* add "implicit" to tooltip
* show undefiend and implicit nodes hatched
2016-04-07 14:16:17 +02:00
malte_langkabel 7a0cd0c8d7 src: project load performance
removed unused fields from StorageStats to improve project loading performance.
2016-04-07 13:18:41 +02:00
malte_langkabel 7bc2f2b548 logic: improved fuzzysearch score calculation 2016-04-06 17:07:13 +02:00
Eberhard Graether 73e77a1baa docu: updated edge aggregation 2016-04-06 11:41:29 +02:00
Eberhard Graether 5e6714d95a ui: Added user interface for auto system header search paths detection
* moved detection files to lib_gui
* added ui to global header search and framework search ui in project wizzard and preferences
* detecting the search paths will add them to the list if not added yet
* only detected compilers are shown in the dropdown list
2016-04-06 11:23:20 +02:00
Eberhard Graether 93f21283f6 ui: improved angled edges and new style of aggregation
* added different routing options for horizontal, vertical or any
* added different pivot options to connect in the middle or at thirds
* changed aggregation to angled edge with thickness logarithmic to weight
* aggregation to pivot at middle and route any direction
* aggregation weight displayed in tooltip
* inheritance to route vertical
2016-04-04 21:05:39 +02:00
Andreas Stallinger 2ffec90c19 ui: startscreen display not existing project
* displays moved or deleted recent projects as disabled button
2016-04-04 20:43:56 +02:00
malte_langkabel f3dc12b0ed logic: search ui performance optimization
* replaced the implementation of the search index. the search index now uses a search-trie. edges have gates that can be used to check if a character can be matched when following the edge.
* SearchMatches now have a text and a list of NameHierarchies that share this node (instead of Ids, so that nodes must be found by names (which makes sure that SearchMatches are still valid after refresh).
* when parsing a project's description the CodeController now looks for NameHierarchies instead of SearchNode names to find ids of linked elements.
2016-04-04 15:39:39 +02:00
Andreas Stallinger ffc00829f0 ui: Bug Tracker in Menu 2016-04-04 14:39:09 +02:00
Andreas Stallinger e5bf177241 utility: Standardheadersearch
Standardheadersearch for clang and gcc
TODO: Visual Studio & Windows Kit bzw SDK
2016-04-04 14:13:32 +02:00
Eberhard Graether 31f366ab8f ui: Increased graph edge drawing performance
* only draw lines within the redrawn rectangle
* cache polygon points
2016-04-01 15:26:44 +02:00
Andreas Stallinger 2be3b541a6 fix: vs detector fix for wrong published headersearch stuff 2016-03-30 17:56:20 +02:00
Andreas Stallinger 03901e8173 logic: Test License is valid on day 0
* License was invalid on expire date
* build script does not start app after failing build
* symlink on linux
2016-03-30 15:49:08 +02:00
Manuel Dobusch fe74dfb7cc logic: vs plugin upgrade
Upgraded plugin project to vs 2015. Can now serve all targets (vs 2012 to 2015) with one binary.
2016-03-30 14:04:47 +02:00
Manuel Dobusch b75dd2abe1 logic: vs compiler flags
Added compiler flags from VS solution and vs compatibility flags.
2016-03-30 13:37:37 +02:00
Eberhard Graether cec370cfff data: Improved graph retrieval to use fixed number of requests 2016-03-30 12:26:19 +02:00
Andreas Stallinger a662424e2b logic: Test License
Test license for x days
License_generator flag -e <days>
2016-03-29 15:37:58 +02:00
Eberhard Graether ac506622b4 src: Fixed template function specialization defined within class definition caused clang error 2016-03-29 12:13:42 +02:00
malte_langkabel 880a199540 ui: changed the display format of the parse duration to "hh:mm:ss" 2016-03-24 10:44:09 +01:00
Manuel Dobusch 82db193c78 logic: solution parsing refactor
Refactored solution parser handling to make it more generic
Also includes new parser (wip)
2016-03-23 17:06:40 +01:00
malte_langkabel bac394381c ui: codeview show fully qualified scope names 2016-03-23 15:44:27 +01:00
malte_langkabel fee1d97604 ui: moved recent projects submenu
* moved the menu entry for "recent projects" to be placed close to "open project"
* replaced enum for MaxRecentProjectsCount in AppSettings by a getter function.
2016-03-23 14:15:30 +01:00
malte_langkabel d1a4bc7b08 src: small code cleanup 2016-03-22 10:14:59 +01:00
malte_langkabel 6743336f03 data: tweaked refresh for performance 2016-03-21 15:29:19 +01:00
1032 changed files with 116546 additions and 11786 deletions
+9 -1
View File
@@ -5,6 +5,7 @@
/bin/app/Debug/
/bin/app/Release/
/bin/app/data/projects/ignored/
/bin/app/data/java/
/bin/app/user/log/
/bin/app/user/ApplicationSettings.xml
/bin/app/user/window_settings.ini
@@ -23,7 +24,10 @@
/bin/test/data/temp.xml
/bin/test/data/TestSettings.xml
/setup/Linux/lib/*
/java_indexer/bin/
/java_indexer/lib/
/setup/Linux/lib/
.DS_Store
.idea
@@ -40,7 +44,10 @@
.clang_complete
.ycm_extra_conf.py
.ycm_extra_conf.pyc
coati.coatiproject
compile_commands.json
Makefile
/__pycache__/
/deployment/windows/CoatiAppSetup/CoatiSetup/Debug
/deployment/windows/CoatiAppSetup/CoatiSetup/Release
@@ -64,3 +71,4 @@ compile_commands.json
/deployment/windows/CoatiTrialSetup/SetupRemoveCacheFiles/bin/
/deployment/windows/CoatiTrialSetup/SetupRemoveCacheFiles/obj/
/deployment/windows/wixSetup/
+138 -124
View File
@@ -1,9 +1,4 @@
cmake_minimum_required(VERSION 2.8.9)
# to get CMP0043 warnings, upgrade to version 3 and change the line above to VERSION 3.0 and remove the line below
if(POLICY CMP0043)
cmake_policy(SET CMP0043 OLD)
endif()
cmake_minimum_required(VERSION 3.1)
include(cmake/add_files.cmake)
include(cmake/create_source_groups.cmake)
@@ -11,8 +6,6 @@ include(cmake/version.cmake)
include(cmake/version_setup.cmake)
include(cmake/licenses.cmake)
# set Standerd build type to Release
set(CMAKE_BUILD_TYPE_INIT "Release")
# Variables --------------------------------------------------------------------
@@ -36,26 +29,35 @@ else ()
set(PLATFORM_INCLUDE "includesLinux.h")
endif ()
# Settings ---------------------------------------------------------------------
if (UNIX)
add_definitions(-std=c++11 -Wno-unknown-warning-option -fcolor-diagnostics -DQT_COMPILING_QSTRING_COMPAT_CPP )
endif ()
# Project ----------------------------------------------------------------------
project(${PROJECT_NAME})
# set Standard build type to Release
set(CMAKE_BUILD_TYPE_INIT "Release")
#RPATH
if(UNIX AND NOT APPLE)
set(CMAKE_SKIP_BUILD_RPATH FALSE)
set(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE)
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
set(CMAKE_INSTALL_RPATH "$ORIGIN/lib/:$$ORIGIN/lib/")
include(cmake/external.cmake)
include(cmake/external.cmake)
endif()
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_C_STANDARD 99)
# Settings ---------------------------------------------------------------------
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unknown-warning-option -fcolor-diagnostics")
endif()
if (UNIX)
#add_definitions(-std=c++11 -Wno-unknown-warning-option -fcolor-diagnostics -DQT_COMPILING_QSTRING_COMPAT_CPP )
add_definitions(-fno-omit-frame-pointer -DQT_COMPILING_QSTRING_COMPAT_CPP )
endif ()
# Clang ------------------------------------------------------------------------
@@ -66,7 +68,7 @@ if (UNIX AND APPLE)
find_package(LLVM REQUIRED PATHS "$ENV{CLANG_DIR}/build_debug/share/llvm/cmake" NO_DEFAULT_PATH)
endif()
elseif(UNIX)
find_package(LLVM REQUIRED PATHS "${EXTERNAL_BUILD}/llvm/share/llvm/cmake" NO_DEFAULT_PATH)
find_package(LLVM REQUIRED PATHS "${EXTERNAL_BUILD}/llvm/share/llvm/cmake" NO_DEFAULT_PATH)
else()
find_package(LLVM REQUIRED PATHS "$ENV{CLANG_DIR}/build/share/llvm/cmake")
endif()
@@ -78,9 +80,9 @@ add_definitions(${CLANG_DEFINITIONS})
# Boost ------------------------------------------------------------------------
if(UNIX AND NOT APPLE)
set(BOOST_ROOT ${EXTERNAL_BUILD}/boost)
set(BOOST_ROOT ${EXTERNAL_BUILD}/boost)
else()
set(BOOST_ROOT $ENV{BOOST_159_DIR})
set(BOOST_ROOT $ENV{BOOST_159_DIR})
endif()
set(Boost_USE_MULTITHREAD ON)
set(Boost_USE_STATIC_LIBS ON)
@@ -94,9 +96,9 @@ find_package(Boost 1.59 COMPONENTS system program_options filesystem date_time R
add_definitions(-DEIGEN_MPL2_ONLY)
if(UNIX AND NOT APPLE)
set(EIGEN_ROOT ${EXTERNAL_SRC}/eigen)
set(EIGEN_ROOT ${EXTERNAL_SRC}/eigen)
else()
set(EIGEN_ROOT $ENV{EIGEN_DIR})
set(EIGEN_ROOT $ENV{EIGEN_DIR})
endif()
# Botan -------------------------------------------------------------------------
@@ -104,104 +106,25 @@ endif()
set(BOTAN_VERSION "botan-1.11")
if(UNIX AND APPLE)
find_library(BOTAN ${BOTAN_VERSION} $ENV{BOTAN_DIR}/release NO_DEFAULT_PATH)
find_library(BOTAN_D ${BOTAN_VERSION} $ENV{BOTAN_DIR}/debug NO_DEFAULT_PATH)
find_library(BOTAN ${BOTAN_VERSION} $ENV{BOTAN_DIR}/release NO_DEFAULT_PATH)
find_library(BOTAN_D ${BOTAN_VERSION} $ENV{BOTAN_DIR}/debug NO_DEFAULT_PATH)
elseif(UNIX)
find_library(BOTAN ${BOTAN_VERSION} "${EXTERNAL_BUILD}/botan" NO_DEFAULT_PATH)
find_library(BOTAN ${BOTAN_VERSION} "${EXTERNAL_BUILD}/botan" NO_DEFAULT_PATH)
else()
find_library(BOTAN botan "$ENV{BOTAN_DIR}/release")
find_library(BOTAN botan "$ENV{BOTAN_DIR}/release")
find_library(BOTAN_D botan "$ENV{BOTAN_DIR}/debug")
endif()
if(${BOTAN} STREQUAL "BOTAN-NOTFOUND")
message(FATAL_ERROR "Botan not found")
message(FATAL_ERROR "Botan not found")
else()
message(STATUS "Botan found")
message(STATUS "Botan found")
endif()
if(UNIX AND NOT APPLE)
set(BOTAN_INCLUDE_DIR "${EXTERNAL_BUILD}/botan")
set(BOTAN_INCLUDE_DIR "${EXTERNAL_BUILD}/botan")
else()
set(BOTAN_INCLUDE_DIR "$ENV{BOTAN_DIR}")
set(BOTAN_INCLUDE_DIR "$ENV{BOTAN_DIR}")
endif()
# Lib --------------------------------------------------------------------------
#set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/bin/lib)
#set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/bin/lib)
add_subdirectory(src/lib)
add_subdirectory(src/external)
set_source_files_properties(${EXTERNAL_FILES} PROPERTIES COMPILE_FLAGS "-w")
set_source_files_properties(${EXTERNAL_C_FILES} PROPERTIES COMPILE_FLAGS "-std=gnu89 -w")
add_library(${LIB_PROJECT_NAME} ${LIB_FILES} ${EXTERNAL_FILES} ${EXTERNAL_C_FILES})
create_source_groups(${LIB_FILES})
create_source_groups(${EXTERNAL_FILES})
create_source_groups(${EXTERNAL_C_FILES})
set_target_properties(
${LIB_PROJECT_NAME}
PROPERTIES
DEBUG_OUTPUT_NAME ${PROJECT_NAME}_d
RELEASE_OUTPUT_NAME ${PROJECT_NAME}
)
set_property(
TARGET ${LIB_PROJECT_NAME}
PROPERTY INCLUDE_DIRECTORIES
"${CMAKE_SOURCE_DIR}/src/lib"
)
target_include_directories(${LIB_PROJECT_NAME} SYSTEM
PUBLIC ${LLVM_INCLUDE_DIRS}
${CLANG_INCLUDE_DIRS}
${Boost_INCLUDE_DIRS}
${EIGEN_ROOT}
"${CMAKE_SOURCE_DIR}/src/external"
)
target_link_libraries(${LIB_PROJECT_NAME} ${Boost_LIBRARIES})
# Lib Parser -------------------------------------------------------------------
#set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/bin/lib_parser)
#set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/bin/lib_parser)
add_subdirectory(src/lib_parser)
set_source_files_properties(${CLANG_FILES} PROPERTIES COMPILE_FLAGS "-fno-rtti")
add_library(${LIB_PARSER_PROJECT_NAME} ${CLANG_FILES})
create_source_groups(${CLANG_FILES})
set_property(
TARGET ${LIB_PARSER_PROJECT_NAME}
PROPERTY INCLUDE_DIRECTORIES
"${CMAKE_SOURCE_DIR}/src/lib_parser"
"${CMAKE_SOURCE_DIR}/src/lib"
)
set_target_properties(
${LIB_PARSER_PROJECT_NAME}
PROPERTIES
DEBUG_OUTPUT_NAME ${LIB_PARSER_PROJECT_NAME}_d
RELEASE_OUTPUT_NAME ${LIB_PARSER_PROJECT_NAME}
)
target_include_directories(${LIB_PARSER_PROJECT_NAME} SYSTEM
PUBLIC ${LLVM_INCLUDE_DIRS}
${CLANG_INCLUDE_DIRS}
${Boost_INCLUDE_DIRS}
)
link_directories(${LLVM_LIBRARY_DIRS} ${CLANG_LIBRARY_DIRS} ${Boost_LIBRARY_DIRS})
llvm_map_components_to_libnames(REQ_LLVM_LIBS support core libdriver)
#target_link_libraries(${LIB_PARSER_PROJECT_NAME} ${CLANG_LIBRARIES} ${LLVM_AVAILABLE_LIBS})
target_link_libraries(${LIB_PARSER_PROJECT_NAME} ${CLANG_LIBRARIES} ${REQ_LLVM_LIBS})
# Lib License -------------------------------------------------------------------
#set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/bin/lib_license)
@@ -230,7 +153,7 @@ target_include_directories(${LIB_LICENSE_PROJECT_NAME} SYSTEM
PUBLIC
${Boost_INCLUDE_DIRS}
${LIB_LICENSE_PROJECT_NAME}
${BOTAN_INCLUDE_DIR}
${BOTAN_INCLUDE_DIR}
)
# target_include_directories(${LIB_LICENSE_PROJECT_NAME} optimized "$ENV{BOTAN_DIR}/release")
@@ -246,6 +169,91 @@ else()
target_link_libraries(${LIB_LICENSE_PROJECT_NAME} optimized ${BOTAN})
endif()
# Lib --------------------------------------------------------------------------
#set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/bin/lib)
#set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/bin/lib)
find_package(JNI)
add_subdirectory(src/lib)
add_subdirectory(src/external)
set_source_files_properties(${EXTERNAL_FILES} PROPERTIES COMPILE_FLAGS "-w")
set_source_files_properties(${EXTERNAL_C_FILES} PROPERTIES COMPILE_FLAGS "-std=gnu89 -w")
add_library(${LIB_PROJECT_NAME} ${LIB_FILES} ${EXTERNAL_FILES} ${EXTERNAL_C_FILES})
create_source_groups(${LIB_FILES})
create_source_groups(${EXTERNAL_FILES})
create_source_groups(${EXTERNAL_C_FILES})
set_target_properties(
${LIB_PROJECT_NAME}
PROPERTIES
DEBUG_OUTPUT_NAME ${PROJECT_NAME}_d
RELEASE_OUTPUT_NAME ${PROJECT_NAME}
)
set_property(
TARGET ${LIB_PROJECT_NAME}
PROPERTY INCLUDE_DIRECTORIES
"${CMAKE_SOURCE_DIR}/src/lib"
"${CMAKE_SOURCE_DIR}/src/lib_license"
"${CMAKE_SOURCE_DIR}/build/src/lib_license"
)
target_include_directories(${LIB_PROJECT_NAME} SYSTEM
PUBLIC ${LLVM_INCLUDE_DIRS}
${CLANG_INCLUDE_DIRS}
${Boost_INCLUDE_DIRS}
${EIGEN_ROOT}
${JNI_INCLUDE_DIRS}
"${CMAKE_SOURCE_DIR}/src/external"
)
target_link_libraries(${LIB_PROJECT_NAME} ${Boost_LIBRARIES} ${LIB_LICENSE_PROJECT_NAME})
# Lib Parser -------------------------------------------------------------------
#set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/bin/lib_parser)
#set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/bin/lib_parser)
add_subdirectory(src/lib_parser)
set_source_files_properties(${CLANG_FILES} PROPERTIES COMPILE_FLAGS "-fno-rtti")
add_library(${LIB_PARSER_PROJECT_NAME} ${CLANG_FILES})
create_source_groups(${CLANG_FILES})
set_property(
TARGET ${LIB_PARSER_PROJECT_NAME}
PROPERTY INCLUDE_DIRECTORIES
"${CMAKE_SOURCE_DIR}/src/lib_parser"
"${CMAKE_SOURCE_DIR}/src/lib"
)
set_target_properties(
${LIB_PARSER_PROJECT_NAME}
PROPERTIES
DEBUG_OUTPUT_NAME ${LIB_PARSER_PROJECT_NAME}_d
RELEASE_OUTPUT_NAME ${LIB_PARSER_PROJECT_NAME}
)
target_include_directories(${LIB_PARSER_PROJECT_NAME} SYSTEM
PUBLIC ${LLVM_INCLUDE_DIRS}
${CLANG_INCLUDE_DIRS}
${Boost_INCLUDE_DIRS}
${JNI_INCLUDE_DIRS}
)
link_directories(${LLVM_LIBRARY_DIRS} ${CLANG_LIBRARY_DIRS} ${Boost_LIBRARY_DIRS})
llvm_map_components_to_libnames(REQ_LLVM_LIBS support core libdriver)
target_link_libraries(${LIB_PARSER_PROJECT_NAME} ${CLANG_LIBRARIES} ${REQ_LLVM_LIBS})
# Lib Gui ----------------------------------------------------------------------
#set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/bin/lib_gui)
@@ -260,14 +268,14 @@ set(CMAKE_AUTOMOC ON)
# Find the QtWidgets library
if(UNIX AND NOT APPLE)
set(CMAKE_PREFIX_PATH ${EXTERNAL_BUILD}/qt)
set(CMAKE_PREFIX_PATH ${EXTERNAL_BUILD}/qt)
else()
set(CMAKE_PREFIX_PATH "$ENV{QT_DIR}/")
set(CMAKE_PREFIX_PATH "$ENV{QT_DIR}/")
endif()
if(UNIX AND APPLE)
set(Qt5Widgets_DIR "$ENV{QT_DIR}/cmake/Qt5Widgets/")
set(Qt5PrintSupport_DIR "$ENV{QT_DIR}/cmake/Qt5PrintSupport/")
set(Qt5Widgets_DIR "$ENV{QT_DIR}/cmake/Qt5Widgets/")
set(Qt5PrintSupport_DIR "$ENV{QT_DIR}/cmake/Qt5PrintSupport/")
endif()
find_package(Qt5Widgets)
@@ -275,11 +283,11 @@ find_package(Qt5PrintSupport)
find_package(Qt5Network)
if(Qt5Widgets_FOUND)
MESSAGE(STATUS "Found Qt ${Qt5Widgets_VERSION_STRING}")
# FIX: Qt was built with -reduce-relocations
if (Qt5_POSITION_INDEPENDENT_CODE)
SET(CMAKE_POSITION_INDEPENDENT_CODE ON)
endif()
MESSAGE(STATUS "Found Qt ${Qt5Widgets_VERSION_STRING}")
# FIX: Qt was built with -reduce-relocations
if (Qt5_POSITION_INDEPENDENT_CODE)
SET(CMAKE_POSITION_INDEPENDENT_CODE ON)
endif()
endif()
# target for running versionnumber script
@@ -297,7 +305,7 @@ add_custom_command(
COMMAND ${CMAKE_COMMAND} -P ${CMAKE_SOURCE_DIR}/cmake/version.cmake
BYPRODUCTS ${PROJECT_SOURCE_DIR}/build/src/lib_gui/version.h
DEPENDS ${LIB_GUI_PROJECT_NAME}
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
COMMENT "check/update version number"
)
add_dependencies(${LIB_GUI_PROJECT_NAME} versionnumber)
@@ -311,6 +319,7 @@ set_property(
"${CMAKE_SOURCE_DIR}/src/lib"
"${CMAKE_SOURCE_DIR}/src/lib_gui"
"${CMAKE_SOURCE_DIR}/src/lib_license"
"${CMAKE_SOURCE_DIR}/build/src/lib_license"
)
set_target_properties(
@@ -339,8 +348,8 @@ configure_file(
#configure the versioning file
configure_file(
${CMAKE_SOURCE_DIR}/cmake/version.h.in
${CMAKE_SOURCE_DIR}/build/src/lib_gui/version.h
${CMAKE_SOURCE_DIR}/cmake/version.h.in
${CMAKE_SOURCE_DIR}/build/src/lib_gui/version.h
)
# configure public key for the coati version
@@ -368,7 +377,7 @@ if (WIN32)
"IDI_ICON1 ICON \"${CMAKE_SOURCE_DIR}/build/coati.ico\"\n"
)
add_executable(${APP_PROJECT_NAME} ${APP_FILES} ${CLANG_FILES} ${GEN_FILES} ${CMAKE_SOURCE_DIR}/build/Coati.rc ${CMAKE_SOURCE_DIR}/build/src/lib_gui/version.h)
add_executable(${APP_PROJECT_NAME} ${APP_FILES} ${CLANG_FILES} ${GEN_FILES} ${CMAKE_SOURCE_DIR}/build/Coati.rc)
# hide the console when running a release build.
set_target_properties(${APP_PROJECT_NAME} PROPERTIES LINK_FLAGS_DEBUG "/SUBSYSTEM:CONSOLE")
@@ -378,13 +387,14 @@ if (WIN32)
set_target_properties(${APP_PROJECT_NAME} PROPERTIES LINK_FLAGS_RELEASE "/ENTRY:\"mainCRTStartup\" /SUBSYSTEM:WINDOWS")
set_target_properties(${APP_PROJECT_NAME} PROPERTIES LINK_FLAGS_MINSIZEREL "/SUBSYSTEM:WINDOWS")
else ()
add_executable(${APP_PROJECT_NAME} ${APP_FILES} ${GEN_FILES} ${CMAKE_SOURCE_DIR}/build/src/lib_gui/version.h)
add_executable(${APP_PROJECT_NAME} ${APP_FILES} ${GEN_FILES})
endif ()
create_source_groups(${APP_FILES})
target_link_libraries(${APP_PROJECT_NAME} ${LIB_GUI_PROJECT_NAME} ${LIB_PARSER_PROJECT_NAME} ${LIB_PROJECT_NAME} ${LIB_LICENSE_PROJECT_NAME})
set_property(
TARGET ${APP_PROJECT_NAME}
PROPERTY INCLUDE_DIRECTORIES
@@ -394,6 +404,7 @@ set_property(
"${CMAKE_SOURCE_DIR}/src/lib_license"
"${CMAKE_SOURCE_DIR}/src/lib_parser"
"${CMAKE_SOURCE_DIR}/build/src/lib_gui"
"${CMAKE_SOURCE_DIR}/build/src/lib_license"
"${CMAKE_SOURCE_DIR}/build/src/app"
)
@@ -449,6 +460,7 @@ create_source_groups(${TRIAL_FILES})
target_link_libraries(${TRIAL_PROJECT_NAME} ${LIB_GUI_PROJECT_NAME} ${LIB_PROJECT_NAME} ${LIB_LICENSE_PROJECT_NAME} )
if(UNIX AND NOT APPLE)
target_link_libraries(${TRIAL_PROJECT_NAME} pthread dl rt)
endif()
@@ -460,6 +472,7 @@ set_property(
"${CMAKE_SOURCE_DIR}/src/lib"
"${CMAKE_SOURCE_DIR}/src/lib_gui"
"${CMAKE_SOURCE_DIR}/build/src/lib_gui"
"${CMAKE_SOURCE_DIR}/build/src/lib_license"
)
target_include_directories(${TRIAL_PROJECT_NAME} SYSTEM
@@ -568,9 +581,9 @@ endif ()
add_subdirectory(src/test)
if(UNIX AND NOT APPLE)
set(CXXTEST_INCLUDE_DIR ${EXTERNAL_SRC}/cxxtest)
set(CXXTEST_INCLUDE_DIR ${EXTERNAL_SRC}/cxxtest)
else()
set(CXXTEST_INCLUDE_DIR $ENV{CXX_TEST_DIR})
set(CXXTEST_INCLUDE_DIR $ENV{CXX_TEST_DIR})
endif()
set(CXXTEST_PYTHON_TESTGEN_EXECUTABLE ${CXXTEST_INCLUDE_DIR}/bin/cxxtestgen)
set(TESTGEN_FILE ${CMAKE_CURRENT_BINARY_DIR}/test_main.cpp)
@@ -618,6 +631,7 @@ elseif (UNIX)
add_custom_command(
OUTPUT ${TESTGEN_FILE}
PRE_BUILD
COMMAND rm -f ${TESTGEN_FILE}
COMMAND cd ${PROJECT_SOURCE_DIR} && ${PYTHON_EXECUTABLE} ${CXXTEST_PYTHON_TESTGEN_EXECUTABLE} --runner=ParenPrinter -o ${TESTGEN_FILE} ${TEST_FILES}
COMMENT "Generating unittest code with cxxtestgen"
)
+298 -127
View File
@@ -1,22 +1,22 @@
### Masterproject
## Coati
#### Setup
### Setup
##### External Software
#### External Software
* QT 5.5
* QT 5.6
* CxxTest 4.3
* Valgrind 3.9.0 (linux)
* Clang & LLVM (doesnt quite work for windows, use unix setup below and skip all the ninja stuff)(installation guide http://clang.llvm.org/docs/LibASTMatchersTutorial.html)
* Clang & LLVM 3.8 (doesnt quite work for windows, use unix setup below and skip all the ninja stuff)(installation guide http://clang.llvm.org/docs/LibASTMatchersTutorial.html)
* Boost 1.59
* Eigen 3.2.6
* Botan 1.11.24
##### Environment Variables
#### Environment Variables
* QT_DIR - ...\Qt\Qt5.2.1\5.2.1\<IDE>\
* CXX_TEST_DIR - .../cxxtest-4.3/
* CLANG_DIR - .../clang-llvm/
* QT_DIR - .../Qt/Qt5.6.0/5.6/<IDE>
* CXX_TEST_DIR - .../cxxtest-4.3
* CLANG_DIR - .../clang-llvm
* BOOST_159_DIR - .../boost_1_59_0
* EIGEN_DIR - .../eigen
* BOTAN_DIR - .../Botan-1.11.24
@@ -25,7 +25,7 @@ For Win32:
* VLD_DIR - .../Visual Leak Detector
* path - apped path to git.exe
###### Botan setup
##### Botan setup
Build release lib in ${BOTAN_DIR}/release
Build debug lib in ${BOTAN_DIR}/debug
@@ -39,30 +39,30 @@ python configure.py --cc=msvc --cpu=x86_32 --via-amalgamation --disable-shared -
for other:
$ python configure.py --via-amalgamation --disable-shared
##### Settings
#### Settings
Run setup script:
$ ./script/setup.sh
#### Release
### Release
##### App
#### App
* create release build
* make sure it uses the Coati icon
* obfuscate the executable using upx
##### Data folder
#### Data folder
* put data folder in working directory
* add empty log folder
* add working tictactoe.xml project to /projects/tictactoe with sources in /projects/tictactoe/src
* add empty app settings with one recent project tictactoe.xml
* leave window_settings.ini with correct Coati start layout
##### Package
#### Package
* add app
* add web/coati_manual.pdf to package
##### Updating Clang on UNIX
#### Updating Clang on UNIX
$ cd .../clang_llvm
@@ -83,130 +83,301 @@ $ cd ../release_build
$ cmake -G Ninja -DCMAKE_BUILD_TYPE=Release ../llvm
$ ninja -j4 check-all
##### Remarks
#### Remarks
* Boost lib dir: rename library directory for your system (e.g.: 'lib32-msvc-12.0') to 'lib'
#### Tagging
### Tagging
$ git tag -a VERSION_NUMBER -m "DESCRIPTION"
$ git push --tags
#### Changelog
### Loader gif creation from png sequence
##### 0.3.0
// from png sequence
convert -delay 3 -loop 0 coati_*.png coati.gif
* Added Tutorial project
* Added communication interface from and to Coati via TCP sockets
* Added plugin for Visual Studio (2012, 2013, 2015)
* Added plugin for Sublime Text (2 & 3)
* Increased autocompletion performance by caching and limiting results to 100
* Save Coati version to sqlite and reparse project whenever the version changes
* Improved source locations of template scopes
* Fixed horizontal scroll in code view not activated while scrolling vertically
* Save errors to storage and reactivate them via button in the status bar
* Save macro scopes
* Fixed old data was still in new project window when creating another project
* Save comment locations and display them when right next to active symbol
* Reworked code view highlighting
* Fixed cursor was jumping at end of query when editing a search query
* Fixed search query disappeared when not token was found for it
* Improved code view auto scroll to center the first active line in the middle
* Focus all overlapping source locations in the code view
* Added recent projects menu option
* Saving all template arguments type uses
// less colors
gifsicle --colors 255 coati.gif > color.gif
##### 0.4.0
// crop size
gifsicle --crop 0,5+0x-5 color.gif > crop.gif
* Network ports for IDE communication can be defined in the ApplicationSettings.xml
* Coati can now handle inclass initialization of members
* Improved handling of template arguments in analysis
* Coati now handles anonymous symbols when parsing files
* Extended color schemes to allow more extensive use in the graph
* Added new color scheme called "bad_rainbow"
* Coati shows a template's general definition when an implicit specialization is activated
* Fixed source locations of many declarations
* Fixed syntax highlighting to correctly identify strings, comments and block comments
* Added analysis for template parameter packs
* Show function and method signature in tooltip when hovering the graph node
* Fixed graph font size was too small for Windows and Linux
* Removed Coati directory from Linux package
* Introduced file endings .coatiproject and .coatidb for Coati's project files
* Added installer for Windows
* Installing prerequisits in Windows Installer
* Redesigned the about window
* Parse errors will be displayed as they appear during analysis
* Fixed constructors and destructors using return type 'void' withou source location
* Removed 'close window' action from menu
* Added help texts to project setup and preferences window
* Improved lambda handling in analysis
* Fixed style of function or method nodes with children
* Fixed tooltip colors in dark color scheme
* renamed undo&redo to back&forward
* navigate back&forward via mouse buttons
* navigate back via backspace key
// add transparency
gifsicle --unoptimize --disposal=previous --transparent="#FFFFFF" crop.gif > trans.gif
##### 0.5.0.4
// resize
gifsicle --resize-height 18 trans.gif > loader.gif
* Added option to hide widget window title bars to View menu
* Added C support
* Added shortcuts for font size resetting to View menu
* Fixed number postions in graph
* Improved performance of token name saving
* Added commandline option for project file
* Fixed cursor changing for resize and text interactions
* Added C and C++ standard setting to project
* Refresh project editing settings
* Added license key window and license checker
* Added trial target without analysis
* Added web documentation
* Improved code view annotation painting performance
* Update error count while analysis
* Improved back & forward in code view
* Return to last scroll position when going back in code view
* Added .coatiproject file associations with icon for Mac and Windows
* Display scope name at bottom of code snippet
* Improved graph view node bundeling to bundle more
* Improved log file names to be sorted chronologically
* Added application move protection to reenter license key
* Show overview on project open with node bundles per type
* Added overview and error keywords to search view
* Added project setup wizard for step-by-step project setup
* Added Visual Studio solution parsing via project wizard or VS plugin
* Improved style of ui windows
* Save user data in ~/Library/Application Support/Coati on Mac
* Improved analysis performance to take only 66% of the time
* Improved logging to alternate between 2 files of 1000 lines to decrease logfile sizes
* Improved painting of icons in graph to be smoother
* Added link to documentation to Help menu
* Fixed preferences not saved
### Changelog
##### 0.5.1.21
* Added project setup for Compilation Databases
* Improved analysis performance for large projects (10x as fast for 1.000.000 LoC)
* Improved project load and code view performance
* Added graph panning with WASD
* Added graph zooming with Shift + mouse wheel or Shift + WS
* Added file extension UI to advanced settings in project setup summary
* Added compiler flags UI to advanced settings in project setup summary
* Show fatal errors in UI that stopped analysis
* Fixed linux package creating ~/.config if not there
* Fixed project setup window sizes to adapt to content size
* Fixed project paths are now saved relative if defined relative
* Fixed crash when opening newer project with older version of Coati
* Removed high traffic log messages
* Show loader animation when loading project
* Fixed expanding file with errors showed all locations in red
* Fixed children on namespace activation were bundled
* Fixed interrupting of analysis to show message in status bar
* Disabled config file warnings
* Added delay for changing fontsize via mouse wheel
* Fixed Visual Studio plugin project loading
* Improved context detection for template parameters
* Fixed type references in headers saved multiple times
* Prevent network message handling without valid license
* Added font size limits
* Center windows on top of main window
* Fixed crash when accessing files without read permission
#### 0.8.0
released 2016-09-01
* Improved titles and help texts in project setup UI
* Fixed error locations not saved with absolute file paths in Compilation Database projects
* Added missing source files extensions setting to the Edit Project dialog #132
* Changed default text colors to black in project setup UI #140
* Added plugin ports settings to Preferences #145
* Improved project state handling on refreshing
* Added Java sample project JavaParser: http://javaparser.org/
* Fixed regex for system includes used wrongly in syntax highlighter
* Added setting to disable file and console logging, default is off #157
* Added migrations between different ApplicationSettings versions
* Added auto detection for Java library to Preferences
* Removed auto refresh option from Search view
* Added progress dialogs for indexing and block UI #143
* Hide name qualifiers for graph nodes in Java projects
* Added handling when java library not found
* Added plain text editing dialog to path list boxes
* Use language dependent symbol name delimiter in UI
* Added scroll speed setting to preferences #112
* Added Java project setup UI
* Record start and end locations of scopes in Java
* Display unresolved types names in Java as 'unresolved-type'
* Cache stats for overview to speed up display
* Fixed graph nodes to restore their expand state when going back #118
* Added shortcuts for navigating to next and previous reference in code view
* Pressing Tab in search completes up to next ::, Delete erases to last :: #133
* Bundle anonymous namespaces separately in graph overview #126
* Added 'Show Data Folder' and 'Show Log Folder' items to Help menu
* Added new status bar loader gif with higher resolution
* Record type aliases in C++
* Added Java indexer
* Changed public icon in graph and added default icon
* Scroll to file location when finding no symbol at specified location from plugin message
* Added shortcut for Preferences on Windows/Linux
* Leave code view at original line when expanding scopes
* Pan graph view to center on name of active symbol after activation
* Moved color scheme selection to Preferences
* Moved Preferences menu item to Edit menu on Windows/Linux #113
* Added setting for hiding non-fatal errors in unindexed files to preferences, turned on by default
* Fixed file out-of-date asterisk disappearing when showing snippets after minimize state
* Implemented Atom plugin: https://github.com/CoatiSoftware/atom-coati
* Implemented CLion/IntelliJ plugin: https://github.com/CoatiSoftware/idea-coati
* Implemented Eclipse plugin: https://github.com/CoatiSoftware/eCoati
* Implemented emacs plugin: https://github.com/CoatiSoftware/emacs-coati
* Improved code view rendering times
* Don't show implicit nodes in search auto completion list
#### 0.7.0.22
released 2016-07-07
* Fixed detected global header search paths lost correct order and caused problems with #include_next directives
* Fixed MaxOSX build crashed on launch due to unknown command line option passed
* Removed 'Save Project' and 'Save Project As' actions from menu
* Fixed indexer getting stuck at 'building caches' when indexing is interrupted
* Fixed database not properly closed when errors appeared during indexing
* Fixed autocompletions popup flickering while typing
* Added resize grip to bottom right corner of every dialog window
* Fixed 'paths don't exist' dialog window getting too big with lots of paths shown
* Added context menu with 'back' and 'forward' actions available in all views
* Removed Clang compiler warnings from console output
* Added handling of project specific VS macros to VS solution parser
#### 0.7.0.0
released 2016-06-15
* Updated to clang 3.8
* Fixed crash in search autocompletion retrieval due to edge case in sorting
* Fixed size policies in code view to avoid global scrollbar
* Added full text search via search field: ?<query> for case-insensitive search, ??<query> for case-sensitive search
* Made initialization for full text search lazy: done on first full text search
* Defined full text search color in all color schemes
* Increased code view performance by caching file IDs and paths
* Added multithreaded indexing. Number of threads can be set in the Preferences UI, default is 4
* Reworked graph node bundling to only distinguish defined and undefined nodes in each bucket
* Made graph node sorting alphabetical and put bundles at end
* Changed code view snippet sorting to always show definition on top
* Fixed local symbols were not available within lambdas
* Added settings for font family, font size and tab with to Preferences UI
* Fixed VS solution parser issue with internal macros
* Removed header extensions, all included files within the project paths are now analyzed
* Fixed crash in sqlite when symbol name has special characters
* Improved code view performance by reducing amount of initially open code files
* Improved graph view performance through faster data retrieval and smarter structures
* Increased aggregation click speed with faster edge id retrieval
* Fixed png color profiles to avoid console warning: "libpng warning: iCCP: known incorrect sRGB profile"
* Fixed graph edge drawn wrong when leaving from child node of smaller node
* Fixed Sublime Text Plugin issue with wrong encoding
* Randomized source file order for multithreaded analysis to increase performance
* Show name of removed symbol when going back after refreshing
* Fixed macro definition not connected to file
* Fixed macro use not found in #ifdef, #ifndef, defined() and some expand cases
* Removed back and forward steps for some graph and code view manipulations
* Fixed code view style broken on Mac due to change of working directory when analyzing compilation database
* Added database optimization step after indexing to reduce database size by ~25%
* Fixed artifacts after graph view change by clearing view
* Fixed autocompletion list highlights at wrong location for long names
* Allow files and directories to be excluded from analysis in advanced settings for project setup
* Added Qt gif plugin to Mac Release so that loader gif in status bar is visible
* Added link to download page to start screen to remind users of updating once in a while
* Check if compilation database still exists before refreshing
* Added separate step for defining project name, project location and compiliation database to project setup
* Explain that the project stays up-to-date with the compilation databes on refresh in project setup UI
* Disregard source extensions when loading from compilation database
* Removed error logs in name resolver
* Added plugin for VIM: https://github.com/CoatiSoftware/vim-coati
#### 0.6.0.0
released 2016-04-27
* Smoother graph panning and zooming on keyboard using update loop
* Differentiate between explicit and implicit nodes and only show implicit nodes in the graph view when connected
* Improved file clearing performance on project refresh
* Show deleted projects on the start screen and show messagebox to delete them
* Show analysis duration in hh:mm:ss
* Added suppport for temporary test licenses and show error message when it expired
* Increased graph performance by reducing to fixed number of requests
* Add vs-clang compatibility flags when creating project from Visual Studio solution
* Increased graph edge drawing performance
* Added auto detection for system header paths to project wizard and preferences when using gcc, clang or vs compilers
* Added bug tracker to help menu
* Increased search autocompletion performance to stay mostly below 100ms
* Changed style of aggregation edge to cleaner look
* Allow certain edge types to enter and leave at top and bottom of nodes as well e.g. inheritance
* Increased project load performance
* Increased graph creation performance for overview screen
* Changed namespace activation to show the namespace name in the search bar and the namespace definitions in the code view
* Updated to Qt 5.6
* Added analysis for local symbols and allow selecting them in the code view
* Improved error display performance by not expanding all of them at once
* Added home button next to search field for showing the project overview
* Added shortcut and menu item to show project overview
* Fixed Path boxes not sized correctly when switching back and forth in the project wizard
* Allow support for environment variables in project setup with syntax ${VARIABLE_NAME}
* Show quit button on license enter screen when no valid license was entered yet
* Allow color schemes to define text colors for code view highlights
* Added support for function pointers to analysis
* Added Windows system dlls to installer on Windows so users don't not need to install the redistributable package
* Changed style of out-of-date files to be followed by *
* Set Qt flag for high DPI scaling
* Check analyzed paths for existence in project wizard
* Inform the user about project changes and ask before reparsing the project
* Removed "simple setup" step in project wizard and added "lazy include search"-checkbox
* Edit the project settings by clicking the project name in the overview stats
* Added welcome message to Coati trial
* Defined new highlight colors for code view in all color schemes
#### 0.5.1.21
released 2016-03-16
* Fixed file logger using wrong directory for first log file
* Fixed crash when accessing files without read permission
* Center windows on top of main window
* Added font size limits
* Prevent network message handling without valid license
* Fixed type references in headers saved multiple times
* Improved context detection for template parameters
* Fixed Visual Studio plugin project loading
* Added delay for changing fontsize via mouse wheel
* Disabled config file warnings
* Fixed interrupting of analysis to show message in status bar
* Fixed children on namespace activation were bundled
* Fixed expanding file with errors showed all locations in red
* Show loader animation when loading project
* Removed high traffic log messages
* Fixed crash when opening newer project with older version of Coati
* Fixed project paths are now saved relative if defined relative
* Fixed project setup window sizes to adapt to content size
* Fixed linux package creating ~/.config if not there
* Show fatal errors in UI that stopped analysis
* Added compiler flags UI to advanced settings in project setup summary
* Added file extension UI to advanced settings in project setup summary
* Added graph zooming with Shift + mouse wheel or Shift + WS
* Added graph panning with WASD
* Improved project load and code view performance
* Improved analysis performance for large projects (10x as fast for 1.000.000 LoC)
* Added project setup for Compilation Databases
#### 0.5.0.4
released 2016-02-25
* Fixed preferences not saved
* Added link to documentation to Help menu
* Improved painting of icons in graph to be smoother
* Improved logging to alternate between 2 files of 1000 lines to decrease logfile sizes
* Improved analysis performance to take only 66% of the time
* Save user data in ~/Library/Application Support/Coati on Mac
* Improved style of ui windows
* Added Visual Studio solution parsing via project wizard or VS plugin
* Added project setup wizard for step-by-step project setup
* Added overview and error keywords to search view
* Show overview on project open with node bundles per type
* Added application move protection to reenter license key
* Improved log file names to be sorted chronologically
* Improved graph view node bundeling to bundle more
* Display scope name at bottom of code snippet
* Added .coatiproject file associations with icon for Mac and Windows
* Return to last scroll position when going back in code view
* Improved back & forward in code view
* Update error count while analysis
* Improved code view annotation painting performance
* Added web documentation
* Added trial target without analysis
* Added license key window and license checker
* Refresh project editing settings
* Added C and C++ standard setting to project
* Fixed cursor changing for resize and text interactions
* Added commandline option for project file
* Improved performance of token name saving
* Fixed number postions in graph
* Added shortcuts for font size resetting to View menu
* Added C support
* Added option to hide widget window title bars to View menu
#### 0.4.0
released 2016-01-07
* navigate back via backspace key
* navigate back&forward via mouse buttons
* renamed undo&redo to back&forward
* Fixed tooltip colors in dark color scheme
* Fixed style of function or method nodes with children
* Improved lambda handling in analysis
* Added help texts to project setup and preferences window
* Removed 'close window' action from menu
* Fixed constructors and destructors using return type 'void' withou source location
* Parse errors will be displayed as they appear during analysis
* Redesigned the about window
* Installing prerequisits in Windows Installer
* Added installer for Windows
* Introduced file endings .coatiproject and .coatidb for Coati's project files
* Removed Coati directory from Linux package
* Fixed graph font size was too small for Windows and Linux
* Show function and method signature in tooltip when hovering the graph node
* Added analysis for template parameter packs
* Fixed syntax highlighting to correctly identify strings, comments and block comments
* Fixed source locations of many declarations
* Coati shows a template's general definition when an implicit specialization is activated
* Added new color scheme called "bad_rainbow"
* Extended color schemes to allow more extensive use in the graph
* Coati now handles anonymous symbols when parsing files
* Improved handling of template arguments in analysis
* Coati can now handle inclass initialization of members
* Network ports for IDE communication can be defined in the ApplicationSettings.xml
#### 0.3.0
released 2015-12-14
* Saving all template arguments type uses
* Added recent projects menu option
* Focus all overlapping source locations in the code view
* Improved code view auto scroll to center the first active line in the middle
* Fixed search query disappeared when not token was found for it
* Fixed cursor was jumping at end of query when editing a search query
* Reworked code view highlighting
* Save comment locations and display them when right next to active symbol
* Fixed old data was still in new project window when creating another project
* Save macro scopes
* Save errors to storage and reactivate them via button in the status bar
* Fixed horizontal scroll in code view not activated while scrolling vertically
* Improved source locations of template scopes
* Save Coati version to sqlite and reparse project whenever the version changes
* Increased autocompletion performance by caching and limiting results to 100
* Added plugin for Sublime Text (2 & 3)
* Added plugin for Visual Studio (2012, 2013, 2015)
* Added communication interface from and to Coati via TCP sockets
* Added Tutorial project
+4 -1
View File
@@ -35,12 +35,15 @@
</framework_search_paths>
<extensions>
<header_extensions><!-- STRING: extension for header/include e.g. .h --></header_extensions>
<source_extensions><!-- STRING: extension for source e.g. .cpp --></source_extensions>
</extensions>
<use_source_paths_for_header_search><!-- BOOL: If enabled all subfolder of the source paths will be used for header search --></use_source_paths_for_header_search>
<exclude_paths>
<exclude_path><!-- STRING: path to file or directory to exclude from analysis --></source_path>
</exclude_paths>
<build_file_path>
<vs_solution_path><!-- STRING: path to Visual Studio solution *.sln --></vs_solution_path>
<compilation_db_path><!-- STRING: path to Compilation Database --></compilation_db_path>
+4
View File
@@ -173,11 +173,14 @@
<!-- OPTIONAL: type specific node colors can be overriden by using the TEMPLATE within a type tag below -->
<type></type>
<builtin_type></builtin_type>
<class></class>
<interface></interface>
<struct></struct>
<enum></enum>
<typedef></typedef>
<template_parameter_type></template_parameter_type>
<type_parameter></type_parameter>
<function></function>
<method></method>
@@ -188,6 +191,7 @@
<undefined></undefined>
<namespace></namespace>
<package></package>
<file></file>
<macro></macro>
+93 -30
View File
@@ -13,7 +13,7 @@
</button>
<field>
<text>#3D3D3D</text>
<text>#FFFFFF</text>
<background>#808080</background>
<highlight>#B1B1B1</highlight>
</field>
@@ -27,17 +27,45 @@
<query>
<none>
<normal>#B1B1B1</normal>
<hover>#CCCCCC</hover>
<normal>
<fill>#B1B1B1</fill>
<text>#3D3D3D</text>
</normal>
<hover>
<fill>#CCCCCC</fill>
<text>#3D3D3D</text>
</hover>
</none>
<command>
<normal>#86BD40</normal>
<hover>#9EC769</hover>
<normal>
<fill>#86BD40</fill>
<text>#3D3D3D</text>
</normal>
<hover>
<fill>#9EC769</fill>
<text>#3D3D3D</text>
</hover>
</command>
<operator>
<normal>#7D2724</normal>
<hover>#8C2B29</hover>
<normal>
<fill>#7D2724</fill>
<text>#3D3D3D</text>
</normal>
<hover>
<fill>#8C2B29</fill>
<text>#3D3D3D</text>
</hover>
</operator>
<fulltext>
<normal>
<fill>#C2AFEF</fill>
<text>#3D3D3D</text>
</normal>
<hover>
<fill>#AB96EA</fill>
<text>#3D3D3D</text>
</hover>
</fulltext>
</query>
</search>
@@ -87,48 +115,62 @@
</syntax>
<selection>
<location>
<token>
<normal>
<border>transparent</border>
<fill>transparent</fill>
</normal>
<focus>
<border>#B2B2B2</border>
<border>#EDEDED</border>
<fill>transparent</fill>
</focus>
<active>
<border>#B2B2B2</border>
<fill>#4A4A4A</fill>
<border>#EDEDED</border>
<fill>#EDEDED</fill>
<text>#262626</text>
</active>
</location>
</token>
<local_symbol>
<normal>
<border>transparent</border>
<fill>transparent</fill>
</normal>
<focus>
<border>#9BDAFF</border>
<fill>#A5DEFF</fill>
<text>#262626</text>
</focus>
<active>
<border>transparent</border>
<fill>#A5DEFF</fill>
<text>#262626</text>
</active>
</local_symbol>
<scope>
<normal>
<border>transparent</border>
<fill>transparent</fill>
</normal>
<focus>
<border>transparent</border>
<fill>transparent</fill>
</focus>
<active>
<border>transparent</border>
<fill>transparent</fill>
</active>
</scope>
<error>
<normal>
<border>transparent</border>
<fill>#A0FF0000</fill>
<text>#000000</text>
</normal>
<focus>
<border>transparent</border>
<fill>#FFFF0000</fill>
</focus>
<active>
<border>transparent</border>
<fill>#FFFF0000</fill>
</active>
</error>
<fulltext>
<normal>
<fill>#C2AFEF</fill>
<text>#3D3D3D</text>
</normal>
<focus>
<fill>#987CEA</fill>
</focus>
</fulltext>
</selection>
</snippet>
</code>
@@ -167,9 +209,15 @@
<normal>#FFFFFF</normal>
</icon>
</type>
<builtin_type>
<like>type</like>
</builtin_type>
<class>
<like>type</like>
</class>
<interface>
<like>type</like>
</interface>
<struct>
<like>type</like>
</struct>
@@ -182,6 +230,9 @@
<template_parameter_type>
<like>type</like>
</template_parameter_type>
<type_parameter>
<like>type</like>
</type_parameter>
<function>
<fill>
@@ -233,6 +284,9 @@
<namespace>
<like>undefined</like>
</namespace>
<package>
<like>undefined</like>
</package>
<file>
<fill>
@@ -243,6 +297,12 @@
<normal>#20FFFFFF</normal>
<focus>#FFFFFF</focus>
</border>
<text>
<normal>#FFFFFF</normal>
</text>
<icon>
<normal>#FFFFFF</normal>
</icon>
</file>
<macro>
<like>file</like>
@@ -297,18 +357,21 @@
<normal>#2A6484</normal>
</use>
<template_parameter>
<normal>#C1305D</normal>
</template_parameter>
<template_argument>
<normal>#C1305D</normal>
</template_argument>
<type_argument>
<like>template_argument</like>
</type_argument>
<template_default_argument>
<normal>#C1305D</normal>
<like>template_argument</like>
</template_default_argument>
<template_specialization>
<normal>#C1305D</normal>
<like>template_argument</like>
</template_specialization>
<template_member_specialization>
<like>template_argument</like>
</template_member_specialization>
<include>
<normal>#4E82F6</normal>
+85 -33
View File
@@ -27,17 +27,45 @@
<query>
<none>
<normal>white</normal>
<hover>#F5F5F5</hover>
<normal>
<fill>white</fill>
<text>black</text>
</normal>
<hover>
<fill>#F5F5F5</fill>
<text>black</text>
</hover>
</none>
<command>
<normal>#8FBC92</normal>
<hover>#5EA071</hover>
<normal>
<fill>#8FBC92</fill>
<text>black</text>
</normal>
<hover>
<fill>#5EA071</fill>
<text>black</text>
</hover>
</command>
<operator>
<normal>#FCA47E</normal>
<hover>#F97A4E</hover>
<normal>
<fill>#FCA47E</fill>
<text>black</text>
</normal>
<hover>
<fill>#F97A4E</fill>
<text>black</text>
</hover>
</operator>
<fulltext>
<normal>
<fill>#C7C7E2</fill>
<text>black</text>
</normal>
<hover>
<fill>#ABABDD</fill>
<text>black</text>
</hover>
</fulltext>
</query>
</search>
@@ -87,48 +115,60 @@
</syntax>
<selection>
<location>
<token>
<normal>
<border>transparent</border>
<fill>transparent</fill>
</normal>
<focus>
<border>#B2B2B2</border>
<border>#8E8E8E</border>
<fill>transparent</fill>
</focus>
<active>
<border>#B2B2B2</border>
<fill>#EDEDED</fill>
<border>#A0A0A0</border>
<fill>#A0A0A0</fill>
<text>#FFFFFF</text>
</active>
</location>
</token>
<local_symbol>
<normal>
<border>transparent</border>
<fill>transparent</fill>
</normal>
<focus>
<border>#AAE0FF</border>
<fill>#C6EAFF</fill>
</focus>
<active>
<border>transparent</border>
<fill>#C6EAFF</fill>
</active>
</local_symbol>
<scope>
<normal>
<border>transparent</border>
<fill>transparent</fill>
</normal>
<focus>
<border>transparent</border>
<fill>transparent</fill>
</focus>
<active>
<border>transparent</border>
<fill>transparent</fill>
</active>
</scope>
<error>
<normal>
<border>transparent</border>
<fill>#80FF0000</fill>
<text>#000000</text>
</normal>
<focus>
<border>transparent</border>
<fill>#FFFF0000</fill>
</focus>
<active>
<border>transparent</border>
<fill>#FFFF0000</fill>
</active>
</error>
<fulltext>
<normal>
<fill>#C7C7E2</fill>
<text>#000000</text>
</normal>
<focus>
<fill>#ABABDD</fill>
</focus>
</fulltext>
</selection>
</snippet>
</code>
@@ -161,9 +201,15 @@
<focus>#3C3C3C</focus>
</border>
</type>
<builtin_type>
<like>type</like>
</builtin_type>
<class>
<like>type</like>
</class>
<interface>
<like>type</like>
</interface>
<struct>
<like>type</like>
</struct>
@@ -176,6 +222,9 @@
<template_parameter_type>
<like>type</like>
</template_parameter_type>
<type_parameter>
<like>type</like>
</type_parameter>
<function>
<fill>
@@ -220,6 +269,9 @@
<namespace>
<like>undefined</like>
</namespace>
<package>
<like>undefined</like>
</package>
<file>
<fill>
@@ -278,25 +330,25 @@
<normal>#3190BA</normal>
</use>
<template_parameter>
<normal>#C1305D</normal>
</template_parameter>
<template_argument>
<like>template_parameter</like>
<normal>#C1305D</normal>
</template_argument>
<type_argument>
<like>template_argument</like>
</type_argument>
<template_default_argument>
<like>template_parameter</like>
<like>template_argument</like>
</template_default_argument>
<template_specialization>
<like>template_parameter</like>
<like>template_argument</like>
</template_specialization>
<template_member_specialization>
<like>template_parameter</like>
<like>template_argument</like>
</template_member_specialization>
<aggregation>
<normal>#EEE</normal>
<focus>#DDD</focus>
<normal>#DDD</normal>
<focus>#CCC</focus>
</aggregation>
</edge>
</graph>
+111 -52
View File
@@ -27,17 +27,64 @@
<query>
<none>
<normal>#2F2F2F</normal>
<hover>black</hover>
<normal></normal>
<hover></hover>
</none>
<command>
<normal>#406D4D</normal>
<hover>#4E855E</hover>
<normal></normal>
<hover></hover>
</command>
<operator>
<normal>#7D2724</normal>
<hover>#8C2B29</hover>
<normal></normal>
<hover></hover>
</operator>
<fulltext>
<normal></normal>
<hover></hover>
</fulltext>
</query>
<query>
<none>
<normal>
<fill>#2F2F2F</fill>
<text>#F7F7F7</text>
</normal>
<hover>
<fill>black</fill>
<text>#F7F7F7</text>
</hover>
</none>
<command>
<normal>
<fill>#406D4D</fill>
<text>#F7F7F7</text>
</normal>
<hover>
<fill>#4E855E</fill>
<text>#F7F7F7</text>
</hover>
</command>
<operator>
<normal>
<fill>#7D2724</fill>
<text>#F7F7F7</text>
</normal>
<hover>
<fill>#8C2B29</fill>
<text>#F7F7F7</text>
</hover>
</operator>
<fulltext>
<normal>
<fill>#207EA8</fill>
<text>#F7F7F7</text>
</normal>
<hover>
<fill>#006D93</fill>
<text>#F7F7F7</text>
</hover>
</fulltext>
</query>
</search>
@@ -87,48 +134,63 @@
</syntax>
<selection>
<location>
<token>
<normal>
<border>transparent</border>
<fill>transparent</fill>
</normal>
<focus>
<border>#B2B2B2</border>
<border>#F7F7F7</border>
<fill>transparent</fill>
</focus>
<active>
<border>#B2B2B2</border>
<fill>#4A4A4A</fill>
<border>transparent</border>
<fill>#F7F7F7</fill>
<text>#272728</text>
</active>
</location>
</token>
<local_symbol>
<normal>
<border>transparent</border>
<fill>transparent</fill>
</normal>
<focus>
<border>#A0A0A0</border>
<fill>#969696</fill>
<text>#191919</text>
</focus>
<active>
<border>transparent</border>
<fill>#969696</fill>
<text>#272728</text>
</active>
</local_symbol>
<scope>
<normal>
<border>transparent</border>
<fill>transparent</fill>
</normal>
<focus>
<border>transparent</border>
<fill>transparent</fill>
</focus>
<active>
<border>transparent</border>
<fill>transparent</fill>
</active>
</scope>
<error>
<normal>
<border>transparent</border>
<fill>#A0FF0000</fill>
<text>#000000</text>
</normal>
<focus>
<border>transparent</border>
<fill>#FFFF0000</fill>
</focus>
<active>
<border>transparent</border>
<fill>#FFFF0000</fill>
</active>
</error>
<fulltext>
<normal>
<fill>#207EA8</fill>
<text>#F7F7F7</text>
</normal>
<focus>
<border>#006D93</border>
<fill>#134B63</fill>
</focus>
</fulltext>
</selection>
</snippet>
</code>
@@ -161,36 +223,30 @@
<focus>#C3C3C3</focus>
</border>
</type>
<builtin_type>
<like>type</like>
</builtin_type>
<class>
<border>
<normal>#20C3C3C3</normal>
<focus>#C3C3C3</focus>
</border>
<like>type</like>
</class>
<interface>
<like>type</like>
</interface>
<struct>
<border>
<normal>#20C3C3C3</normal>
<focus>#C3C3C3</focus>
</border>
<like>type</like>
</struct>
<enum>
<border>
<normal>#20C3C3C3</normal>
<focus>#C3C3C3</focus>
</border>
<like>type</like>
</enum>
<typedef>
<border>
<normal>#20C3C3C3</normal>
<focus>#C3C3C3</focus>
</border>
<like>type</like>
</typedef>
<template_parameter_type>
<border>
<normal>#20C3C3C3</normal>
<focus>#C3C3C3</focus>
</border>
<like>type</like>
</template_parameter_type>
<type_parameter>
<like>type</like>
</type_parameter>
<function>
<fill>
@@ -235,6 +291,9 @@
<namespace>
<like>undefined</like>
</namespace>
<package>
<like>undefined</like>
</package>
<file>
<fill>
@@ -293,20 +352,20 @@
<normal>#2A6484</normal>
</use>
<template_parameter>
<normal>#C1305D</normal>
</template_parameter>
<template_argument>
<normal>#C1305D</normal>
</template_argument>
<type_argument>
<like>template_argument</like>
</type_argument>
<template_default_argument>
<normal>#C1305D</normal>
<like>template_argument</like>
</template_default_argument>
<template_specialization>
<normal>#C1305D</normal>
<like>template_argument</like>
</template_specialization>
<template_member_specialization>
<normal>#C1305D</normal>
<like>template_argument</like>
</template_member_specialization>
<include>
@@ -317,8 +376,8 @@
</macro_use>
<aggregation>
<normal>#5D5D5D</normal>
<focus>#6D6D6D</focus>
<normal>#3D3D3D</normal>
<focus>#4D4D4D</focus>
</aggregation>
</edge>
</graph>
Binary file not shown.

Before

Width:  |  Height:  |  Size: 368 B

After

Width:  |  Height:  |  Size: 517 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.2 KiB

After

Width:  |  Height:  |  Size: 8.0 KiB

+12 -10
View File
@@ -1,17 +1,14 @@
#code_file_list_base, #code_file_list {
#code_container, #code_file_list {
background-color: <color:code/background>;
}
* {
font-size: <setting:font_size>pt;
}
#code_file {
background-color: <color:code/snippet/background>;
border: 2px solid <color:code/file/background>;
border-radius: 12px;
border-top-left-radius: 14px;
border-top-right-radius: 14px;
font-size: <setting:font_size>pt;
padding-bottom: 7px;
}
@@ -19,6 +16,7 @@
background-color: <color:code/file/background>;
border-top-left-radius: 7px;
border-top-right-radius: 7px;
font-size: <setting:font_size>pt;
padding-right: 5px;
}
@@ -27,6 +25,7 @@
border: none;
border-radius: 3px;
color: <color:code/file/title/text>;
font-size: <setting:font_size>pt;
padding: 2px 4px;
margin: 1px 8px 3px;
}
@@ -52,10 +51,7 @@
#code_file #code_snippet {
background-color: <color:code/snippet/background>;
border-top: 2px solid <color:code/file/background>;
}
#code_file #code_snippet * {
font-family: "<setting:font_name>";
font-size: <setting:font_size>pt;
}
#code_file #code_snippet[isFirst=true] {
@@ -65,8 +61,10 @@
#code_file #code_snippet #scope_name, #code_file #code_snippet #dots {
background-color: <color:code/snippet/title/background>;
color: <color:code/snippet/title/text>;
border: none;
color: <color:code/snippet/title/text>;
font-family: "<setting:font_name>";
font-size: <setting:font_size>pt;
}
#code_file #code_snippet #scope_name:hover {
@@ -88,11 +86,15 @@
background-color: <color:code/snippet/line_number/background>;
border: none;
color: <color:code/snippet/line_number/text>;
font-family: "<setting:font_name>";
font-size: <setting:font_size>pt;
}
#code_area {
background-color: transparent;
color: <color:code/snippet/syntax/normal>;
font-family: "<setting:font_name>";
font-size: <setting:font_size>pt;
}
#code_file #maximize_button, #code_file #snippet_button, #code_file #minimize_button {
Binary file not shown.

After

Width:  |  Height:  |  Size: 867 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 536 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

After

Width:  |  Height:  |  Size: 606 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 536 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

After

Width:  |  Height:  |  Size: 604 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 697 B

After

Width:  |  Height:  |  Size: 614 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 541 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

After

Width:  |  Height:  |  Size: 618 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 760 B

After

Width:  |  Height:  |  Size: 986 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 748 B

After

Width:  |  Height:  |  Size: 827 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 584 B

After

Width:  |  Height:  |  Size: 693 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 436 B

After

Width:  |  Height:  |  Size: 588 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 337 B

After

Width:  |  Height:  |  Size: 475 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 656 B

After

Width:  |  Height:  |  Size: 811 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 697 B

After

Width:  |  Height:  |  Size: 614 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.6 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.0 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.1 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 852 B

After

Width:  |  Height:  |  Size: 718 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 546 B

After

Width:  |  Height:  |  Size: 699 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 684 B

After

Width:  |  Height:  |  Size: 816 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 805 B

After

Width:  |  Height:  |  Size: 953 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 50 KiB

After

Width:  |  Height:  |  Size: 50 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.3 KiB

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.3 KiB

After

Width:  |  Height:  |  Size: 8.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.0 KiB

After

Width:  |  Height:  |  Size: 8.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 532 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.0 KiB

@@ -0,0 +1,57 @@
QLabel {
color: white;
}
#topHalf {
background: #007AC2;
border-top-left-radius: 15px;
border-top-right-radius: 15px;
}
#title {
color: white;
font-size: 22pt;
font-weight: bold;
}
#percent {
font-size: 22pt;
font-weight: bold;
}
#message {
font-size: 14pt;
font-weight: bold;
}
#filePath {
font-size: 11pt;
}
#errorCount {
border: none;
background: transparent;
color: white;
font-size: 14pt;
}
#windowButton {
background: transparent;
border: 1px solid white;
color: white;
}
#windowButton:hover {
background: transparent;
border: 1px solid white;
color: white;
}
#windowButton:hover {
color: #2E3C86;
background: white;
}
#windowButton:default {
border: 2px solid white;
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 315 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 50 KiB

After

Width:  |  Height:  |  Size: 50 KiB

-4
View File
@@ -3,7 +3,3 @@ QToolTip {
color: black;
font-size: <setting:font_size>pt;
}
* {
font-family: "Roboto";
}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.4 KiB

BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.4 KiB

After

Width:  |  Height:  |  Size: 925 B

@@ -22,12 +22,7 @@ QPushButton:pressed {
}
#refresh_button {
border-bottom-left-radius: 12px;
border-top-left-radius: 12px;
margin-right: 2px;
}
#auto_refresh_button {
border-bottom-right-radius: 12px;
border-top-right-radius: 12px;
/*border-bottom-left-radius: 12px;*/
/*border-top-left-radius: 12px;*/
border-radius: 12px;
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 706 B

BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

After

Width:  |  Height:  |  Size: 811 B

+11 -5
View File
@@ -16,6 +16,7 @@ QWidget#search_box_container {
border: none;
border-bottom-left-radius: 12px;
border-top-left-radius: 12px;
margin-left: 5px;
margin-right: 2px;
}
@@ -23,6 +24,7 @@ QLineEdit#search_box {
background-color: transparent;
border: none;
color: <color:search/field/text>;
margin-left: 5px;
selection-background-color: <color:search/field/highlight>;
}
@@ -41,19 +43,23 @@ QAbstractItemView#search_box_popup {
selection-background-color: <color:search/popup/highlight>;
}
QPushButton#search_button {
#search_button, #home_button {
background: <color:search/button/normal>;
border: none;
border-bottom-right-radius: 12px;
border-top-right-radius: 12px;
border-radius: 12px;
background-position: 15px 5px;
width: 30px;
}
#search_button:hover {
#search_button {
border-bottom-left-radius: 0px;
border-top-left-radius: 0px;
}
#search_button:hover, #home_button:hover {
background: <color:search/button/hover>;
}
#search_button:pressed {
#search_button:pressed, #home_button:pressed {
background: <color:search/button/press>;
}
Executable → Regular
BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 75 KiB

After

Width:  |  Height:  |  Size: 78 KiB

BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 35 KiB

After

Width:  |  Height:  |  Size: 29 KiB

+25 -1
View File
@@ -20,7 +20,14 @@
font-size: 12pt;
}
#recentButton:hover {
#recentButtonMissing {
background: none;
border: none;
color: grey;
font-size: 12pt;
}
#recentButton:hover, #recentButtonMissing:hover {
background-color: #CFD2E0;
border-radius: 10px;
}
@@ -29,4 +36,21 @@
color: black;
font-size: 16pt;
font-weight: bold;
margin-left: 6px;
}
#versionLabel {
color: black;
font-size: 12pt;
font-weight: bold;
}
#updateLabel {
color: black;
font-size: 12pt;
}
#welcomeLabel {
color: black;
font-size: 12pt;
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 146 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 314 B

After

Width:  |  Height:  |  Size: 482 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.5 KiB

After

Width:  |  Height:  |  Size: 20 KiB

BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 578 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.0 KiB

After

Width:  |  Height:  |  Size: 562 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.7 KiB

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.7 KiB

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.0 KiB

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.9 KiB

After

Width:  |  Height:  |  Size: 2.6 KiB

+12 -2
View File
@@ -15,8 +15,8 @@ QListWidget {
}
QListWidget::item {
height: 20px;
border-bottom: 1px solid lightgray;
height: 20px;
}
QListWidget::item:selected {
@@ -26,6 +26,7 @@ QListWidget::item:selected {
QtListItemWidget #field {
background-color: transparent;
border: none;
color: black;
margin-top: 2px;
margin-left: 5px;
}
@@ -34,7 +35,7 @@ QtListItemWidget #field {
border-top: 1px solid lightgray;
}
#plusButton, #minusButton, #dotsButton {
#plusButton, #minusButton, #dotsButton, #editButton {
color: white;
height: 1em;
margin-right: 3px;
@@ -70,6 +71,15 @@ QtListItemWidget #field {
border-image: url(<setting:gui_path>window/dots_hover.png);
}
#editButton {
border-image: url(<setting:gui_path>code_view/images/edit.png);
margin-left: 6px;
}
#editButton:hover {
background-color: #EEE;
}
#dropInfo {
color: #999;
}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 69 KiB

After

Width:  |  Height:  |  Size: 72 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.4 KiB

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.4 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 KiB

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.5 KiB

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.2 KiB

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 672 B

+31 -9
View File
@@ -2,14 +2,16 @@
font-size: 12pt;
}
#title {
QLabel, QCheckBox {
color: black;
}
#title {
font-size: 16pt;
font-weight: bold;
}
#section, #projectTitle {
color: black;
#projectTitle {
font-size: 14pt;
font-weight: bold;
}
@@ -25,24 +27,34 @@
margin-left: 20px;
}
#description {
font-size: 12pt;
}
#label {
font-size: 12pt;
font-weight: bold;
}
#titleLabel {
font-size: 14pt;
font-weight: bold;
}
#formArea {
background: white;
background: transparent;
border: none;
}
#scrollArea {
background: white;
background: transparent;
border: none;
border-top: 1px solid lightgrey;
border-bottom: 1px solid lightgrey;
}
#form {
background: white;
background: transparent;
}
#helpButton, #dotsButton, #refreshButton {
@@ -77,8 +89,10 @@
}
#name, #picker {
background: white;
border-radius: 10px;
border: 1px solid lightgrey;
color: black;
padding: 2px 5px 0px;
}
@@ -86,6 +100,7 @@
background: white;
border: none;
border-radius: 5px;
color: black;
margin-left: 5px;
margin-top: 2px;
}
@@ -110,16 +125,20 @@
border-radius: 8px;
border-bottom-right-radius: 0px;
border-top-right-radius: 0px;
color: black;
font-size: 15pt;
margin-right: 0px;
margin-bottom: 7px;
height: 25px;
width: 90px;
}
#windowButton:hover {
color: white;
background: #2D3F85;
background: #2D3C86;
}
#windowButton:default {
border: 2px solid lightgray;
}
#menuButton:hover, #menuButton:checked {
@@ -141,6 +160,7 @@
#projectButton {
background: white;
border-radius: 8px;
color: black;
font-size: 12pt;
width: 7em;
height: 7em;
@@ -151,8 +171,10 @@
background: #CFD2E0;
}
#files {
#textField, #pathList {
background: white;
border: 1px solid lightgray;
border-radius: 12px;
color: black;
padding: 6px;
}
+1 -1
View File
@@ -1 +1 @@
%windir%\system32\msiexec.exe /I{E6343DF1-6651-4487-BACE-59068B169BA0}
%windir%\system32\msiexec.exe /I{560C569F-03CF-424D-9B63-92B86779ECB6}
+1 -1
View File
@@ -1 +1 @@
%windir%\system32\msiexec.exe /I{99D5E031-E895-47B2-B108-AD026571FD29}
%windir%\system32\msiexec.exe /I{A977609C-DEE3-48BF-8597-302959F82D1A}
+1
View File
@@ -0,0 +1 @@
%windir%\system32\msiexec.exe /x {596E7336-D5B9-449A-95E9-6040F354E283}
@@ -0,0 +1,33 @@
<?xml version="1.0" encoding="utf-8" ?>
<config>
<info>
<description>
WHAT IS THIS?\n
\tJavaParser is an open-source Java project for parsing Java code and\n
\tgenerating an Abstract Syntax Tree (AST). Additionally it supports a\n
\tvisitor pattern to traverse the generated AST. For more information on\n
\tthis project please visit javaparser.org\n
\n
LET'S GET STARTED!\n
\tHave you ever wondered what a parser for a real programming language\n
\tmay look like? Go ahead and find out!\n
\n
\tIf you ask yourself where to start, click the symbol linked below.\n
\n
[com\ts\tp\tngithub\ts\tp\tnjavaparser\ts\tp\tnast\ts\tp\tnbody\ts\tp\tnClassOrInterfaceDeclaration\ts\tp] // &lt;- start here!\n\n
</description>
</info>
<language_settings>
<language>Java</language>
<standard>8</standard>
</language_settings>
<source>
<extensions>
<source_extensions>.java</source_extensions>
</extensions>
<source_paths>
<source_path>./src/main/java</source_path>
<source_path>./target/generated-sources/javacc</source_path>
</source_paths>
</source>
</config>
@@ -0,0 +1,232 @@
/*
* Copyright (C) 2007-2010 Júlio Vilmar Gesser.
* Copyright (C) 2011, 2013-2016 The JavaParser Team.
*
* This file is part of JavaParser.
*
* JavaParser can be used either under the terms of
* a) the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* b) the terms of the Apache License
*
* You should have received a copy of both licenses in LICENCE.LGPL and
* LICENCE.APACHE. Please refer to those files for details.
*
* JavaParser is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*/
package com.github.javaparser;
import com.github.javaparser.ast.CompilationUnit;
import com.github.javaparser.ast.Node;
import com.github.javaparser.ast.comments.Comment;
import com.github.javaparser.ast.comments.CommentsCollection;
import com.github.javaparser.ast.comments.CommentsParser;
import com.github.javaparser.ast.comments.LineComment;
import com.github.javaparser.utils.PositionUtils;
import java.io.IOException;
import java.util.Collections;
import java.util.LinkedList;
import java.util.List;
/**
* Assigns comments to nodes of the AST.
*
* @author Sebastian Kuerten
* @author Júlio Vilmar Gesser
*/
class CommentsInserter {
private boolean doNotAssignCommentsPreceedingEmptyLines = true;
private boolean doNotConsiderAnnotationsAsNodeStartForCodeAttribution = false;
CommentsInserter() {
}
/**
* Adds the comments found in the source code of a compilation unit to that compilation unit.
* @param cu an already created compilation unit
* @param cuSourceCode the source code of the compilation unit. It will be parsed to find comments.
*/
public void insertComments(CompilationUnit cu, String cuSourceCode) throws IOException {
CommentsParser commentsParser = new CommentsParser();
CommentsCollection allComments = commentsParser.parse(cuSourceCode);
insertCommentsInCu(cu, allComments);
}
public boolean getDoNotConsiderAnnotationsAsNodeStartForCodeAttribution() {
return doNotConsiderAnnotationsAsNodeStartForCodeAttribution;
}
public void setDoNotConsiderAnnotationsAsNodeStartForCodeAttribution(boolean newValue) {
this.doNotConsiderAnnotationsAsNodeStartForCodeAttribution = newValue;
}
public boolean getDoNotAssignCommentsPreceedingEmptyLines() {
return doNotAssignCommentsPreceedingEmptyLines;
}
public void setDoNotAssignCommentsPreceedingEmptyLines(boolean newValue) {
this.doNotAssignCommentsPreceedingEmptyLines = newValue;
}
/**
* Comments are attributed to the thing the comment and are removed from
* allComments.
*/
private void insertCommentsInCu(CompilationUnit cu,
CommentsCollection commentsCollection) {
if (commentsCollection.size() == 0)
return;
// I should sort all the direct children and the comments, if a comment
// is the first thing then it
// a comment to the CompilationUnit
// FIXME if there is no package it could be also a comment to the
// following class...
// so I could use some heuristics in these cases to distinguish the two
// cases
List<Comment> comments = commentsCollection.getAll();
PositionUtils.sortByBeginPosition(comments);
List<Node> children = cu.getChildrenNodes();
PositionUtils.sortByBeginPosition(children);
if (cu.getPackage() != null
&& (children.isEmpty() || PositionUtils.areInOrder(
comments.get(0), children.get(0)))) {
cu.setComment(comments.get(0));
comments.remove(0);
}
insertCommentsInNode(cu, comments);
}
/**
* This method try to attributes the nodes received to child of the node. It
* returns the node that were not attributed.
*/
private void insertCommentsInNode(Node node,
List<Comment> commentsToAttribute) {
if (commentsToAttribute.isEmpty())
return;
// the comments can:
// 1) Inside one of the child, then it is the child that have to
// associate them
// 2) If they are not inside a child they could be preceeding nothing, a
// comment or a child
// if they preceed a child they are assigned to it, otherweise they
// remain "orphans"
List<Node> children = node.getChildrenNodes();
PositionUtils.sortByBeginPosition(children);
for (Node child : children) {
List<Comment> commentsInsideChild = new LinkedList<Comment>();
for (Comment c : commentsToAttribute) {
if (PositionUtils.nodeContains(child, c,
doNotConsiderAnnotationsAsNodeStartForCodeAttribution)) {
commentsInsideChild.add(c);
}
}
commentsToAttribute.removeAll(commentsInsideChild);
insertCommentsInNode(child, commentsInsideChild);
}
// I can attribute in line comments to elements preceeding them, if
// there
// is something contained in their line
List<Comment> attributedComments = new LinkedList<Comment>();
for (Comment comment : commentsToAttribute) {
if (comment.isLineComment()) {
for (Node child : children) {
if (child.getEnd().line == comment.getBegin().line
&& attributeLineCommentToNodeOrChild(child,
comment.asLineComment())) {
attributedComments.add(comment);
}
}
}
}
// at this point I create an ordered list of all remaining comments and
// children
Comment previousComment = null;
attributedComments = new LinkedList<Comment>();
List<Node> childrenAndComments = new LinkedList<Node>();
childrenAndComments.addAll(children);
childrenAndComments.addAll(commentsToAttribute);
PositionUtils.sortByBeginPosition(childrenAndComments,
doNotConsiderAnnotationsAsNodeStartForCodeAttribution);
for (Node thing : childrenAndComments) {
if (thing instanceof Comment) {
previousComment = (Comment) thing;
if (!previousComment.isOrphan()) {
previousComment = null;
}
} else {
if (previousComment != null && !thing.hasComment()) {
if (!doNotAssignCommentsPreceedingEmptyLines
|| !thereAreLinesBetween(previousComment, thing)) {
thing.setComment(previousComment);
attributedComments.add(previousComment);
previousComment = null;
}
}
}
}
commentsToAttribute.removeAll(attributedComments);
// all the remaining are orphan nodes
for (Comment c : commentsToAttribute) {
if (c.isOrphan()) {
node.addOrphanComment(c);
}
}
}
private boolean attributeLineCommentToNodeOrChild(Node node,
LineComment lineComment) {
// The node start and end at the same line as the comment,
// let's give to it the comment
if (node.getBegin().line == lineComment.getBegin().line
&& !node.hasComment()) {
if(!(node instanceof Comment)) {
node.setComment(lineComment);
}
return true;
} else {
// try with all the children, sorted by reverse position (so the
// first one is the nearest to the comment
List<Node> children = new LinkedList<Node>();
children.addAll(node.getChildrenNodes());
PositionUtils.sortByBeginPosition(children);
Collections.reverse(children);
for (Node child : children) {
if (attributeLineCommentToNodeOrChild(child, lineComment)) {
return true;
}
}
return false;
}
}
private boolean thereAreLinesBetween(Node a, Node b) {
if (!PositionUtils.areInOrder(a, b)) {
return thereAreLinesBetween(b, a);
}
int endOfA = a.getEnd().line;
return b.getBegin().line > (endOfA + 1);
}
}
@@ -0,0 +1,563 @@
/*
* Copyright (C) 2007-2010 Júlio Vilmar Gesser.
* Copyright (C) 2011, 2013-2016 The JavaParser Team.
*
* This file is part of JavaParser.
*
* JavaParser can be used either under the terms of
* a) the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* b) the terms of the Apache License
*
* You should have received a copy of both licenses in LICENCE.LGPL and
* LICENCE.APACHE. Please refer to those files for details.
*
* JavaParser is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*/
package com.github.javaparser;
import java.io.*;
import com.github.javaparser.ast.CompilationUnit;
import com.github.javaparser.ast.ImportDeclaration;
import com.github.javaparser.ast.body.BodyDeclaration;
import com.github.javaparser.ast.expr.AnnotationExpr;
import com.github.javaparser.ast.expr.Expression;
import com.github.javaparser.ast.stmt.BlockStmt;
import com.github.javaparser.ast.stmt.Statement;
import java.nio.charset.Charset;
import java.util.List;
import static com.github.javaparser.utils.Utils.readerToString;
/**
* Parse Java source code and creates Abstract Syntax Tree classes.
*
* @author Júlio Vilmar Gesser
*/
public final class JavaParser {
private static final CommentsInserter commentsInserter = new CommentsInserter();
private static final Charset UTF8 = Charset.forName("utf-8");
private ASTParser astParser = null;
private Provider provider = null;
/**
* Instantiate the parser. Note that parsing can also be done with the static methods on this class.
* Creating an instance will reduce setup time between parsing files.
*/
public JavaParser() {
// No specific constructors for this class.
}
public JavaParser setSource(Provider provider) {
this.provider=provider;
if(astParser==null) {
astParser = new ASTParser(provider);
}else{
astParser.ReInit(provider);
}
return this;
}
public JavaParser setSource(Reader reader) {
return setSource(new StreamProvider(reader));
}
public JavaParser setSource(InputStream input) throws IOException {
return setSource(new StreamProvider(input));
}
public JavaParser setSource(InputStream input, Charset encoding) throws IOException {
return setSource(new StreamProvider(input, encoding.name()));
}
public JavaParser setSource(File file) throws IOException {
return setSource(new FileInputStream(file));
}
public JavaParser setSource(File file, Charset encoding) throws IOException {
return setSource(new FileInputStream(file), encoding);
}
public JavaParser setSource(String source) {
return setSource(new StringReader(source));
}
/**
* Return the list of tokens that have been encountered while parsing code
* using this parser.
*
* @return a list of tokens
*/
public List<Token> getTokens() {
checkSourceSet();
return astParser.getTokens();
}
private void checkSourceSet() {
if (astParser == null || provider == null) {
throw new IllegalStateException("Please setSource() before doing any parsing.");
}
}
/**
* Parses the Java code and returns a {@link CompilationUnit} that
* represents it.
*
* @return CompilationUnit representing the Java source code
* @throws ParseException
* if the source code has parser errors
*/
public CompilationUnit parse() throws ParseException {
try {
checkSourceSet();
return astParser.CompilationUnit();
} finally {
closeProvider();
}
}
private void closeProvider() {
try {
checkSourceSet();
provider.close();
} catch (IOException e) {
// Since we're done parsing and have our result, we don't care about any errors.
}
}
/**
* Parses the Java block and returns a {@link BlockStmt} that represents it.
*
* @return BlockStmt representing the Java block
* @throws ParseException
* if the source code has parser errors
*/
public BlockStmt parseBlock() throws ParseException {
try{
checkSourceSet();
return astParser.Block();
} finally {
closeProvider();
}
}
/**
* Parses the Java block and returns a {@link List} of {@link Statement}s
* that represents it.
*
* @return Statement representing the Java statement
* @throws ParseException
* if the source code has parser errors
*/
public List<Statement> parseStatements() throws ParseException {
try {
checkSourceSet();
return astParser.Statements();
} finally {
closeProvider();
}
}
/**
* Parses the Java statement and returns a {@link Statement} that represents
* it.
*
* @return Statement representing the Java statement
* @throws ParseException
* if the source code has parser errors
*/
public Statement parseStatement() throws ParseException {
try {
checkSourceSet();
return astParser.Statement();
} finally {
closeProvider();
}
}
/**
* Parses the Java import and returns a {@link ImportDeclaration} that
* represents it.
*
* @return ImportDeclaration representing the Java import declaration
* @throws ParseException
* if the source code has parser errors
*/
public ImportDeclaration parseImport() throws ParseException {
try {
checkSourceSet();
return astParser.ImportDeclaration();
} finally {
closeProvider();
}
}
/**
* Parses the Java expression and returns a {@link Expression} that
* represents it.
*
* @return Expression representing the Java expression
* @throws ParseException
* if the source code has parser errors
*/
public Expression parseExpression() throws ParseException {
try {
checkSourceSet();
return astParser.Expression();
} finally {
closeProvider();
}
}
/**
* Parses the Java annotation and returns a {@link AnnotationExpr} that
* represents it.
*
* @return AnnotationExpr representing the Java annotation
* @throws ParseException
* if the source code has parser errors
*/
public AnnotationExpr parseAnnotation() throws ParseException {
try {
checkSourceSet();
return astParser.Annotation();
} finally {
closeProvider();
}
}
/**
* Parses the Java body declaration(e.g fields or methods) and returns a
* {@link BodyDeclaration} that represents it.
*
* @return BodyDeclaration representing the Java body
* @throws ParseException
* if the source code has parser errors
*/
public BodyDeclaration<?> parseBodyDeclaration() throws ParseException {
try {
checkSourceSet();
return astParser.AnnotationBodyDeclaration();
} finally {
closeProvider();
}
}
/**
* Parses a Java class body declaration(e.g fields or methods) and returns a
* {@link BodyDeclaration} that represents it.
*
* @return BodyDeclaration representing the Java class body
* @throws ParseException
* if the source code has parser errors
*/
public BodyDeclaration<?> parseClassBodyDeclaration() throws ParseException {
try {
checkSourceSet();
return astParser.ClassOrInterfaceBodyDeclaration(false);
} finally {
closeProvider();
}
}
/**
* Parses a Java interface body declaration(e.g fields or methods) and returns a
* {@link BodyDeclaration} that represents it.
*
* @return BodyDeclaration representing the Java interface body
* @throws ParseException
* if the source code has parser errors
*/
public BodyDeclaration<?> parseInterfaceBodyDeclaration() throws ParseException {
try {
checkSourceSet();
return astParser.ClassOrInterfaceBodyDeclaration(true);
} finally {
closeProvider();
}
}
public static boolean getDoNotConsiderAnnotationsAsNodeStartForCodeAttribution() {
return commentsInserter.getDoNotConsiderAnnotationsAsNodeStartForCodeAttribution();
}
public static void setDoNotConsiderAnnotationsAsNodeStartForCodeAttribution(boolean newValue) {
commentsInserter.setDoNotConsiderAnnotationsAsNodeStartForCodeAttribution(newValue);
}
public static boolean getDoNotAssignCommentsPreceedingEmptyLines() {
return commentsInserter.getDoNotAssignCommentsPreceedingEmptyLines();
}
public static void setDoNotAssignCommentsPreceedingEmptyLines(boolean newValue) {
commentsInserter.setDoNotAssignCommentsPreceedingEmptyLines(newValue);
}
public static CompilationUnit parse(final InputStream in,
final Charset encoding) throws ParseException {
return parse(in,encoding,true);
}
/**
* Parses the Java code contained in the {@link InputStream} and returns a
* {@link CompilationUnit} that represents it.
*
* @param in
* {@link InputStream} containing Java source code
* @param encoding
* encoding of the source code
* @return CompilationUnit representing the Java source code
* @throws ParseException
* if the source code has parser errors
*/
public static CompilationUnit parse(final InputStream in,
Charset encoding,
boolean considerComments) throws ParseException {
try {
try (InputStreamReader inputStreamReader = new InputStreamReader(in, encoding)) {
return parse(inputStreamReader, considerComments);
}
} catch (IOException ioe) {
throw new ParseException(ioe.getMessage());
}
}
/**
* Parses the Java code contained in the {@link InputStream} and returns a
* {@link CompilationUnit} that represents it.<br>
* Note: Uses UTF-8 encoding
*
* @param in
* {@link InputStream} containing Java source code
* @return CompilationUnit representing the Java source code
* @throws ParseException
* if the source code has parser errors
*/
public static CompilationUnit parse(final InputStream in)
throws ParseException {
return parse(in, UTF8, true);
}
public static CompilationUnit parse(final File file, final Charset encoding)
throws ParseException, IOException {
return parse(file,encoding,true);
}
/**
* Parses the Java code contained in a {@link File} and returns a
* {@link CompilationUnit} that represents it.
*
* @param file
* {@link File} containing Java source code
* @param encoding
* encoding of the source code
* @return CompilationUnit representing the Java source code
* @throws ParseException
* if the source code has parser errors
*/
public static CompilationUnit parse(final File file, final Charset encoding, boolean considerComments)
throws ParseException {
try {
try (FileInputStream in = new FileInputStream(file)) {
return parse(in, encoding, considerComments);
}
} catch (IOException ioe) {
throw new ParseException(ioe.getMessage());
}
}
/**
* Parses the Java code contained in a {@link File} and returns a
* {@link CompilationUnit} that represents it.<br>
* Note: Uses UTF-8 encoding
*
*
* @param file
* {@link File} containing Java source code
* @return CompilationUnit representing the Java source code
* @throws ParseException
* if the source code has parser errors
* @throws IOException
*/
public static CompilationUnit parse(final File file) throws ParseException,
IOException {
return parse(file, UTF8, true);
}
public static CompilationUnit parse(final Reader reader)
throws ParseException {
return parse(reader, true);
}
public static CompilationUnit parse(final Reader reader, boolean considerComments)
throws ParseException {
try {
String comments = readerToString(reader);
CompilationUnit cu = new JavaParser().setSource(comments).parse();
if (considerComments){
commentsInserter.insertComments(cu, comments);
}
return cu;
} catch (IOException ioe){
throw new ParseException(ioe.getMessage());
}
}
/**
* Parses the Java code contained in code and returns a
* {@link CompilationUnit} that represents it.
*
* @param code Java source code
* @param considerComments parse or ignore comments
* @return CompilationUnit representing the Java source code
* @throws ParseException if the source code has parser errors
*/
public static CompilationUnit parse(String code, boolean considerComments) throws ParseException {
return parse(new StringReader(code), considerComments);
}
/**
* Parses the Java code contained in code and returns a
* {@link CompilationUnit} that represents it.
*
* @param code Java source code
* @return CompilationUnit representing the Java source code
* @throws ParseException if the source code has parser errors
*/
public static CompilationUnit parse(String code) throws ParseException {
return parse(code, true);
}
/**
* Parses the Java block contained in a {@link String} and returns a
* {@link BlockStmt} that represents it.
*
* @param blockStatement
* {@link String} containing Java block code
* @return BlockStmt representing the Java block
* @throws ParseException
* if the source code has parser errors
*/
public static BlockStmt parseBlock(final String blockStatement)
throws ParseException {
return new JavaParser().setSource(blockStatement).parseBlock();
}
/**
* Parses the Java statement contained in a {@link String} and returns a
* {@link Statement} that represents it.
*
* @param statement
* {@link String} containing Java statement code
* @return Statement representing the Java statement
* @throws ParseException
* if the source code has parser errors
*/
public static Statement parseStatement(final String statement) throws ParseException {
return new JavaParser().setSource(statement).parseStatement();
}
/**
* Parses the Java statements contained in a {@link String} and returns a
* list of {@link Statement} that represents it.
*
* @param statements
* {@link String} containing Java statements
* @return list of Statement representing the Java statement
* @throws ParseException
* if the source code has parser errors
*/
public static List<Statement> parseStatements(final String statements) throws ParseException {
return new JavaParser().setSource(statements).parseStatements();
}
/**
* Parses the Java import contained in a {@link String} and returns a
* {@link ImportDeclaration} that represents it.
*
* @param importDeclaration
* {@link String} containing Java import code
* @return ImportDeclaration representing the Java import declaration
* @throws ParseException
* if the source code has parser errors
*/
public static ImportDeclaration parseImport(final String importDeclaration) throws ParseException {
return new JavaParser().setSource(importDeclaration).parseImport();
}
/**
* Parses the Java expression contained in a {@link String} and returns a
* {@link Expression} that represents it.
*
* @param expression
* {@link String} containing Java expression
* @return Expression representing the Java expression
* @throws ParseException
* if the source code has parser errors
*/
public static Expression parseExpression(final String expression) throws ParseException {
return new JavaParser().setSource(expression).parseExpression();
}
/**
* Parses the Java annotation contained in a {@link String} and returns a
* {@link AnnotationExpr} that represents it.
*
* @param annotation
* {@link String} containing Java annotation
* @return AnnotationExpr representing the Java annotation
* @throws ParseException
* if the source code has parser errors
*/
public static AnnotationExpr parseAnnotation(final String annotation) throws ParseException {
return new JavaParser().setSource(annotation).parseAnnotation();
}
/**
* Parses the Java body declaration(e.g fields or methods) contained in a
* {@link String} and returns a {@link BodyDeclaration} that represents it.
*
* @param body
* {@link String} containing Java body declaration
* @return BodyDeclaration representing the Java annotation
* @throws ParseException
* if the source code has parser errors
*/
public static BodyDeclaration<?> parseBodyDeclaration(final String body) throws ParseException {
return new JavaParser().setSource(body).parseBodyDeclaration();
}
/**
* Parses a Java class body declaration(e.g fields or methods) and returns a
* {@link BodyDeclaration} that represents it.
*
* @param body the body of a class
* @return BodyDeclaration representing the Java class body
* @throws ParseException
* if the source code has parser errors
*/
public static BodyDeclaration<?> parseClassBodyDeclaration(String body) throws ParseException {
return new JavaParser().setSource(body).parseClassBodyDeclaration();
}
/**
* Parses a Java interface body declaration(e.g fields or methods) and returns a
* {@link BodyDeclaration} that represents it.
*
* @param body the body of an interface
* @return BodyDeclaration representing the Java interface body
* @throws ParseException
* if the source code has parser errors
*/
public static BodyDeclaration parseInterfaceBodyDeclaration(String body) throws ParseException {
return new JavaParser().setSource(body).parseInterfaceBodyDeclaration();
}
}
@@ -0,0 +1,137 @@
/*
* Copyright (C) 2007-2010 Júlio Vilmar Gesser.
* Copyright (C) 2011, 2013-2016 The JavaParser Team.
*
* This file is part of JavaParser.
*
* JavaParser can be used either under the terms of
* a) the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* b) the terms of the Apache License
*
* You should have received a copy of both licenses in LICENCE.LGPL and
* LICENCE.APACHE. Please refer to those files for details.
*
* JavaParser is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*/
package com.github.javaparser;
import com.github.javaparser.ast.Node;
/**
* A position in a source file. Lines and columns start counting at 1.
*/
public class Position implements Comparable<Position> {
public final int line;
public final int column;
public static final Position ABSOLUTE_START = new Position(Node.ABSOLUTE_BEGIN_LINE, -1);
public static final Position ABSOLUTE_END = new Position(Node.ABSOLUTE_END_LINE, -1);
/**
* The first position in the file
*/
public static final Position HOME = new Position(1, 1);
public static final Position UNKNOWN = new Position(0, 0);
public Position(int line, int column) {
if (line < Node.ABSOLUTE_END_LINE) {
throw new IllegalArgumentException("Can't position at line " + line);
}
if (column < -1) {
throw new IllegalArgumentException("Can't position at column " + column);
}
this.line = line;
this.column = column;
}
/**
* Convenient factory method.
*/
public static Position pos(int line, int column) {
return new Position(line, column);
}
public Position withColumn(int column) {
return new Position(this.line, column);
}
public Position withLine(int line) {
return new Position(line, this.column);
}
/**
* Check if the position is usable. Does not know what it is pointing at, so it can't check if the position is after the end of the source.
*/
public boolean valid() {
return line > 0 && column > 0;
}
public boolean invalid() {
return !valid();
}
public Position orIfInvalid(Position anotherPosition) {
if (valid()) {
return this;
}
return anotherPosition;
}
public boolean isAfter(Position position) {
if (position.line == Node.ABSOLUTE_BEGIN_LINE) return true;
if (line > position.line) {
return true;
} else if (line == position.line) {
return column > position.column;
}
return false;
}
public boolean isBefore(Position position) {
if (position.line == Node.ABSOLUTE_END_LINE) return true;
if (line < position.line) {
return true;
} else if (line == position.line) {
return column < position.column;
}
return false;
}
@Override
public int compareTo(Position o) {
if (isBefore(o)) {
return -1;
}
if (isAfter(o)) {
return 1;
}
return 0;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
Position position = (Position) o;
return line == position.line && column == position.column;
}
@Override
public int hashCode() {
return 31 * line + column;
}
@Override
public String toString() {
return "(line " + line + ",col " + column + ")";
}
}
@@ -0,0 +1,89 @@
package com.github.javaparser;
import static com.github.javaparser.Position.pos;
/**
* A range of characters in a source file, from "begin" to "end", including the characters at "begin" and "end".
*/
public class Range {
public static final Range UNKNOWN = range(Position.UNKNOWN, Position.UNKNOWN);
public final Position begin;
public final Position end;
public Range(Position begin, Position end) {
if (begin == null) {
throw new IllegalArgumentException("begin can't be null");
}
if (end == null) {
throw new IllegalArgumentException("end can't be null");
}
this.begin = begin;
this.end = end;
}
public static Range range(Position begin, Position end) {
return new Range(begin, end);
}
public static Range range(int beginLine, int beginColumn, int endLine, int endColumn) {
return new Range(pos(beginLine, beginColumn), pos(endLine, endColumn));
}
public Range withBeginColumn(int column) {
return range(begin.withColumn(column), end);
}
public Range withBeginLine(int line) {
return range(begin.withLine(line), end);
}
public Range withEndColumn(int column) {
return range(begin, end.withColumn(column));
}
public Range withEndLine(int line) {
return range(begin, end.withLine(line));
}
public Range withBegin(Position begin) {
return range(begin, this.end);
}
public Range withEnd(Position end) {
return range(this.begin, end);
}
public boolean contains(Range other) {
return begin.isBefore(other.begin) && end.isAfter(other.end);
}
public boolean isBefore(Position position) {
return end.isBefore(position);
}
public boolean isAfter(Position position) {
return begin.isAfter(position);
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
Range range = (Range) o;
return begin.equals(range.begin) && end.equals(range.end);
}
@Override
public int hashCode() {
return 31 * begin.hashCode() + end.hashCode();
}
@Override
public String toString() {
return begin+"-"+end;
}
}
@@ -0,0 +1,47 @@
/*
* Copyright (C) 2007-2010 Júlio Vilmar Gesser.
* Copyright (C) 2011, 2013-2016 The JavaParser Team.
*
* This file is part of JavaParser.
*
* JavaParser can be used either under the terms of
* a) the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* b) the terms of the Apache License
*
* You should have received a copy of both licenses in LICENCE.LGPL and
* LICENCE.APACHE. Please refer to those files for details.
*
* JavaParser is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*/
package com.github.javaparser.ast;
/**
* Access specifier. Represents one of the possible levels of
* access permitted by the language.
*
* @author Federico Tomassetti
* @since July 2014
*/
public enum AccessSpecifier {
PUBLIC("public"),
PRIVATE("private"),
PROTECTED("protected"),
DEFAULT("");
private String codeRepresenation;
AccessSpecifier(String codeRepresentation) {
this.codeRepresenation = codeRepresentation;
}
public String getCodeRepresenation(){
return this.codeRepresenation;
}
}
@@ -0,0 +1,404 @@
/*
* Copyright (C) 2007-2010 Júlio Vilmar Gesser.
* Copyright (C) 2011, 2013-2016 The JavaParser Team.
*
* This file is part of JavaParser.
*
* JavaParser can be used either under the terms of
* a) the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* b) the terms of the Apache License
*
* You should have received a copy of both licenses in LICENCE.LGPL and
* LICENCE.APACHE. Please refer to those files for details.
*
* JavaParser is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*/
package com.github.javaparser.ast;
import static com.github.javaparser.utils.Utils.ensureNotNull;
import java.util.Arrays;
import java.util.EnumSet;
import java.util.List;
import java.util.stream.Collectors;
import com.github.javaparser.ast.expr.NameExpr;
import com.github.javaparser.utils.ClassUtils;
import com.github.javaparser.Range;
import com.github.javaparser.ast.body.AnnotationDeclaration;
import com.github.javaparser.ast.body.ClassOrInterfaceDeclaration;
import com.github.javaparser.ast.body.EmptyTypeDeclaration;
import com.github.javaparser.ast.body.EnumDeclaration;
import com.github.javaparser.ast.body.TypeDeclaration;
import com.github.javaparser.ast.comments.Comment;
import com.github.javaparser.ast.comments.JavadocComment;
import com.github.javaparser.ast.visitor.GenericVisitor;
import com.github.javaparser.ast.visitor.VoidVisitor;
/**
* <p>
* This class represents the entire compilation unit. Each java file denotes a
* compilation unit.
* </p>
* The CompilationUnit is constructed following the syntax:<br>
*
* <pre>
* {@code
* CompilationUnit ::= ( }{@link PackageDeclaration}{@code )?
* ( }{@link ImportDeclaration}{@code )*
* ( }{@link TypeDeclaration}{@code )*
* }
* </pre>
*
* @author Julio Vilmar Gesser
*/
public final class CompilationUnit extends Node {
private PackageDeclaration pakage;
private List<ImportDeclaration> imports;
private List<TypeDeclaration<?>> types;
public CompilationUnit() {
}
public CompilationUnit(PackageDeclaration pakage, List<ImportDeclaration> imports, List<TypeDeclaration<?>> types) {
setPackage(pakage);
setImports(imports);
setTypes(types);
}
public CompilationUnit(Range range, PackageDeclaration pakage, List<ImportDeclaration> imports,
List<TypeDeclaration<?>> types) {
super(range);
setPackage(pakage);
setImports(imports);
setTypes(types);
}
@Override
public <R, A> R accept(GenericVisitor<R, A> v, A arg) {
return v.visit(this, arg);
}
@Override
public <A> void accept(VoidVisitor<A> v, A arg) {
v.visit(this, arg);
}
/**
* Return a list containing all comments declared in this compilation unit.
* Including javadocs, line comments and block comments of all types,
* inner-classes and other members.<br>
* If there is no comment, <code>null</code> is returned.
*
* @return list with all comments of this compilation unit or
* <code>null</code>
* @see JavadocComment
* @see com.github.javaparser.ast.comments.LineComment
* @see com.github.javaparser.ast.comments.BlockComment
*/
public List<Comment> getComments() {
return this.getAllContainedComments();
}
/**
* Retrieves the list of imports declared in this compilation unit or
* <code>null</code> if there is no import.
*
* @return the list of imports or <code>null</code> if there is no import
*/
public List<ImportDeclaration> getImports() {
imports = ensureNotNull(imports);
return imports;
}
/**
* Retrieves the package declaration of this compilation unit.<br>
* If this compilation unit has no package declaration (default package),
* <code>null</code> is returned.
*
* @return the package declaration or <code>null</code>
*/
public PackageDeclaration getPackage() {
return pakage;
}
/**
* Return the list of types declared in this compilation unit.<br>
* If there is no types declared, <code>null</code> is returned.
*
* @return the list of types or <code>null</code> null if there is no type
* @see AnnotationDeclaration
* @see ClassOrInterfaceDeclaration
* @see EmptyTypeDeclaration
* @see EnumDeclaration
*/
public List<TypeDeclaration<?>> getTypes() {
types = ensureNotNull(types);
return types;
}
/**
* Sets the list of comments of this compilation unit.
*
* @param comments
* the list of comments
*/
public void setComments(List<Comment> comments) {
throw new RuntimeException("Not implemented!");
}
/**
* Sets the list of imports of this compilation unit. The list is initially
* <code>null</code>.
*
* @param imports
* the list of imports
*/
public void setImports(List<ImportDeclaration> imports) {
this.imports = imports;
setAsParentNodeOf(this.imports);
}
/**
* Sets or clear the package declarations of this compilation unit.
*
* @param pakage
* the pakage declaration to set or <code>null</code> to default
* package
*/
public void setPackage(PackageDeclaration pakage) {
this.pakage = pakage;
setAsParentNodeOf(this.pakage);
}
/**
* Sets the list of types declared in this compilation unit.
*
* @param types
* the lis of types
*/
public void setTypes(List<TypeDeclaration<?>> types) {
this.types = types;
setAsParentNodeOf(this.types);
}
/**
* sets the package declaration of this compilation unit
*
* @param name the name of the package
* @return this, the {@link CompilationUnit}
*/
public CompilationUnit setPackageName(String name) {
setPackage(new PackageDeclaration(NameExpr.create(name)));
return this;
}
/**
* Add an import to the list of {@link ImportDeclaration} of this compilation unit<br>
* shorthand for {@link #addImport(String, boolean, boolean)} with name,false,false
*
* @param name the import name
* @return this, the {@link CompilationUnit}
*/
public CompilationUnit addImport(String name) {
return addImport(name, false, false);
}
/**
* Add an import to the list of {@link ImportDeclaration} of this compilation unit<br>
* shorthand for {@link #addImport(String)} with clazz.getName()
*
* @param clazz the class to import
* @return this, the {@link CompilationUnit}
*/
public CompilationUnit addImport(Class<?> clazz) {
if (ClassUtils.isPrimitiveOrWrapper(clazz) || clazz.getName().startsWith("java.lang"))
return this;
else if (clazz.isArray() && !ClassUtils.isPrimitiveOrWrapper(clazz.getComponentType())
&& !clazz.getComponentType().getName().startsWith("java.lang"))
return addImport(clazz.getComponentType().getName());
return addImport(clazz.getName());
}
/**
* Add an import to the list of {@link ImportDeclaration} of this compilation unit<br>
* <b>This method check if no import with the same name is already in the list</b>
*
* @param name the import name
* @param isStatic is it an "import static"
* @param isAsterisk does the import end with ".*"
* @return this, the {@link CompilationUnit}
*/
public CompilationUnit addImport(String name, boolean isStatic, boolean isAsterisk) {
if (getImports().stream().anyMatch(i -> i.getName().toString().equals(name)))
return this;
else {
ImportDeclaration importDeclaration = new ImportDeclaration(NameExpr.create(name), isStatic,
isAsterisk);
getImports().add(importDeclaration);
importDeclaration.setParentNode(this);
return this;
}
}
/**
* Add a public class to the types of this compilation unit
*
* @param name the class name
* @return the newly created class
*/
public ClassOrInterfaceDeclaration addClass(String name) {
return addClass(name, Modifier.PUBLIC);
}
/**
* Add a class to the types of this compilation unit
*
* @param name the class name
* @param modifiers the modifiers (like Modifier.PUBLIC)
* @return the newly created class
*/
public ClassOrInterfaceDeclaration addClass(String name, Modifier... modifiers) {
ClassOrInterfaceDeclaration classOrInterfaceDeclaration = new ClassOrInterfaceDeclaration(
Arrays.stream(modifiers)
.collect(Collectors.toCollection(() -> EnumSet.noneOf(Modifier.class))),
false, name);
getTypes().add(classOrInterfaceDeclaration);
classOrInterfaceDeclaration.setParentNode(this);
return classOrInterfaceDeclaration;
}
/**
* Add a public interface class to the types of this compilation unit
*
* @param name the interface name
* @return the newly created class
*/
public ClassOrInterfaceDeclaration addInterface(String name) {
return addInterface(name, Modifier.PUBLIC);
}
/**
* Add an interface to the types of this compilation unit
*
* @param name the interface name
* @param modifiers the modifiers (like Modifier.PUBLIC)
* @return the newly created class
*/
public ClassOrInterfaceDeclaration addInterface(String name, Modifier... modifiers) {
ClassOrInterfaceDeclaration classOrInterfaceDeclaration = new ClassOrInterfaceDeclaration(
Arrays.stream(modifiers)
.collect(Collectors.toCollection(() -> EnumSet.noneOf(Modifier.class))),
true, name);
getTypes().add(classOrInterfaceDeclaration);
classOrInterfaceDeclaration.setParentNode(this);
return classOrInterfaceDeclaration;
}
/**
* Add a public enum to the types of this compilation unit
*
* @param name the enum name
* @return the newly created class
*/
public EnumDeclaration addEnum(String name) {
return addEnum(name, Modifier.PUBLIC);
}
/**
* Add an enum to the types of this compilation unit
*
* @param name the enum name
* @param modifiers the modifiers (like Modifier.PUBLIC)
* @return the newly created class
*/
public EnumDeclaration addEnum(String name, Modifier... modifiers) {
EnumDeclaration enumDeclaration = new EnumDeclaration(Arrays.stream(modifiers)
.collect(Collectors.toCollection(() -> EnumSet.noneOf(Modifier.class))), name);
getTypes().add(enumDeclaration);
enumDeclaration.setParentNode(this);
return enumDeclaration;
}
/**
* Add a public annotation declaration to the types of this compilation unit
*
* @param name the annotation name
* @return the newly created class
*/
public AnnotationDeclaration addAnnotationDeclaration(String name) {
return addAnnotationDeclaration(name, Modifier.PUBLIC);
}
/**
* Add an annotation declaration to the types of this compilation unit
*
* @param name the annotation name
* @param modifiers the modifiers (like Modifier.PUBLIC)
* @return the newly created class
*/
public AnnotationDeclaration addAnnotationDeclaration(String name, Modifier... modifiers) {
AnnotationDeclaration annotationDeclaration = new AnnotationDeclaration(Arrays.stream(modifiers)
.collect(Collectors.toCollection(() -> EnumSet.noneOf(Modifier.class))), name);
getTypes().add(annotationDeclaration);
annotationDeclaration.setParentNode(this);
return annotationDeclaration;
}
/**
* Try to get a class by its name
*
* @param className the class name (case-sensitive)
* @return null if not found, the class otherwise
*/
public ClassOrInterfaceDeclaration getClassByName(String className) {
return (ClassOrInterfaceDeclaration) getTypes().stream().filter(type -> type.getName().equals(className)
&& type instanceof ClassOrInterfaceDeclaration && !((ClassOrInterfaceDeclaration) type).isInterface())
.findFirst().orElse(null);
}
/**
* Try to get an interface by its name
*
* @param interfaceName the interface name (case-sensitive)
* @return null if not found, the interface otherwise
*/
public ClassOrInterfaceDeclaration getInterfaceByName(String interfaceName) {
return (ClassOrInterfaceDeclaration) getTypes().stream().filter(type -> type.getName().equals(interfaceName)
&& type instanceof ClassOrInterfaceDeclaration && ((ClassOrInterfaceDeclaration) type).isInterface())
.findFirst().orElse(null);
}
/**
* Try to get an enum by its name
*
* @param enumName the enum name (case-sensitive)
* @return null if not found, the enum otherwise
*/
public EnumDeclaration getEnumByName(String enumName) {
return (EnumDeclaration) getTypes().stream().filter(type -> type.getName().equals(enumName)
&& type instanceof EnumDeclaration)
.findFirst().orElse(null);
}
/**
* Try to get an annotation by its name
*
* @param annotationName the annotation name (case-sensitive)
* @return null if not found, the annotation otherwise
*/
public AnnotationDeclaration getAnnotationDeclarationByName(String annotationName) {
return (AnnotationDeclaration) getTypes().stream().filter(type -> type.getName().equals(annotationName)
&& type instanceof AnnotationDeclaration)
.findFirst().orElse(null);
}
}
@@ -0,0 +1,185 @@
/*
* Copyright (C) 2007-2010 Júlio Vilmar Gesser.
* Copyright (C) 2011, 2013-2016 The JavaParser Team.
*
* This file is part of JavaParser.
*
* JavaParser can be used either under the terms of
* a) the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* b) the terms of the Apache License
*
* You should have received a copy of both licenses in LICENCE.LGPL and
* LICENCE.APACHE. Please refer to those files for details.
*
* JavaParser is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*/
package com.github.javaparser.ast;
import com.github.javaparser.Range;
import com.github.javaparser.ast.expr.NameExpr;
import com.github.javaparser.ast.visitor.GenericVisitor;
import com.github.javaparser.ast.visitor.VoidVisitor;
/**
* <p>
* This class represents a import declaration or an empty import declaration. Imports are optional for the
* {@link CompilationUnit}.
* </p>
* The ImportDeclaration is constructed following the syntax:<br>
* <pre>
* {@code
* ImportDeclaration ::= "import" ( "static" )? }{@link NameExpr}{@code ( "." "*" )? ";"
* }
* </pre>
* An enmpty import declaration is simply a semicolon among the import declarations.
* @author Julio Vilmar Gesser
*/
public final class ImportDeclaration extends Node {
private NameExpr name;
private boolean static_;
private boolean asterisk;
private boolean isEmptyImportDeclaration;
private ImportDeclaration() {
this.isEmptyImportDeclaration = true;
static_ = false;
asterisk = false;
}
private ImportDeclaration(Range range) {
super(range);
this.isEmptyImportDeclaration = true;
static_ = false;
asterisk = false;
}
/**
* Create an empty import declaration without specifying its position.
*/
public static ImportDeclaration createEmptyDeclaration(){
return new ImportDeclaration();
}
/**
* Create an empty import declaration specifying its position.
*/
public static ImportDeclaration createEmptyDeclaration(Range range){
return new ImportDeclaration(range);
}
public ImportDeclaration(NameExpr name, boolean isStatic, boolean isAsterisk) {
setAsterisk(isAsterisk);
setName(name);
setStatic(isStatic);
this.isEmptyImportDeclaration = false;
}
public ImportDeclaration(Range range, NameExpr name, boolean isStatic, boolean isAsterisk) {
super(range);
setAsterisk(isAsterisk);
setName(name);
setStatic(isStatic);
this.isEmptyImportDeclaration = false;
}
/**
* Is this an empty import declaration or a normal import declaration?
*/
public boolean isEmptyImportDeclaration(){
return this.isEmptyImportDeclaration;
}
@Override
public <R, A> R accept(GenericVisitor<R, A> v, A arg) {
return v.visit(this, arg);
}
@Override
public <A> void accept(VoidVisitor<A> v, A arg) {
v.visit(this, arg);
}
/**
* Retrieves the name of the import.
*
* @return the name of the import
* @throws UnsupportedOperationException when invoked on an empty import declaration
*/
public NameExpr getName() {
if (isEmptyImportDeclaration) {
throw new UnsupportedOperationException("Empty import declarations have no name");
}
return name;
}
/**
* Return if the import ends with "*".
*
* @return <code>true</code> if the import ends with "*", <code>false</code>
* otherwise
*/
public boolean isAsterisk() {
return asterisk;
}
/**
* Return if the import is static.
*
* @return <code>true</code> if the import is static, <code>false</code>
* otherwise
*/
public boolean isStatic() {
return static_;
}
/**
* Sets if this import is asterisk.
*
* @param asterisk
* <code>true</code> if this import is asterisk
* @throws UnsupportedOperationException when setting true on an empty import declaration
*/
public void setAsterisk(boolean asterisk) {
if (isEmptyImportDeclaration && asterisk) {
throw new UnsupportedOperationException("Empty import cannot have asterisk");
}
this.asterisk = asterisk;
}
/**
* Sets the name this import.
*
* @param name
* the name to set
* @throws UnsupportedOperationException when invoked on an empty import declaration
*/
public void setName(NameExpr name) {
if (isEmptyImportDeclaration) {
throw new UnsupportedOperationException("Empty import cannot have name");
}
this.name = name;
setAsParentNodeOf(this.name);
}
/**
* Sets if this import is static.
*
* @param static_
* <code>true</code> if this import is static
* @throws UnsupportedOperationException when setting true on an empty import declaration
*/
public void setStatic(boolean static_) {
if (isEmptyImportDeclaration && static_) {
throw new UnsupportedOperationException("Empty import cannot be static");
}
this.static_ = static_;
}
}
@@ -0,0 +1,46 @@
package com.github.javaparser.ast;
import java.util.EnumSet;
public enum Modifier {
PUBLIC("public"),
PROTECTED("protected"),
PRIVATE("private"),
ABSTRACT("abstract"),
STATIC("static"),
FINAL("final"),
TRANSIENT("transient"),
VOLATILE("volatile"),
SYNCHRONIZED("synchronized"),
NATIVE("native"),
STRICTFP("strictfp");
String lib;
private Modifier(String lib) {
this.lib = lib;
}
/**
* @return the lib
*/
public String getLib() {
return lib;
}
public EnumSet<Modifier> toEnumSet() {
return EnumSet.of(this);
}
public static AccessSpecifier getAccessSpecifier(EnumSet<Modifier> modifiers) {
if (modifiers.contains(Modifier.PUBLIC)) {
return AccessSpecifier.PUBLIC;
} else if (modifiers.contains(Modifier.PROTECTED)) {
return AccessSpecifier.PROTECTED;
} else if (modifiers.contains(Modifier.PRIVATE)) {
return AccessSpecifier.PRIVATE;
} else {
return AccessSpecifier.DEFAULT;
}
}
}
@@ -0,0 +1,372 @@
/*
* Copyright (C) 2007-2010 Júlio Vilmar Gesser.
* Copyright (C) 2011, 2013-2016 The JavaParser Team.
*
* This file is part of JavaParser.
*
* JavaParser can be used either under the terms of
* a) the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* b) the terms of the Apache License
*
* You should have received a copy of both licenses in LICENCE.LGPL and
* LICENCE.APACHE. Please refer to those files for details.
*
* JavaParser is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*/
package com.github.javaparser.ast;
import com.github.javaparser.Position;
import com.github.javaparser.Range;
import com.github.javaparser.ast.comments.BlockComment;
import com.github.javaparser.ast.comments.Comment;
import com.github.javaparser.ast.comments.LineComment;
import com.github.javaparser.ast.visitor.*;
import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;
/**
* Abstract class for all nodes of the AST.
*
* Each Node can have one associated comment which describe it and
* a number of "orphan comments" which it contains but are not specifically
* associated to any element.
*
* @author Julio Vilmar Gesser
*/
public abstract class Node implements Cloneable {
private Range range;
private Node parentNode;
private List<Node> childrenNodes = new LinkedList<>();
private List<Comment> orphanComments = new LinkedList<>();
/**
* This attribute can store additional information from semantic analysis.
*/
private Object data;
private Comment comment;
public Node() {
this(Range.UNKNOWN);
}
public Node(Range range) {
this.range = range;
}
/**
* Accept method for visitor support.
*
* @param <R>
* the type the return value of the visitor
* @param <A>
* the type the argument passed to the visitor
* @param v
* the visitor implementation
* @param arg
* the argument passed to the visitor
* @return the result of the visit
*/
public abstract <R, A> R accept(GenericVisitor<R, A> v, A arg);
/**
* Accept method for visitor support.
*
* @param <A>
* the type the argument passed for the visitor
* @param v
* the visitor implementation
* @param arg
* any value relevant for the visitor
*/
public abstract <A> void accept(VoidVisitor<A> v, A arg);
/**
* This is a comment associated with this node.
*
* @return comment property
*/
public final Comment getComment() {
return comment;
}
/**
* Use this to retrieve additional information associated to this node.
*
* @return data property
*/
public final Object getData() {
return data;
}
/**
* The begin position of this node in the source file.
*/
public Position getBegin() {
return range.begin;
}
/**
* The end position of this node in the source file.
*/
public Position getEnd() {
return range.end;
}
/**
* Sets the begin position of this node in the source file.
*/
public void setBegin(Position begin) {
range = range.withBegin(begin);
}
/**
* Sets the end position of this node in the source file.
*/
public void setEnd(Position end) {
range = range.withEnd(end);
}
/**
* @return the range of characters in the source code that this node covers.
*/
public Range getRange() {
return range;
}
/**
* @param range the range of characters in the source code that this node covers.
*/
public void setRange(Range range) {
this.range = range;
}
/**
* Use this to store additional information to this node.
*
* @param comment to be set
*/
public final void setComment(final Comment comment) {
if (comment != null && (this instanceof Comment)) {
throw new RuntimeException("A comment can not be commented");
}
if (this.comment != null) {
this.comment.setCommentedNode(null);
}
this.comment = comment;
if (comment != null) {
this.comment.setCommentedNode(this);
}
}
/**
* Use this to store additional information to this node.
*
* @param comment to be set
*/
public final void setLineComment(String comment) {
setComment(new LineComment(comment));
}
/**
* Use this to store additional information to this node.
*
* @param comment to be set
*/
public final void setBlockComment(String comment) {
setComment(new BlockComment(comment));
}
/**
* Use this to store additional information to this node.
*
* @param data to be set
*/
public final void setData(final Object data) {
this.data = data;
}
/**
* Return the String representation of this node.
*
* @return the String representation of this node
*/
@Override
public final String toString() {
final DumpVisitor visitor = new DumpVisitor();
accept(visitor, null);
return visitor.getSource();
}
public final String toStringWithoutComments() {
final DumpVisitor visitor = new DumpVisitor(false);
accept(visitor, null);
return visitor.getSource();
}
@Override
public final int hashCode() {
return toString().hashCode();
}
@Override
public boolean equals(final Object obj) {
if (obj == null || !(obj instanceof Node)) {
return false;
}
return EqualsVisitor.equals(this, (Node) obj);
}
@Override
public Node clone() {
return this.accept(new CloneVisitor(), null);
}
public Node getParentNode() {
return parentNode;
}
@SuppressWarnings("unchecked")
public <T> T getParentNodeOfType(Class<T> classType) {
Node parent = parentNode;
while (parent != null) {
if (classType.isAssignableFrom(parent.getClass()))
return (T) parent;
parent = parent.parentNode;
}
return null;
}
public List<Node> getChildrenNodes() {
return childrenNodes;
}
public boolean contains(Node other) {
return range.contains(other.range);
}
public void addOrphanComment(Comment comment) {
orphanComments.add(comment);
comment.setParentNode(this);
}
/**
* This is a list of Comment which are inside the node and are not associated
* with any meaningful AST Node.
*
* For example, comments at the end of methods (immediately before the parenthesis)
* or at the end of CompilationUnit are orphan comments.
*
* When more than one comment preceeds a statement, the one immediately preceding it
* it is associated with the statements, while the others are orphans.
*
* @return all comments that cannot be attributed to a concept
*/
public List<Comment> getOrphanComments() {
return orphanComments;
}
/**
* This is the list of Comment which are contained in the Node either because
* they are properly associated to one of its children or because they are floating
* around inside the Node
*
* @return all Comments within the node as a list
*/
public List<Comment> getAllContainedComments() {
List<Comment> comments = new LinkedList<>();
comments.addAll(getOrphanComments());
for (Node child : getChildrenNodes()) {
if (child.getComment() != null) {
comments.add(child.getComment());
}
comments.addAll(child.getAllContainedComments());
}
return comments;
}
/**
* Assign a new parent to this node, removing it
* from the list of children of the previous parent, if any.
*
* @param parentNode node to be set as parent
*/
public void setParentNode(Node parentNode) {
// remove from old parent, if any
if (this.parentNode != null) {
this.parentNode.childrenNodes.remove(this);
}
this.parentNode = parentNode;
// add to new parent, if any
if (this.parentNode != null) {
this.parentNode.childrenNodes.add(this);
}
}
protected void setAsParentNodeOf(List<? extends Node> childNodes) {
if (childNodes != null) {
for (Node current : childNodes) {
current.setParentNode(this);
}
}
}
protected void setAsParentNodeOf(Node childNode) {
if (childNode != null) {
childNode.setParentNode(this);
}
}
public static final int ABSOLUTE_BEGIN_LINE = -1;
public static final int ABSOLUTE_END_LINE = -2;
public boolean isPositionedAfter(Position position) {
return range.isAfter(position);
}
public boolean isPositionedBefore(Position position) {
return range.isBefore(position);
}
public boolean hasComment() {
return comment != null;
}
public void tryAddImportToParentCompilationUnit(Class<?> clazz) {
CompilationUnit parentNode = getParentNodeOfType(CompilationUnit.class);
if (parentNode != null) {
parentNode.addImport(clazz);
}
}
/**
* Recursively finds all nodes of a certain type.
*
* @param clazz the type of node to find.
*/
public <N extends Node> List<N> getNodesByType(Class<N> clazz) {
List<N> nodes = new ArrayList<>();
for (Node child : getChildrenNodes()) {
if (clazz.isInstance(child)) {
nodes.add(clazz.cast(child));
}
nodes.addAll(child.getNodesByType(clazz));
}
return nodes;
}
}
@@ -0,0 +1,127 @@
/*
* Copyright (C) 2007-2010 Júlio Vilmar Gesser.
* Copyright (C) 2011, 2013-2016 The JavaParser Team.
*
* This file is part of JavaParser.
*
* JavaParser can be used either under the terms of
* a) the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* b) the terms of the Apache License
*
* You should have received a copy of both licenses in LICENCE.LGPL and
* LICENCE.APACHE. Please refer to those files for details.
*
* JavaParser is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*/
package com.github.javaparser.ast;
import com.github.javaparser.Range;
import com.github.javaparser.ast.expr.AnnotationExpr;
import com.github.javaparser.ast.expr.NameExpr;
import com.github.javaparser.utils.Utils;
import com.github.javaparser.ast.visitor.GenericVisitor;
import com.github.javaparser.ast.visitor.VoidVisitor;
import java.util.List;
/**
* <p>
* This class represents the package declaration. The package declaration is
* optional for the {@link CompilationUnit}.
* </p>
* The PackageDeclaration is constructed following the syntax:<br>
* <pre>
* {@code
* PackageDeclaration ::= ( }{@link AnnotationExpr}{@code )* "package" }{@link NameExpr}{@code ) ";"
* }
* </pre>
* @author Julio Vilmar Gesser
*/
public final class PackageDeclaration extends Node {
private List<AnnotationExpr> annotations;
private NameExpr name;
public PackageDeclaration() {
}
public PackageDeclaration(NameExpr name) {
setName(name);
}
public PackageDeclaration(List<AnnotationExpr> annotations, NameExpr name) {
setAnnotations(annotations);
setName(name);
}
public PackageDeclaration(Range range, List<AnnotationExpr> annotations, NameExpr name) {
super(range);
setAnnotations(annotations);
setName(name);
}
@Override
public <R, A> R accept(GenericVisitor<R, A> v, A arg) {
return v.visit(this, arg);
}
@Override
public <A> void accept(VoidVisitor<A> v, A arg) {
v.visit(this, arg);
}
/**
* Retrieves the list of annotations declared before the package
* declaration. Return <code>null</code> if there are no annotations.
*
* @return list of annotations or <code>null</code>
*/
public List<AnnotationExpr> getAnnotations() {
annotations = Utils.ensureNotNull(annotations);
return annotations;
}
/**
* Return the name expression of the package.
*
* @return the name of the package
*/
public NameExpr getName() {
return name;
}
/**
* Get full package name.
*/
public String getPackageName() {
return name.toString();
}
/**
* @param annotations
* the annotations to set
*/
public void setAnnotations(List<AnnotationExpr> annotations) {
this.annotations = annotations;
setAsParentNodeOf(this.annotations);
}
/**
* Sets the name of this package declaration.
*
* @param name
* the name to set
*/
public void setName(NameExpr name) {
this.name = name;
setAsParentNodeOf(this.name);
}
}
@@ -0,0 +1,56 @@
/*
* Copyright (C) 2016 The JavaParser Team.
*
* This file is part of JavaParser.
*
* JavaParser can be used either under the terms of
* a) the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* b) the terms of the Apache License
*
* You should have received a copy of both licenses in LICENCE.LGPL and
* LICENCE.APACHE. Please refer to those files for details.
*
* JavaParser is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*/
package com.github.javaparser.ast;
import com.github.javaparser.ast.type.Type;
import java.util.Collections;
import java.util.List;
import static com.github.javaparser.utils.Utils.ensureNotNull;
public class TypeArguments {
public static final TypeArguments EMPTY = withArguments(Collections.<Type>emptyList());
private final List<Type> typeArguments;
private final boolean usesDiamondOperator;
private TypeArguments(List<Type> typeArguments, boolean usesDiamondOperator) {
this.typeArguments = ensureNotNull(typeArguments);
this.usesDiamondOperator = usesDiamondOperator;
}
public List<Type> getTypeArguments() {
return typeArguments;
}
public boolean isUsingDiamondOperator() {
return usesDiamondOperator;
}
public static TypeArguments withDiamondOperator() {
return new TypeArguments(Collections.<Type>emptyList(), true);
}
public static TypeArguments withArguments(List<Type> typeArguments) {
return new TypeArguments(typeArguments, false);
}
}
@@ -0,0 +1,136 @@
/*
* Copyright (C) 2007-2010 Júlio Vilmar Gesser.
* Copyright (C) 2011, 2013-2016 The JavaParser Team.
*
* This file is part of JavaParser.
*
* JavaParser can be used either under the terms of
* a) the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* b) the terms of the Apache License
*
* You should have received a copy of both licenses in LICENCE.LGPL and
* LICENCE.APACHE. Please refer to those files for details.
*
* JavaParser is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*/
package com.github.javaparser.ast;
import static com.github.javaparser.utils.Utils.ensureNotNull;
import java.util.List;
import com.github.javaparser.Range;
import com.github.javaparser.ast.expr.AnnotationExpr;
import com.github.javaparser.ast.nodeTypes.NodeWithName;
import com.github.javaparser.ast.type.ClassOrInterfaceType;
import com.github.javaparser.ast.visitor.GenericVisitor;
import com.github.javaparser.ast.visitor.VoidVisitor;
/**
* <p>
* This class represents the declaration of a generics argument.
* </p>
* The TypeParameter is constructed following the syntax:<br>
* <pre>
* {@code
* TypeParameter ::= <IDENTIFIER> ( "extends" }{@link ClassOrInterfaceType}{@code ( "&" }{@link ClassOrInterfaceType}{@code )* )?
* }
* </pre>
* @author Julio Vilmar Gesser
*/
public final class TypeParameter extends Node implements NodeWithName<TypeParameter> {
private String name;
private List<AnnotationExpr> annotations;
private List<ClassOrInterfaceType> typeBound;
public TypeParameter() {
}
public TypeParameter(final String name, final List<ClassOrInterfaceType> typeBound) {
setName(name);
setTypeBound(typeBound);
}
public TypeParameter(Range range, final String name, final List<ClassOrInterfaceType> typeBound) {
super(range);
setName(name);
setTypeBound(typeBound);
}
public TypeParameter(Range range, String name, List<ClassOrInterfaceType> typeBound, List<AnnotationExpr> annotations) {
this(range, name, typeBound);
setTypeBound(typeBound);
setAnnotations(annotations);
}
@Override public <R, A> R accept(final GenericVisitor<R, A> v, final A arg) {
return v.visit(this, arg);
}
@Override public <A> void accept(final VoidVisitor<A> v, final A arg) {
v.visit(this, arg);
}
/**
* Return the name of the paramenter.
*
* @return the name of the paramenter
*/
@Override
public String getName() {
return name;
}
/**
* Return the list of {@link ClassOrInterfaceType} that this parameter
* extends. Return <code>null</code> null if there are no type.
*
* @return list of types that this paramente extends or <code>null</code>
*/
public List<ClassOrInterfaceType> getTypeBound() {
typeBound = ensureNotNull(typeBound);
return typeBound;
}
/**
* Sets the name of this type parameter.
*
* @param name
* the name to set
*/
@Override
public TypeParameter setName(final String name) {
this.name = name;
return this;
}
/**
* Sets the list o types.
*
* @param typeBound
* the typeBound to set
*/
public void setTypeBound(final List<ClassOrInterfaceType> typeBound) {
this.typeBound = typeBound;
setAsParentNodeOf(typeBound);
}
public List<AnnotationExpr> getAnnotations() {
annotations = ensureNotNull(annotations);
return annotations;
}
public void setAnnotations(List<AnnotationExpr> annotations) {
this.annotations = annotations;
setAsParentNodeOf(this.annotations);
}
}
@@ -0,0 +1,65 @@
/*
* Copyright (C) 2007-2010 Júlio Vilmar Gesser.
* Copyright (C) 2011, 2013-2016 The JavaParser Team.
*
* This file is part of JavaParser.
*
* JavaParser can be used either under the terms of
* a) the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* b) the terms of the Apache License
*
* You should have received a copy of both licenses in LICENCE.LGPL and
* LICENCE.APACHE. Please refer to those files for details.
*
* JavaParser is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*/
package com.github.javaparser.ast.body;
import java.util.List;
import java.util.EnumSet;
import com.github.javaparser.Range;
import com.github.javaparser.ast.Modifier;
import com.github.javaparser.ast.expr.AnnotationExpr;
import com.github.javaparser.ast.visitor.GenericVisitor;
import com.github.javaparser.ast.visitor.VoidVisitor;
/**
* @author Julio Vilmar Gesser
*/
public final class AnnotationDeclaration extends TypeDeclaration<AnnotationDeclaration> {
public AnnotationDeclaration() {
}
public AnnotationDeclaration(EnumSet<Modifier> modifiers, String name) {
super(modifiers, name);
}
public AnnotationDeclaration(EnumSet<Modifier> modifiers, List<AnnotationExpr> annotations, String name,
List<BodyDeclaration<?>> members) {
super(annotations, modifiers, name, members);
}
public AnnotationDeclaration(Range range, EnumSet<Modifier> modifiers, List<AnnotationExpr> annotations, String name,
List<BodyDeclaration<?>> members) {
super(range, annotations, modifiers, name, members);
}
@Override
public <R, A> R accept(GenericVisitor<R, A> v, A arg) {
return v.visit(this, arg);
}
@Override
public <A> void accept(VoidVisitor<A> v, A arg) {
v.visit(this, arg);
}
}
@@ -0,0 +1,149 @@
/*
* Copyright (C) 2007-2010 Júlio Vilmar Gesser.
* Copyright (C) 2011, 2013-2016 The JavaParser Team.
*
* This file is part of JavaParser.
*
* JavaParser can be used either under the terms of
* a) the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* b) the terms of the Apache License
*
* You should have received a copy of both licenses in LICENCE.LGPL and
* LICENCE.APACHE. Please refer to those files for details.
*
* JavaParser is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*/
package com.github.javaparser.ast.body;
import java.util.EnumSet;
import java.util.List;
import com.github.javaparser.Range;
import com.github.javaparser.ast.Modifier;
import com.github.javaparser.ast.comments.JavadocComment;
import com.github.javaparser.ast.expr.AnnotationExpr;
import com.github.javaparser.ast.expr.Expression;
import com.github.javaparser.ast.nodeTypes.NodeWithJavaDoc;
import com.github.javaparser.ast.nodeTypes.NodeWithModifiers;
import com.github.javaparser.ast.nodeTypes.NodeWithName;
import com.github.javaparser.ast.nodeTypes.NodeWithType;
import com.github.javaparser.ast.type.Type;
import com.github.javaparser.ast.visitor.GenericVisitor;
import com.github.javaparser.ast.visitor.VoidVisitor;
/**
* @author Julio Vilmar Gesser
*/
public final class AnnotationMemberDeclaration extends BodyDeclaration<AnnotationMemberDeclaration>
implements NodeWithJavaDoc<AnnotationMemberDeclaration>, NodeWithName<AnnotationMemberDeclaration>,
NodeWithType<AnnotationMemberDeclaration>, NodeWithModifiers<AnnotationMemberDeclaration> {
private EnumSet<Modifier> modifiers = EnumSet.noneOf(Modifier.class);
private Type type;
private String name;
private Expression defaultValue;
public AnnotationMemberDeclaration() {
}
public AnnotationMemberDeclaration(EnumSet<Modifier> modifiers, Type type, String name, Expression defaultValue) {
setModifiers(modifiers);
setType(type);
setName(name);
setDefaultValue(defaultValue);
}
public AnnotationMemberDeclaration(EnumSet<Modifier> modifiers, List<AnnotationExpr> annotations, Type type, String name,
Expression defaultValue) {
super(annotations);
setModifiers(modifiers);
setType(type);
setName(name);
setDefaultValue(defaultValue);
}
public AnnotationMemberDeclaration(Range range, EnumSet<Modifier> modifiers, List<AnnotationExpr> annotations, Type type,
String name, Expression defaultValue) {
super(range, annotations);
setModifiers(modifiers);
setType(type);
setName(name);
setDefaultValue(defaultValue);
}
@Override
public <R, A> R accept(GenericVisitor<R, A> v, A arg) {
return v.visit(this, arg);
}
@Override
public <A> void accept(VoidVisitor<A> v, A arg) {
v.visit(this, arg);
}
public Expression getDefaultValue() {
return defaultValue;
}
/**
* Return the modifiers of this member declaration.
*
* @see Modifier
* @return modifiers
*/
@Override
public EnumSet<Modifier> getModifiers() {
return modifiers;
}
@Override
public String getName() {
return name;
}
@Override
public Type getType() {
return type;
}
public void setDefaultValue(Expression defaultValue) {
this.defaultValue = defaultValue;
setAsParentNodeOf(defaultValue);
}
@Override
public AnnotationMemberDeclaration setModifiers(EnumSet<Modifier> modifiers) {
this.modifiers = modifiers;
return this;
}
@Override
public AnnotationMemberDeclaration setName(String name) {
this.name = name;
return this;
}
@Override
public AnnotationMemberDeclaration setType(Type type) {
this.type = type;
setAsParentNodeOf(type);
return this;
}
@Override
public JavadocComment getJavaDoc() {
if (getComment() instanceof JavadocComment) {
return (JavadocComment) getComment();
}
return null;
}
}
@@ -0,0 +1,133 @@
/*
* Copyright (C) 2007-2010 Júlio Vilmar Gesser.
* Copyright (C) 2011, 2013-2016 The JavaParser Team.
*
* This file is part of JavaParser.
*
* JavaParser can be used either under the terms of
* a) the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* b) the terms of the Apache License
*
* You should have received a copy of both licenses in LICENCE.LGPL and
* LICENCE.APACHE. Please refer to those files for details.
*
* JavaParser is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*/
package com.github.javaparser.ast.body;
import static com.github.javaparser.utils.Utils.ensureNotNull;
import java.util.EnumSet;
import java.util.List;
import com.github.javaparser.Range;
import com.github.javaparser.ast.Modifier;
import com.github.javaparser.ast.Node;
import com.github.javaparser.ast.expr.AnnotationExpr;
import com.github.javaparser.ast.nodeTypes.NodeWithAnnotations;
import com.github.javaparser.ast.nodeTypes.NodeWithModifiers;
import com.github.javaparser.ast.nodeTypes.NodeWithName;
public abstract class BaseParameter<T>
extends Node
implements NodeWithAnnotations<T>, NodeWithName<T>, NodeWithModifiers<T> {
private EnumSet<Modifier> modifiers = EnumSet.noneOf(Modifier.class);
private List<AnnotationExpr> annotations;
private VariableDeclaratorId id;
public BaseParameter() {
}
public BaseParameter(VariableDeclaratorId id) {
setId(id);
}
public BaseParameter(EnumSet<Modifier> modifiers, VariableDeclaratorId id) {
setModifiers(modifiers);
setId(id);
}
public BaseParameter(EnumSet<Modifier> modifiers, List<AnnotationExpr> annotations, VariableDeclaratorId id) {
setModifiers(modifiers);
setAnnotations(annotations);
setId(id);
}
public BaseParameter(final Range range, EnumSet<Modifier> modifiers, List<AnnotationExpr> annotations, VariableDeclaratorId id) {
super(range);
setModifiers(modifiers);
setAnnotations(annotations);
setId(id);
}
/**
* @return the list returned could be immutable (in that case it will be empty)
*/
@Override
public List<AnnotationExpr> getAnnotations() {
annotations = ensureNotNull(annotations);
return annotations;
}
public VariableDeclaratorId getId() {
return id;
}
@Override
public String getName() {
return getId().getName();
}
@SuppressWarnings("unchecked")
@Override
public T setName(String name) {
if (id != null)
id.setName(name);
else
id = new VariableDeclaratorId(name);
return (T) this;
}
/**
* Return the modifiers of this parameter declaration.
*
* @see Modifier
* @return modifiers
*/
@Override
public EnumSet<Modifier> getModifiers() {
return modifiers;
}
/**
* @param annotations a null value is currently treated as an empty list. This behavior could change
* in the future, so please avoid passing null
*/
@Override
@SuppressWarnings("unchecked")
public T setAnnotations(List<AnnotationExpr> annotations) {
this.annotations = annotations;
setAsParentNodeOf(this.annotations);
return (T) this;
}
public void setId(VariableDeclaratorId id) {
this.id = id;
setAsParentNodeOf(this.id);
}
@Override
@SuppressWarnings("unchecked")
public T setModifiers(EnumSet<Modifier> modifiers) {
this.modifiers = modifiers;
return (T) this;
}
}
@@ -0,0 +1,69 @@
/*
* Copyright (C) 2007-2010 Júlio Vilmar Gesser.
* Copyright (C) 2011, 2013-2016 The JavaParser Team.
*
* This file is part of JavaParser.
*
* JavaParser can be used either under the terms of
* a) the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* b) the terms of the Apache License
*
* You should have received a copy of both licenses in LICENCE.LGPL and
* LICENCE.APACHE. Please refer to those files for details.
*
* JavaParser is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*/
package com.github.javaparser.ast.body;
import java.util.List;
import com.github.javaparser.Range;
import com.github.javaparser.ast.Node;
import com.github.javaparser.ast.expr.AnnotationExpr;
import com.github.javaparser.utils.Utils;
import com.github.javaparser.ast.nodeTypes.NodeWithAnnotations;
/**
* @author Julio Vilmar Gesser
*/
public abstract class BodyDeclaration<T> extends Node implements NodeWithAnnotations<T> {
private List<AnnotationExpr> annotations;
public BodyDeclaration() {
}
public BodyDeclaration(List<AnnotationExpr> annotations) {
setAnnotations(annotations);
}
public BodyDeclaration(Range range, List<AnnotationExpr> annotations) {
super(range);
setAnnotations(annotations);
}
@Override
public final List<AnnotationExpr> getAnnotations() {
annotations = Utils.ensureNotNull(annotations);
return annotations;
}
/**
*
* @param annotations a null value is currently treated as an empty list. This behavior could change
* in the future, so please avoid passing null
*/
@SuppressWarnings("unchecked")
@Override
public final T setAnnotations(List<AnnotationExpr> annotations) {
this.annotations = annotations;
setAsParentNodeOf(this.annotations);
return (T) this;
}
}
@@ -0,0 +1,200 @@
/*
* Copyright (C) 2007-2010 Júlio Vilmar Gesser.
* Copyright (C) 2011, 2013-2016 The JavaParser Team.
*
* This file is part of JavaParser.
*
* JavaParser can be used either under the terms of
* a) the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* b) the terms of the Apache License
*
* You should have received a copy of both licenses in LICENCE.LGPL and
* LICENCE.APACHE. Please refer to those files for details.
*
* JavaParser is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*/
package com.github.javaparser.ast.body;
import static com.github.javaparser.utils.Utils.ensureNotNull;
import java.util.EnumSet;
import java.util.List;
import com.github.javaparser.Range;
import com.github.javaparser.ast.Modifier;
import com.github.javaparser.ast.TypeParameter;
import com.github.javaparser.ast.expr.AnnotationExpr;
import com.github.javaparser.ast.type.ClassOrInterfaceType;
import com.github.javaparser.ast.visitor.GenericVisitor;
import com.github.javaparser.ast.visitor.VoidVisitor;
/**
* @author Julio Vilmar Gesser
*/
public final class ClassOrInterfaceDeclaration extends TypeDeclaration<ClassOrInterfaceDeclaration> {
private boolean interface_;
private List<TypeParameter> typeParameters;
// Can contain more than one item if this is an interface
private List<ClassOrInterfaceType> extendsList;
private List<ClassOrInterfaceType> implementsList;
public ClassOrInterfaceDeclaration() {
}
public ClassOrInterfaceDeclaration(final EnumSet<Modifier> modifiers, final boolean isInterface,
final String name) {
super(modifiers, name);
setInterface(isInterface);
}
public ClassOrInterfaceDeclaration(final EnumSet<Modifier> modifiers,
final List<AnnotationExpr> annotations, final boolean isInterface,
final String name,
final List<TypeParameter> typeParameters,
final List<ClassOrInterfaceType> extendsList,
final List<ClassOrInterfaceType> implementsList,
final List<BodyDeclaration<?>> members) {
super(annotations, modifiers, name, members);
setInterface(isInterface);
setTypeParameters(typeParameters);
setExtends(extendsList);
setImplements(implementsList);
}
public ClassOrInterfaceDeclaration(Range range, final EnumSet<Modifier> modifiers,
final List<AnnotationExpr> annotations, final boolean isInterface,
final String name,
final List<TypeParameter> typeParameters,
final List<ClassOrInterfaceType> extendsList,
final List<ClassOrInterfaceType> implementsList,
final List<BodyDeclaration<?>> members) {
super(range, annotations, modifiers, name, members);
setInterface(isInterface);
setTypeParameters(typeParameters);
setExtends(extendsList);
setImplements(implementsList);
}
@Override
public <R, A> R accept(final GenericVisitor<R, A> v, final A arg) {
return v.visit(this, arg);
}
@Override
public <A> void accept(final VoidVisitor<A> v, final A arg) {
v.visit(this, arg);
}
public List<ClassOrInterfaceType> getExtends() {
extendsList = ensureNotNull(extendsList);
return extendsList;
}
public List<ClassOrInterfaceType> getImplements() {
implementsList = ensureNotNull(implementsList);
return implementsList;
}
public List<TypeParameter> getTypeParameters() {
typeParameters = ensureNotNull(typeParameters);
return typeParameters;
}
public boolean isInterface() {
return interface_;
}
/**
*
* @param extendsList a null value is currently treated as an empty list. This behavior could change
* in the future, so please avoid passing null
*/
public void setExtends(final List<ClassOrInterfaceType> extendsList) {
this.extendsList = extendsList;
setAsParentNodeOf(this.extendsList);
}
/**
*
* @param implementsList a null value is currently treated as an empty list. This behavior could change
* in the future, so please avoid passing null
*/
public void setImplements(final List<ClassOrInterfaceType> implementsList) {
this.implementsList = implementsList;
setAsParentNodeOf(this.implementsList);
}
public void setInterface(final boolean interface_) {
this.interface_ = interface_;
}
/**
*
* @param typeParameters a null value is currently treated as an empty list. This behavior could change
* in the future, so please avoid passing null
*/
public void setTypeParameters(final List<TypeParameter> typeParameters) {
this.typeParameters = typeParameters;
setAsParentNodeOf(this.typeParameters);
}
/**
* Add an extends to this class or interface and automatically add the import
*
* @param clazz the class to extand from
* @return this, the {@link ClassOrInterfaceDeclaration}
*/
public ClassOrInterfaceDeclaration addExtends(Class<?> clazz) {
tryAddImportToParentCompilationUnit(clazz);
return addExtends(clazz.getSimpleName());
}
/**
* Add an extends to this class or interface
*
* @param name the name of the type to extends from
* @return this, the {@link ClassOrInterfaceDeclaration}
*/
public ClassOrInterfaceDeclaration addExtends(String name) {
ClassOrInterfaceType classOrInterfaceType = new ClassOrInterfaceType(name);
getExtends().add(classOrInterfaceType);
classOrInterfaceType.setParentNode(this);
return this;
}
/**
* Add an implements to this class or interface
*
* @param name the name of the type to extends from
* @return this, the {@link ClassOrInterfaceDeclaration}
*/
public ClassOrInterfaceDeclaration addImplements(String name) {
ClassOrInterfaceType classOrInterfaceType = new ClassOrInterfaceType(name);
getImplements().add(classOrInterfaceType);
classOrInterfaceType.setParentNode(this);
return this;
}
/**
* Add an implements to this class or interface and automatically add the import
*
* @param clazz the type to implements from
* @return this, the {@link ClassOrInterfaceDeclaration}
*/
public ClassOrInterfaceDeclaration addImplements(Class<?> clazz) {
tryAddImportToParentCompilationUnit(clazz);
return addImplements(clazz.getSimpleName());
}
}
@@ -0,0 +1,261 @@
/*
* Copyright (C) 2007-2010 Júlio Vilmar Gesser.
* Copyright (C) 2011, 2013-2016 The JavaParser Team.
*
* This file is part of JavaParser.
*
* JavaParser can be used either under the terms of
* a) the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* b) the terms of the Apache License
*
* You should have received a copy of both licenses in LICENCE.LGPL and
* LICENCE.APACHE. Please refer to those files for details.
*
* JavaParser is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*/
package com.github.javaparser.ast.body;
import static com.github.javaparser.utils.Utils.ensureNotNull;
import java.util.EnumSet;
import java.util.List;
import com.github.javaparser.Range;
import com.github.javaparser.ast.AccessSpecifier;
import com.github.javaparser.ast.Modifier;
import com.github.javaparser.ast.TypeParameter;
import com.github.javaparser.ast.comments.JavadocComment;
import com.github.javaparser.ast.expr.AnnotationExpr;
import com.github.javaparser.ast.expr.NameExpr;
import com.github.javaparser.ast.nodeTypes.NodeWithBlockStmt;
import com.github.javaparser.ast.nodeTypes.NodeWithDeclaration;
import com.github.javaparser.ast.nodeTypes.NodeWithJavaDoc;
import com.github.javaparser.ast.nodeTypes.NodeWithModifiers;
import com.github.javaparser.ast.nodeTypes.NodeWithName;
import com.github.javaparser.ast.nodeTypes.NodeWithParameters;
import com.github.javaparser.ast.nodeTypes.NodeWithThrowable;
import com.github.javaparser.ast.stmt.BlockStmt;
import com.github.javaparser.ast.type.ReferenceType;
import com.github.javaparser.ast.visitor.GenericVisitor;
import com.github.javaparser.ast.visitor.VoidVisitor;
/**
* @author Julio Vilmar Gesser
*/
public final class ConstructorDeclaration extends BodyDeclaration<ConstructorDeclaration>
implements NodeWithJavaDoc<ConstructorDeclaration>, NodeWithDeclaration,
NodeWithName<ConstructorDeclaration>, NodeWithModifiers<ConstructorDeclaration>,
NodeWithParameters<ConstructorDeclaration>, NodeWithThrowable<ConstructorDeclaration>,
NodeWithBlockStmt<ConstructorDeclaration> {
private EnumSet<Modifier> modifiers = EnumSet.noneOf(Modifier.class);
private List<TypeParameter> typeParameters;
private NameExpr name;
private List<Parameter> parameters;
private List<ReferenceType> throws_;
private BlockStmt body;
public ConstructorDeclaration() {
}
public ConstructorDeclaration(EnumSet<Modifier> modifiers, String name) {
setModifiers(modifiers);
setName(name);
}
public ConstructorDeclaration(EnumSet<Modifier> modifiers, List<AnnotationExpr> annotations,
List<TypeParameter> typeParameters,
String name, List<Parameter> parameters, List<ReferenceType> throws_,
BlockStmt block) {
super(annotations);
setModifiers(modifiers);
setTypeParameters(typeParameters);
setName(name);
setParameters(parameters);
setThrows(throws_);
setBody(block);
}
public ConstructorDeclaration(Range range, EnumSet<Modifier> modifiers,
List<AnnotationExpr> annotations, List<TypeParameter> typeParameters, String name,
List<Parameter> parameters, List<ReferenceType> throws_, BlockStmt block) {
super(range, annotations);
setModifiers(modifiers);
setTypeParameters(typeParameters);
setName(name);
setParameters(parameters);
setThrows(throws_);
setBody(block);
}
@Override
public <R, A> R accept(GenericVisitor<R, A> v, A arg) {
return v.visit(this, arg);
}
@Override
public <A> void accept(VoidVisitor<A> v, A arg) {
v.visit(this, arg);
}
/**
* Return the modifiers of this member declaration.
*
* @see Modifier
* @return modifiers
*/
@Override
public EnumSet<Modifier> getModifiers() {
return modifiers;
}
@Override
public String getName() {
return name == null ? null : name.getName();
}
public NameExpr getNameExpr() {
return name;
}
@Override
public List<Parameter> getParameters() {
parameters = ensureNotNull(parameters);
return parameters;
}
@Override
public List<ReferenceType> getThrows() {
throws_ = ensureNotNull(throws_);
return throws_;
}
public List<TypeParameter> getTypeParameters() {
typeParameters = ensureNotNull(typeParameters);
return typeParameters;
}
@Override
public ConstructorDeclaration setModifiers(EnumSet<Modifier> modifiers) {
this.modifiers = modifiers;
return this;
}
@Override
public ConstructorDeclaration setName(String name) {
setNameExpr(new NameExpr(name));
return this;
}
public ConstructorDeclaration setNameExpr(NameExpr name) {
this.name = name;
setAsParentNodeOf(this.name);
return this;
}
@Override
public ConstructorDeclaration setParameters(List<Parameter> parameters) {
this.parameters = parameters;
setAsParentNodeOf(this.parameters);
return this;
}
@Override
public ConstructorDeclaration setThrows(List<ReferenceType> throws_) {
this.throws_ = throws_;
setAsParentNodeOf(this.throws_);
return this;
}
public void setTypeParameters(List<TypeParameter> typeParameters) {
this.typeParameters = typeParameters;
setAsParentNodeOf(this.typeParameters);
}
/**
* The declaration returned has this schema:
*
* [accessSpecifier] className ([paramType [paramName]])
* [throws exceptionsList]
*/
@Override
public String getDeclarationAsString(boolean includingModifiers, boolean includingThrows,
boolean includingParameterName) {
StringBuilder sb = new StringBuilder();
if (includingModifiers) {
AccessSpecifier accessSpecifier = Modifier.getAccessSpecifier(getModifiers());
sb.append(accessSpecifier.getCodeRepresenation());
sb.append(accessSpecifier == AccessSpecifier.DEFAULT ? "" : " ");
}
sb.append(getName());
sb.append("(");
boolean firstParam = true;
for (Parameter param : getParameters()) {
if (firstParam) {
firstParam = false;
} else {
sb.append(", ");
}
if (includingParameterName) {
sb.append(param.toStringWithoutComments());
} else {
sb.append(param.getType().toStringWithoutComments());
}
}
sb.append(")");
if (includingThrows) {
boolean firstThrow = true;
for (ReferenceType thr : getThrows()) {
if (firstThrow) {
firstThrow = false;
sb.append(" throws ");
} else {
sb.append(", ");
}
sb.append(thr.toStringWithoutComments());
}
}
return sb.toString();
}
@Override
public String getDeclarationAsString(boolean includingModifiers, boolean includingThrows) {
return getDeclarationAsString(includingModifiers, includingThrows, true);
}
@Override
public String getDeclarationAsString() {
return getDeclarationAsString(true, true, true);
}
@Override
public JavadocComment getJavaDoc() {
if (getComment() instanceof JavadocComment) {
return (JavadocComment) getComment();
}
return null;
}
@Override
public BlockStmt getBody() {
return body;
}
@Override
public ConstructorDeclaration setBody(BlockStmt body) {
this.body = body;
setAsParentNodeOf(body);
return this;
}
}
@@ -0,0 +1,61 @@
/*
* Copyright (C) 2007-2010 Júlio Vilmar Gesser.
* Copyright (C) 2011, 2013-2016 The JavaParser Team.
*
* This file is part of JavaParser.
*
* JavaParser can be used either under the terms of
* a) the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* b) the terms of the Apache License
*
* You should have received a copy of both licenses in LICENCE.LGPL and
* LICENCE.APACHE. Please refer to those files for details.
*
* JavaParser is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*/
package com.github.javaparser.ast.body;
import com.github.javaparser.Range;
import com.github.javaparser.ast.comments.JavadocComment;
import com.github.javaparser.ast.nodeTypes.NodeWithJavaDoc;
import com.github.javaparser.ast.visitor.GenericVisitor;
import com.github.javaparser.ast.visitor.VoidVisitor;
/**
* @author Julio Vilmar Gesser
*/
public final class EmptyMemberDeclaration extends BodyDeclaration<EmptyMemberDeclaration>
implements NodeWithJavaDoc<EmptyMemberDeclaration> {
public EmptyMemberDeclaration() {
super(null);
}
public EmptyMemberDeclaration(Range range) {
super(range, null);
}
@Override
public <R, A> R accept(GenericVisitor<R, A> v, A arg) {
return v.visit(this, arg);
}
@Override
public <A> void accept(VoidVisitor<A> v, A arg) {
v.visit(this, arg);
}
@Override
public JavadocComment getJavaDoc() {
if(getComment() instanceof JavadocComment){
return (JavadocComment) getComment();
}
return null;
}
}
@@ -0,0 +1,53 @@
/*
* Copyright (C) 2007-2010 Júlio Vilmar Gesser.
* Copyright (C) 2011, 2013-2016 The JavaParser Team.
*
* This file is part of JavaParser.
*
* JavaParser can be used either under the terms of
* a) the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* b) the terms of the Apache License
*
* You should have received a copy of both licenses in LICENCE.LGPL and
* LICENCE.APACHE. Please refer to those files for details.
*
* JavaParser is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*/
package com.github.javaparser.ast.body;
import java.util.EnumSet;
import com.github.javaparser.Range;
import com.github.javaparser.ast.Modifier;
import com.github.javaparser.ast.visitor.GenericVisitor;
import com.github.javaparser.ast.visitor.VoidVisitor;
/**
* @author Julio Vilmar Gesser
*/
public final class EmptyTypeDeclaration extends TypeDeclaration<EmptyTypeDeclaration> {
public EmptyTypeDeclaration() {
super(null, EnumSet.noneOf(Modifier.class), null, null);
}
public EmptyTypeDeclaration(Range range) {
super(range, null, EnumSet.noneOf(Modifier.class), null, null);
}
@Override
public <R, A> R accept(GenericVisitor<R, A> v, A arg) {
return v.visit(this, arg);
}
@Override
public <A> void accept(VoidVisitor<A> v, A arg) {
v.visit(this, arg);
}
}

Some files were not shown because too many files have changed in this diff Show More