Instantly share code, notes, and snippets.

Embed
What would you like to do?
Intelli-sense

DoSelect IDE Java Intellisense & Snippets

A collection of Java commands for optimizing modern Java development productivity.

java-intellisense video demo

IntelliSense

IntelliSense is a feature in editors to increase developer productivity. It groups together features like code-completion, parameter info, quick info and member info. It is usually referred to as code-completion, code-assist and code-hinting by developers.

IntelliSense for Java

IntelliSense can be be configured in DoSelect IDE by clicking on the File menu in navigation bar and then selecting enable IntelliSense from preferences. Intellisense preferences toggle

IntelliSense Feature

Desmond IntelliSense will trigger as user is typing characters, the list of members (variables, methods, etc.) is filtered to include only members containing your typed characters. Pressing Tab or Enter will insert the selected member. You can trigger IntelliSense in any editor window by typing Ctrl+Space or by typing a trigger character (such as the dot character (.) in Java).

If you prefer, you can turn off IntelliSense as you type. See below for more info.

Available Completions

Importing packages

Suggesting Packages using intellisense

Calling methods associated with a particular object

Suggesting methods for the instance of class

Suggesting constructor for an imported package

java version "1.8.0_171" Java(TM) SE Runtime Environment (build 1.8.0_171-b11) Java HotSpot(TM) 64-Bit Server VM (build 25.171-b11, mixed mode)

Supported Language

  • Java

Supported system packages

[ "java.util.ArrayList", "java.io.IOException", "java.util.List", "java.util.HashMap", "java.util.Map", "java.io.File", "java.io.InputStream", "java.util.Set", "java.util.Arrays", "java.util.Iterator", "java.util.Collections", "java.util.Date", "java.util.HashSet", "java.io.BufferedReader", "java.util.Collection", "java.net.URL", "java.io.FileInputStream", "java.io.InputStreamReader", "java.io.FileOutputStream", "java.io.FileNotFoundException", "java.io.OutputStream", "java.util.regex.Pattern", "java.io.Serializable", "java.util.LinkedList", "java.text.SimpleDateFormat", "java.util.Properties", "java.util.Random", "java.lang.reflect.Method", "java.io.ByteArrayOutputStream", "java.util.regex.Matcher", "java.util.logging.Logger", "java.io.UnsupportedEncodingException", "java.util.Comparator", "java.io.ByteArrayInputStream", "java.io.PrintWriter", "java.util.Calendar", "java.net.MalformedURLException", "java.util.Locale", "java.util.Enumeration", "java.io.FileWriter", "java.io.FileReader", "java.lang.reflect.InvocationTargetException", "java.util.logging.Level", "java.lang.reflect.Field", "java.io.StringWriter", "java.util.LinkedHashMap", "java.io.Reader", "java.net.URI", "java.io.Writer", "java.text.ParseException", "java.io.OutputStreamWriter", "java.io.StringReader", "java.io.BufferedWriter", "java.util.Vector", "java.util.StringTokenizer", "java.text.DateFormat", "java.util.concurrent.TimeUnit", "java.io.BufferedInputStream", "java.util.TreeMap", "org.xml.sax.SAXException", "java.io.PrintStream", "java.util.TreeSet", "java.util.Hashtable", "java.lang.reflect.Constructor", "java.net.URLEncoder", "java.security.NoSuchAlgorithmException", "org.w3c.dom.Document", "java.awt.Color", "java.net.URISyntaxException", "javax.xml.parsers.DocumentBuilderFactory", "java.lang.annotation.Retention", "java.security.MessageDigest", "java.util.concurrent.Executors", "java.net.UnknownHostException", "java.sql.SQLException", "java.util.UUID", "java.net.InetAddress", "java.util.concurrent.ConcurrentHashMap", "java.awt.event.ActionEvent" ]

Java Snippets

Snippets are optimized to be short and easy to remember.

Access Modifiers

po⇥

protected

pu⇥

public

po⇥

private

Annotations Snippets

before⇥

@Before
static void ${1:intercept}(${2:args}) { ${3} }

mm⇥

@ManyToMany
${1}

mo⇥

@ManyToOne
${1}

om⇥

@OneToMany${1:(cascade=CascadeType.ALL)}
${2}

oo⇥

@OneToOne
${1}

Basic Java packages and import

im⇥

import

j.b⇥

java.beans.

j.i⇥

java.io.

j.m⇥

java.math.

j.n⇥

java.net.

Class

cl⇥

class ${1:`Filename("", "untitled")`} ${2}

in⇥

interface ${1:`Filename("", "untitled")`} ${2:extends Parent}${3}

tc⇥

public class ${1:`Filename()`} extends ${2:TestCase}

Class Enhancements

ext⇥

extends

imp⇥

implements

Comments

/*

/*
 * ${1}
 */

Constants

co

static public final ${1:String} ${2:var} = ${3};${4}

cos

static public final String ${1:var} = "${2}";${3}

Control Statements

case⇥

case ${1}:
	${2}

def⇥

default:
	${2}

el⇥

else

elif⇥

else if (${1}) ${2}

if⇥

if (${1}) ${2}

sw⇥

switch (${1}) {
	${2}
}

Create a Method

m⇥

${1:void} ${2:method}(${3}) ${4:throws }${5}

Create a Variable

v⇥

${1:String} ${2:var}${3: = null}${4};${5}

Enhancements to Methods, variables, classes, etc.

ab⇥

abstract

fi⇥

final

st⇥

static

sy⇥

synchronized

Error Methods

err⇥

System.err.print("${1:Message}");

errf⇥

System.err.printf("${1:Message}", ${2:exception});

errln⇥

System.err.println("${1:Message}");

Exception Handling

as⇥

assert ${1:test} : "${2:Failure message}";${3}

ca⇥

catch(${1:Exception} ${2:e}) ${3}

thr⇥

throw

ths⇥

throws

try⇥

try {
	${3}
	} catch(${1:Exception} ${2:e}) {
}

tryf⇥

try {
	${3}
	} catch(${1:Exception} ${2:e}) {
	} finally {
}

Find Methods

findall⇥

List<${1:listName}> ${2:items} = ${1}.findAll();${3}

findbyid⇥

${1:var} ${2:item} = ${1}.findById(${3});${4}

Javadocs

/**⇥

/**
	* ${1}
	*/

@au⇥

@author `system("grep \`id -un\` /etc/passwd | cut -d \":\" -f5 | cut -d \",\" -f1")`

@br⇥

@brief ${1:Description}

@fi⇥

@file ${1:`Filename()`}.java

@pa⇥

@param ${1:param}

@re⇥

@return ${1:param}

Logger Methods

debug⇥

Logger.debug(${1:param});${2}

error⇥

Logger.error(${1:param});${2}

info⇥

Logger.info(${1:param});${2}

warn⇥

Logger.warn(${1:param});${2}

Loops

enfor⇥

for (${1} : ${2}) ${3}

for⇥

for (${1}; ${2}; ${3}) ${4}

wh⇥

while (${1}) ${2}

Main method

main⇥

public static void main (String[] args) {
	${1:/* code */}
}

Print methods

print⇥

System.out.print("${1:Message}");

printf⇥

System.out.printf("${1:Message}", ${2:args});

println⇥

System.out.println(${1});

Render Methods

ren⇥

render(${1:param});${2}

rena⇥

renderArgs.put("${1}", ${2});${3}

renb⇥

renderBinary(${1:param});${2}

renj⇥

renderJSON(${1:param});${2}

renx⇥

renderXml(${1:param});${2}

Setter and Getter Methods

set⇥

${1:public} void set${3:}(${2:String} ${4:}){
	this.$4 = $4;
}

get⇥

${1:public} ${2:String} get${3:}(){
	return this.${4:};
}

Terminate Methods or Loops

re⇥

return

br⇥

break;

Test Methods

t⇥

public void test${1:Name}() throws Exception {
	${2}
}

test⇥

@Test
public void test${1:Name}() throws Exception {
	${2}
}

Utils

sc⇥

Scanner

Miscellaneous

action⇥

public static void ${1:index}(${2:args}) { ${3} }

rnf⇥

notFound(${1:param});${2}

rnfin⇥

notFoundIfNull(${1:param});${2}

rr⇥

redirect(${1:param});${2}

ru⇥

unauthorized(${1:param});${2}

unless⇥

(unless=${1:param});${2}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment