Although this is an old question, I'd like to add some input.
Eclipse doesn't natively support custom code folding blocks, as does Visual Studio with its #region
and #endregion
directives, or Netbeans with its //<editor-fold defaulstate="collapsed" desc="My custom code folding block"
and //</editor-fold>
.
(IntelliJ supports this as well, with both aforementioned methods working, depending on how the IDE is configured.)
If you happen to be working in Eclipse with the CDT (as in C/C++), there is a way around.
I've tried installing the plugins mentioned, but they either do not exist anymore, or the installation makes the IDE unstable.
Create a header file in a central location, which contains macros, etc (optional).
In that header, simply define a FOLD macro, as below:
#define FOLD //
Each file that #includes your central header file will also have a reference to the macro above.
An example use of this would be:
#ifdef FOLD Struct MyFileStruct
#pragma pack(1)
typedef struct MyFileStruct {
WCHAR fileName[FILENAMELEN]; // File name
WCHAR fileInfos[32]; // File info
WCHAR fileDate[32]; // File date
DWORD sizeInBytes; // File size
} File;
#pragma pack()
#endif
If the way this works is unclear, I suggest looking in to the C Preprocessor
I hope this is of some use!