Thread: IntelliJ IDEA Question

Results 1 to 5 of 5
  1. #1 IntelliJ IDEA Question 
    Donator

    Jason's Avatar
    Join Date
    Aug 2009
    Posts
    6,092
    Thanks given
    2,402
    Thanks received
    2,823
    Rep Power
    4550
    Hey,

    For the sake of efficiency I've been looking for a way to auto-complete a class or enum by providing information about the constructor. Does this exist?

    Example;
    Code:
    enum FooEnum {
        BAR(new Object(), 1, 1.0);// at this point allow the auto completion of the 
                                  // enum by creating the constructor, private final 
                                  // members, and accessor methods.
         
    }
    Reply With Quote  
     

  2. #2  
    Registered Member

    Join Date
    Dec 2012
    Posts
    2,999
    Thanks given
    894
    Thanks received
    921
    Rep Power
    2555
    I'm not sure about automatically generating class fields, but if you manually define them, you can automatically generate the constructor, you can do that via alt+insert, and then selecting constructor/getter+/setter/toString
    If there is a way to automatically generate class fields it's basically the same amount of work as defining them yourself as they'd need to be refactored
    Attached image
    Reply With Quote  
     

  3. Thankful users:


  4. #3  
    Registered Member

    Join Date
    Sep 2016
    Posts
    384
    Thanks given
    1
    Thanks received
    117
    Rep Power
    311
    If you're talking about Live templates and autocomplete like "Syso", just search for Live templates and create your own. However, you could just use the hotkeys like Kaleem said above.

    Something to look at : Live Templates
    Reply With Quote  
     

  5. Thankful user:


  6. #4  
    fumant viriditas quotidiana

    saifix's Avatar
    Join Date
    Feb 2009
    Age
    30
    Posts
    1,237
    Thanks given
    275
    Thanks received
    957
    Rep Power
    3304
    No, you can generate them in sequence though starting from your code example, not that it's all that much of a time saver: http://streamable.com/wtq89

    Alt+Enter on the ENUM_VALUE's arguments (Create constructor Quick Fix)
    Alt+Enter on constructor parameters (Bind parameters to field Quick Fix)
    Alt+Insert inside class body (Getter generator)
    "Im so bluezd out of my box.
    Im so fkd i canr even sens makeas Smoke blunt 420hash e tizday" - A legendary guy (1993 - 2015)
    Quote Originally Posted by nmopal View Post
    I will be creating a grimy dubstep song using these lyrics and vocaloid please prepare your bodies
    Reply With Quote  
     

  7. Thankful users:


  8. #5  
    Donator

    Jason's Avatar
    Join Date
    Aug 2009
    Posts
    6,092
    Thanks given
    2,402
    Thanks received
    2,823
    Rep Power
    4550
    Quote Originally Posted by saifix View Post
    No, you can generate them in sequence though starting from your code example, not that it's all that much of a time saver: http://streamable.com/wtq89

    Alt+Enter on the ENUM_VALUE's arguments (Create constructor Quick Fix)
    Alt+Enter on constructor parameters (Bind parameters to field Quick Fix)
    Alt+Insert inside class body (Getter generator)
    This is exactly the functionality I was looking for. Thank you.
    Reply With Quote  
     


Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

Similar Threads

  1. Eclipse vs IntelliJ IDEA
    By Shawn Patel in forum Chat
    Replies: 2
    Last Post: 03-30-2013, 12:20 AM
  2. IDEs: Eclipse vs. IntelliJ IDEA
    By Conner_ in forum Application Development
    Replies: 10
    Last Post: 07-18-2011, 04:09 AM
  3. Emulous [Multiple ideas,questions,etc]
    By fatalx in forum Requests
    Replies: 1
    Last Post: 06-03-2009, 11:14 PM
  4. Replies: 20
    Last Post: 04-21-2009, 05:23 PM
  5. Setting Up RS2D With IntelliJ IDEA.
    By Ian... in forum Tutorials
    Replies: 27
    Last Post: 08-05-2008, 12:48 PM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •