blob: 625e1453a7d8542c8888d89ce344f9385b9d4373 [file] [log] [blame]
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<title>Hints and Tips :: Apache Isis</title>
<link rel="canonical" href="https://isis.apache.org/setupguide/2.0.0-M3/intellij/hints-and-tips.html">
<meta name="generator" content="Antora 2.2.0">
<link rel="stylesheet" href="../../../_/css/site.css">
<link rel="stylesheet" href="../../../_/css/site-custom.css">
<link href="https://fonts.googleapis.com/css?family=Open+Sans:300,300i,400,400i,700,700i|Raleway:300,400,500,700,800|Montserrat:300,400,700" rel="stylesheet">
<link rel="home" href="https://isis.apache.org" title="Apache Isis">
</head>
<body class="article">
<header class="header">
<nav class="navbar">
<div class="navbar-brand">
<a class="navbar-item" href="https://isis.apache.org">
<span class="icon">
<img src="../../../_/img/isis-logo-48x48.png"></img>
</span>
<span>Apache Isis</span>
</a>
<button class="navbar-burger" data-target="topbar-nav">
<span></span>
<span></span>
<span></span>
</button>
</div>
<div id="topbar-nav" class="navbar-menu">
<a class="navbar-end">
<div class="navbar-item has-dropdown is-hoverable">
<a class="navbar-link" href="#">Quick Start</a>
<div class="navbar-dropdown">
<span class="navbar-item navbar-heading">Starter Apps</span>
<a class="navbar-item" href="../../../docs/latest/starters/helloworld.html">Hello World</a>
<a class="navbar-item" href="../../../docs/latest/starters/simpleapp.html">Simple App</a>
<hr class="navbar-divider"/>
<span class="navbar-item navbar-heading">Demos &amp; Tutorials</span>
<a class="navbar-item" href="../../../docs/latest/demo/about.html">Demo App</a>
<a class="navbar-item" href="https://danhaywood.gitlab.io/isis-petclinic-tutorial-docs/petclinic/1.16.2/intro.html">Petclinic (tutorial)</a>
<hr class="navbar-divider"/>
<span class="navbar-item navbar-heading">Resources</span>
<a class="navbar-item" href="../../../docs/latest/resources/cheatsheet.html">Cheatsheet</a>
<a class="navbar-item" href="../../../docs/latest/resources/icons.html">Icons</a>
</div>
</div>
<div class="navbar-item has-dropdown is-hoverable">
<a class="navbar-link" href="#">Guides</a>
<div class="navbar-dropdown">
<span class="navbar-item navbar-heading">Development</span>
<a class="navbar-item" href="../../../setupguide/latest/about.html">Setup Guide</a>
<hr class="navbar-divider"/>
<span class="navbar-item navbar-heading">Core</span>
<a class="navbar-item" href="../../../userguide/latest/about.html">User Guide</a>
<a class="navbar-item" href="../../../refguide/latest/about.html">Reference Guide</a>
<a class="navbar-item" href="../../../testing/latest/about.html">Testing Guide</a>
</div>
</div>
<div class="navbar-item has-dropdown is-hoverable">
<a class="navbar-link" href="#">Libraries</a>
<div class="navbar-dropdown">
<span class="navbar-item navbar-heading">For Use in Apps</span>
<a class="navbar-item" href="../../../subdomains/latest/about.html">Subdomain Libraries</a>
<a class="navbar-item" href="../../../valuetypes/latest/about.html">Value Types</a>
<hr class="navbar-divider"/>
<span class="navbar-item navbar-heading">Integrate between Apps</span>
<a class="navbar-item" href="../../../mappings/latest/about.html">Bounded Context Mapping Libraries</a>
<hr class="navbar-divider"/>
<span class="navbar-item navbar-heading">Other</span>
<a class="navbar-item" href="../../../incubator/latest/about.html">Incubator</a>
<a class="navbar-item" href="../../../legacy/latest/about.html">Legacy</a>
</div>
</div>
<div class="navbar-item has-dropdown is-hoverable">
<a class="navbar-link" href="#">Components</a>
<div class="navbar-dropdown">
<span class="navbar-item navbar-heading">Viewers</span>
<a class="navbar-item" href="../../../vw/latest/about.html">Wicket UI</a>
<a class="navbar-item" href="../../../vro/latest/about.html">Restful Objects (REST)</a>
<hr class="navbar-divider"/>
<span class="navbar-item navbar-heading">Security</span>
<a class="navbar-item" href="../../../security/latest/about.html">Security Guide</a>
<hr class="navbar-divider"/>
<span class="navbar-item navbar-heading">Persistence</span>
<a class="navbar-item" href="../../../pjdo/latest/about.html">DataNucleus (JDO)</a>
<hr class="navbar-divider"/>
<span class="navbar-item navbar-heading">Extensions</span>
<a class="navbar-item" href="../../../extensions/latest/about.html">Extensions Catalog</a>
</div>
</div>
<div class="navbar-item has-dropdown is-hoverable">
<a class="navbar-link" href="#">Support</a>
<div class="navbar-dropdown">
<span class="navbar-item navbar-heading">Contact</span>
<a class="navbar-item" href="../../../docs/latest/support/slack-channel.html">Slack</a>
<a class="navbar-item" href="../../../docs/latest/support/mailing-list.html">Mailing Lists</a>
<a class="navbar-item" href="https://issues.apache.org/jira/browse/ISIS">JIRA</a>
<a class="navbar-item" href="https://stackoverflow.com/questions/tagged/isis">Stack Overflow</a>
<hr class="navbar-divider"/>
<span class="navbar-item navbar-heading">Releases</span>
<a class="navbar-item" href="../../../docs/latest/downloads/how-to.html">Downloads</a>
<a class="navbar-item" href="../../../relnotes/latest/about.html">Release Notes</a>
<a class="navbar-item" href="../../../docs/latest/archive/1-x.html">Archive (1.x)</a>
<hr class="navbar-divider"/>
<span class="navbar-item navbar-heading">Framework</span>
<a class="navbar-item" href="../../../conguide/latest/about.html">Contributors' Guide</a>
<a class="navbar-item" href="../../../comguide/latest/about.html">Committers' Guide</a>
<a class="navbar-item" href="../../../core/latest/about.html">Core Design</a>
</div>
</div>
<div class="navbar-item has-dropdown is-hoverable">
<a class="navbar-link" href="#">ASF</a>
<div class="navbar-dropdown">
<a class="navbar-item" href="http://www.apache.org/">Apache Homepage</a>
<a class="navbar-item" href="https://www.apache.org/events/current-event">Events</a>
<a class="navbar-item" href="https://www.apache.org/licenses/">Licenses</a>
<a class="navbar-item" href="https://www.apache.org/security/">Security</a>
<a class="navbar-item" href="https://www.apache.org/foundation/sponsorship.html">Sponsorship</a>
<a class="navbar-item" href="https://www.apache.org/foundation/thanks.html">Thanks</a>
<hr class="navbar-divider"/>
<a class="navbar-item" href="https://whimsy.apache.org/board/minutes/Isis.html">PMC board minutes</a>
</div>
</div>
<a class="navbar-item" href="../../../docs/latest/about.html">
<span class="icon">
<img src="../../../_/img/home.png"></img>
</span>
</a>
</div>
</div>
</nav>
</header>
<div class="body ">
<div class="nav-container" data-component="setupguide" data-version="2.0.0-M3">
<aside class="nav">
<div class="panels">
<div class="nav-panel-pagination">
<a class="page-previous disabled" rel="prev" href="" title=""><span></span></a>
<a class="page-next disabled" rel="next"
href="" title=""><span></span></a>
<!--
page.parent doesn't seem to be set...
<a class="page-parent disabled" rel="prev" href="" title=""><span></span></a>
-->
</div>
<div class="nav-panel-menu is-active" data-panel="menu">
<nav class="nav-menu">
<h3 class="title"><a href="../about.html">Setup Guide</a></h3>
<ul class="nav-list">
<li class="nav-item" data-depth="0">
<ul class="nav-list">
<li class="nav-item" data-depth="1">
<a class="nav-link" href="about.html">Using IntelliJ</a>
</li>
</ul>
</li>
<li class="nav-item" data-depth="0">
<ul class="nav-list">
<li class="nav-item" data-depth="1">
<a class="nav-link" href="../eclipse/about.html">Using Eclipse</a>
</li>
</ul>
</li>
</ul>
</nav>
</div>
<div class="nav-panel-explore" data-panel="explore">
<div class="context">
<span class="title">Setup Guide</span>
<span class="version">2.0.0-M3</span>
</div>
<ul class="components">
<li class="component">
<span class="title"> </span>
<ul class="versions">
<li class="version is-latest">
<a href="../../../docs/2.0.0-M3/about.html">2.0.0-M3</a>
</li>
</ul>
</li>
<li class="component">
<span class="title">BC Mappings Catalog</span>
<ul class="versions">
<li class="version is-latest">
<a href="../../../mappings/2.0.0-M3/about.html">2.0.0-M3</a>
</li>
</ul>
</li>
<li class="component">
<span class="title">Committers' Guide</span>
<ul class="versions">
<li class="version is-latest">
<a href="../../../comguide/2.0.0-M3/about.html">2.0.0-M3</a>
</li>
</ul>
</li>
<li class="component">
<span class="title">Contributors' Guide</span>
<ul class="versions">
<li class="version is-latest">
<a href="../../../conguide/2.0.0-M3/about.html">2.0.0-M3</a>
</li>
</ul>
</li>
<li class="component">
<span class="title">Design Docs</span>
<ul class="versions">
<li class="version is-latest">
<a href="../../../core/2.0.0-M3/about.html">2.0.0-M3</a>
</li>
</ul>
</li>
<li class="component">
<span class="title">Extensions Catalog</span>
<ul class="versions">
<li class="version is-latest">
<a href="../../../extensions/2.0.0-M3/about.html">2.0.0-M3</a>
</li>
</ul>
</li>
<li class="component">
<span class="title">Incubator Catalog</span>
<ul class="versions">
<li class="version is-latest">
<a href="../../../incubator/2.0.0-M3/about.html">2.0.0-M3</a>
</li>
</ul>
</li>
<li class="component">
<span class="title">JDO/DataNucleus</span>
<ul class="versions">
<li class="version is-latest">
<a href="../../../pjdo/2.0.0-M3/about.html">2.0.0-M3</a>
</li>
</ul>
</li>
<li class="component">
<span class="title">Legacy Catalog</span>
<ul class="versions">
<li class="version is-latest">
<a href="../../../legacy/2.0.0-M3/about.html">2.0.0-M3</a>
</li>
</ul>
</li>
<li class="component">
<span class="title">Reference Guide</span>
<ul class="versions">
<li class="version is-latest">
<a href="../../../refguide/2.0.0-M3/about.html">2.0.0-M3</a>
</li>
</ul>
</li>
<li class="component">
<span class="title">Release Notes</span>
<ul class="versions">
<li class="version is-latest">
<a href="../../../relnotes/2.0.0-M3/about.html">2.0.0-M3</a>
</li>
</ul>
</li>
<li class="component">
<span class="title">Restful Objects Viewer</span>
<ul class="versions">
<li class="version is-latest">
<a href="../../../vro/2.0.0-M3/about.html">2.0.0-M3</a>
</li>
</ul>
</li>
<li class="component">
<span class="title">Security Guide</span>
<ul class="versions">
<li class="version is-latest">
<a href="../../../security/2.0.0-M3/about.html">2.0.0-M3</a>
</li>
</ul>
</li>
<li class="component is-current">
<span class="title">Setup Guide</span>
<ul class="versions">
<li class="version is-current is-latest">
<a href="../about.html">2.0.0-M3</a>
</li>
</ul>
</li>
<li class="component">
<span class="title">Subdomains Catalog</span>
<ul class="versions">
<li class="version is-latest">
<a href="../../../subdomains/2.0.0-M3/about.html">2.0.0-M3</a>
</li>
</ul>
</li>
<li class="component">
<span class="title">Testing Guide</span>
<ul class="versions">
<li class="version is-latest">
<a href="../../../testing/2.0.0-M3/about.html">2.0.0-M3</a>
</li>
</ul>
</li>
<li class="component">
<span class="title">User Guide</span>
<ul class="versions">
<li class="version is-latest">
<a href="../../../userguide/2.0.0-M3/about.html">2.0.0-M3</a>
</li>
</ul>
</li>
<li class="component">
<span class="title">Value Types Catalog</span>
<ul class="versions">
<li class="version is-latest">
<a href="../../../valuetypes/2.0.0-M3/about.html">2.0.0-M3</a>
</li>
</ul>
</li>
<li class="component">
<span class="title">Wicket Viewer</span>
<ul class="versions">
<li class="version is-latest">
<a href="../../../vw/2.0.0-M3/about.html">2.0.0-M3</a>
</li>
</ul>
</li>
</ul>
</div>
</div>
</aside>
</div>
<main role="main">
<div class="toolbar" role="navigation">
<button class="nav-toggle"></button>
<a href="../../../docs/2.0.0-M3/about.html" class="home-link"></a>
<nav class="breadcrumbs" aria-label="breadcrumbs">
<ul>
<li><a href="../about.html">Setup Guide</a></li>
<li><a href="hints-and-tips.html">Hints and Tips</a></li>
</ul>
</nav>
<div class="edit-this-page"><a href="https://github.com/apache/isis/edit/2.0.0-M3/antora/components/setupguide/modules/intellij/pages/hints-and-tips.adoc">Edit</a></div>
</div>
<article class="doc">
<a name="section-top"></a>
<h1 class="page">Hints and Tips</h1>
<div class="sect1">
<h2 id="keyboard-cheat-sheets"><a class="anchor" href="#keyboard-cheat-sheets"></a>Keyboard Cheat Sheets</h2>
<div class="sectionbody">
<div class="paragraph">
<p>You can download 1-page PDFs cheat sheets for IntelliJ&#8217;s keyboard shortcuts:
* for <a href="https://www.jetbrains.com/idea/docs/IntelliJIDEA_ReferenceCard.pdf">Windows</a>
* for <a href="https://www.jetbrains.com/idea/docs/IntelliJIDEA_ReferenceCard_Mac.pdf">MacOS</a></p>
</div>
<div class="paragraph">
<p>Probably the most important shortcut on them is for <code>Find Action</code>:
- <code>ctrl-shift-A</code> on Windows
- <code>cmd-shift-A</code> on MacOS.</p>
</div>
<div class="paragraph">
<p>This will let you search for any action just by typing its name.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="switch-between-tools-editors"><a class="anchor" href="#switch-between-tools-editors"></a>Switch between Tools &amp; Editors</h2>
<div class="sectionbody">
<div class="paragraph">
<p>The Tool Windows are the views around the editor (to left, bottom and right).
It&#8217;s possible to move these around to your preferred locations.</p>
</div>
<div class="ulist">
<ul>
<li>
<p>Use <code>alt-1</code> through <code>alt-9</code> (or <code>cmd-1</code> through <code>alt-9</code>) to select the tool windows</p>
<div class="ulist">
<ul>
<li>
<p>Press it twice and the tool window will hide itself; so can use to toggle</p>
</li>
</ul>
</div>
</li>
<li>
<p>If in the <em>Project Window</em> (say) and hit enter on a file, then it will be shown in the editor, but (conveniently) the focus remains in the tool window.
To switch to the editor, just press <code>Esc</code>.</p>
<div class="ulist">
<ul>
<li>
<p>If in the <em>Terminal Window</em>, you&#8217;ll need to press <code>Shift-Esc</code>.</p>
</li>
</ul>
</div>
</li>
<li>
<p>If on the editor and want to locate the file in (say) the <em>Project Window</em>, use <code>alt-F1</code>.</p>
</li>
<li>
<p>To change the size of any tool window, use <code>ctrl-shift-arrow</code></p>
</li>
</ul>
</div>
<div class="paragraph">
<p>Using these shortcuts you can easily toggle between the tool windows and the editor, without using the mouse.
Peachy!</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="navigating-around"><a class="anchor" href="#navigating-around"></a>Navigating Around</h2>
<div class="sectionbody">
<div class="paragraph">
<p>For all of the following, you don&#8217;t need to type every letter, typing "ab" will actually search for ".<strong>a.*b.</strong>".</p>
</div>
<div class="ulist">
<ul>
<li>
<p>to open classes or files or methods that you know the name of:</p>
<div class="ulist">
<ul>
<li>
<p><code>ctrl-N</code> to open class</p>
</li>
<li>
<p><code>ctrl-shift-N</code> to open a file</p>
</li>
<li>
<p>(bit fiddly this) <code>ctrl-shift-alt-N</code> to search for any symbol.</p>
</li>
</ul>
</div>
</li>
<li>
<p>open up dialog of recent files: <code>ctrl-E</code></p>
</li>
<li>
<p>search for any file: <code>shift-shift</code></p>
</li>
</ul>
</div>
<div class="paragraph">
<p>Navigating around:</p>
</div>
<div class="ulist">
<ul>
<li>
<p>find callers of a method (the call hierarchy): <code>ctrl-alt-H</code></p>
</li>
<li>
<p>find subclasses or overrides: <code>ctrl-alt-B</code></p>
</li>
<li>
<p>find superclasses/interface/declaration: <code>ctrl-B</code></p>
</li>
</ul>
</div>
<div class="paragraph">
<p>Viewing the structure (ie outline) of a class
* <code>ctrl-F12</code> will pop-up a dialog showing all members
** hit <code>ctrl-F12</code> again to also see inherited members</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="editing"><a class="anchor" href="#editing"></a>Editing</h2>
<div class="sectionbody">
<div class="ulist">
<ul>
<li>
<p>Extend selection using <code>ctrl-W</code></p>
<div class="ulist">
<ul>
<li>
<p>and contract it down again using <code>ctrl-shift-W</code></p>
</li>
</ul>
</div>
</li>
<li>
<p>to duplicate a line, it&#8217;s <code>ctrl-D</code></p>
<div class="ulist">
<ul>
<li>
<p>if you have some text selected (or even some lines), it&#8217;ll actually duplicate the entire selection</p>
</li>
</ul>
</div>
</li>
<li>
<p>to delete a line, it&#8217;s <code>ctrl-X</code></p>
</li>
<li>
<p>to move a line up or down: <code>shift-alt-up</code> and <code>shift-alt-down</code></p>
<div class="ulist">
<ul>
<li>
<p>if you have selected several lines, it&#8217;ll move them all togethe</p>
</li>
</ul>
</div>
</li>
<li>
<p><code>ctrl-shift-J</code> can be handy for joining lines together</p>
<div class="ulist">
<ul>
<li>
<p>just hit enter to split them apart (even in string quotes; IntelliJ will "do the right thing")</p>
</li>
</ul>
</div>
</li>
</ul>
</div>
</div>
</div>
<div class="sect1">
<h2 id="intentions-and-code-completion"><a class="anchor" href="#intentions-and-code-completion"></a>Intentions and Code Completion</h2>
<div class="sectionbody">
<div class="paragraph">
<p>Massively useful is the "Intentions" popup; IntelliJ tries to guess what you might want to do.
You can activate this using`alt-enter`, whenever you see a lightbulb/tooltip in the margin of the current line.</p>
</div>
<div class="paragraph">
<p>Code completion usually happens whenever you type '.'.
You can also use <code>ctrl-space</code> to bring these up.</p>
</div>
<div class="paragraph">
<p>In certain circumstances (eg in methods0) you can also type <code>ctrl-shift-space</code> to get a smart list of methods etc that you might want to call.
Can be useful.</p>
</div>
<div class="paragraph">
<p>Last, when invoking a method, use <code>ctrl-P</code> to see the parameter types.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="refactoring"><a class="anchor" href="#refactoring"></a>Refactoring</h2>
<div class="sectionbody">
<div class="paragraph">
<p>Loads of good stuff on the <code>Refactor</code> menu; most used are:</p>
</div>
<div class="ulist">
<ul>
<li>
<p>Rename (<code>shift-F6</code>)</p>
</li>
<li>
<p>Extract</p>
<div class="ulist">
<ul>
<li>
<p>method: <code>ctrl-alt-M</code></p>
</li>
<li>
<p>variable: <code>ctrl-alt-V</code></p>
</li>
</ul>
</div>
</li>
<li>
<p>Inline method/variable: <code>ctrl-alt-N</code></p>
</li>
<li>
<p>Change signature</p>
</li>
</ul>
</div>
<div class="paragraph">
<p>If you can&#8217;t remember all those shortcuts, just use <code>ctrl-shift-alt-T</code> (might want to rebind that to something else!) and get a context-sensitive list of refactorings available for the currently selected object</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="troubleshooting"><a class="anchor" href="#troubleshooting"></a>Troubleshooting</h2>
<div class="sectionbody">
<div class="paragraph">
<p>When a Maven module is imported, IntelliJ generates its own project files (suffix <code>.ipr</code>), and the application is actually built from that.</p>
</div>
<div class="paragraph">
<p>Occasionally these don&#8217;t keep in sync (even if auto-import of Maven modules has been enabled).</p>
</div>
<div class="paragraph">
<p>To fix the issue, try:</p>
</div>
<div class="ulist">
<ul>
<li>
<p>reimport module</p>
</li>
<li>
<p>rebuild selected modules/entire project</p>
</li>
<li>
<p>remove and then re-add the project</p>
</li>
<li>
<p>restart, invalidating caches</p>
</li>
<li>
<p>hit StackOverflow (!)</p>
</li>
</ul>
</div>
<div class="paragraph">
<p>One thing worth knowing; IntelliJ actively scans the filesystem all the time.
It&#8217;s therefore (almost always) fine to build the app from the Maven command line; IntelliJ will detect the changes and keep in sync.
If you want to force that, use <code>File &gt; Synchronize</code>, <code>ctrl-alt-Y</code>.</p>
</div>
</div>
</div>
</article>
<aside class="article-aside toc" role="navigation">
<p class="toc-title">On this page</p>
<div id="article-toc"></div>
</aside>
</main>
</div>
<footer class="footer">
<div class="content">
<div class="copyright">
<p>
Copyright © 2010~2020 The Apache Software Foundation, licensed under the Apache License, v2.0.
<br/>
Apache, the Apache feather logo, Apache Isis, and the Apache Isis project logo are all trademarks of The Apache Software Foundation.
</p>
</div>
<div class="revision">
<p>Revision: SNAPSHOT</p>
</div>
</div>
</footer>
<script src="../../../_/js/site.js"></script>
<script async src="../../../_/js/vendor/highlight.js"></script>
<script src="../../../_/js/vendor/jquery-3.4.1.min.js"></script>
<script src="../../../_/js/vendor/jquery-ui-1.12.1.custom.widget-only.min.js"></script>
<script src="../../../_/js/vendor/jquery.tocify.min.js"></script>
<script>
$(function() {
$("#article-toc").tocify( {
showEffect: "slideDown",
hashGenerator: "pretty",
hideEffect: "slideUp",
selectors: "h2, h3",
scrollTo: 120,
smoothScroll: true,
theme: "jqueryui",
highlightOnScroll: true
} );
});
</script>
</body>
</html>