Minggu, 14 Agustus 2016

NetBeans Platform Training

NetBeans Platform Training - Hallo sahabat Computer Programmer Medical Coding, Pada Artikel yang anda baca kali ini dengan judul NetBeans Platform Training, kami telah mempersiapkan artikel ini dengan baik untuk anda baca dan ambil informasi didalamnya. mudah-mudahan isi postingan Artikel Beginners, Artikel NetBeans, yang kami tulis ini dapat anda pahami. baiklah, selamat membaca.

Judul : NetBeans Platform Training
link : NetBeans Platform Training

Baca juga


NetBeans Platform Training

NetBeans Platform Training

It’s official now: The JasperReport Visual Designer will be released as an open source project. Genomatix , the software company I’m working for, has decided to let me release the JasperReport Visual Designer, most likely under the CDDL license. Thanks for the comments and for the offer to contribute. I have created Project “jarvis” on java.net, there is no content yet, but I will add screenshots and the roadmap during the next days.


I improved the usability of the visual designer a lot during the last two weeks, and I hope to be ready with this part by the end of the week.

I will have to a lot of cleaning up in the sources and update them with the new license until I can release some code. I’m planning to have an initial prerelease before the end of this year. Everyone is blogging about switching IDEs these days. I guess trying eclipse for a while might really be helpful for for improving netbeans. One thing that I really liked about eclipse is, that there are mirror sites for update centers. I think this is something netbeans should also provide. We are currently porting a Rich Client Application to netbeans, and this is one thing I was really missing. I also asked Roumen for this feature at the NUG in munich.

Seems that everytime a module has been updated the user needs to select a mirror for the next module-So I had to check repeatedly, wether my update was again stuck, because eclipse needed another mirror site for a module. The list always contained the same mirrors, so I don’t think this is necessary.   From that point of view, I like the netbeans solution better.

Maybe there is a way to combine the better user experience of netbeans and still have mirror sites by letting the user define default mirror-sites for update centers. Another way might be to let users select the mirror sites for all modules at the beginning of the update instead of interupting the whole process for that.
I have added drag&drop support, resizing and baseline support to the JasperReportEditor .

I also had a hard time finding out how to activate some of them, and today there was a posting about how to activate undo/redo, so I thought I should share my findings on this:


All you need to do is override your Topcomponents getUndoRedo() method.


1. Add a variable to your topcomponent:


  private UndoRedo.Manager undoRedoManager = new UndoRedoManager();


2. Add the following code:


  public UndoRedo getUndoRedo(){
       return getUndoRedoManager();
   }
     UndoRedo.Manager getUndoRedoManager() {
       if (undoRedoManager == null) {
           undoRedoManager = new UndoRedoManager();
           undoRedoManager.setLimit(50);
       }
       return undoRedoManager;
   }
     // [Undo manager performing undo/redo in AWT event thread should not be
   //  probably implemented here - in FormModel - but separately.]
   static class UndoRedoManager extends UndoRedo.Manager {
       private Mutex.ExceptionAction runUndo = new Mutex.ExceptionAction() {
           public Object run() throws Exception {
               superUndo();
               return null;
           }
       };
       private Mutex.ExceptionAction runRedo = new Mutex.ExceptionAction() {
           public Object run() throws Exception {
               superRedo();
               return null;
           }
       };
             public void superUndo() throws CannotUndoException {
           super.undo();
       }
       public void superRedo() throws CannotRedoException {
           super.redo();
       }
             public void undo() throws CannotUndoException {
           if (java.awt.EventQueue.isDispatchThread()) {
               superUndo();
           } else {
               try {
                   Mutex.EVENT.readAccess(runUndo);
               } catch (MutexException ex) {
                   Exception e = ex.getException();
                   if (e instanceof CannotUndoException)
                       throw (CannotUndoException) e;
                   else // should not happen, ignore
                       e.printStackTrace();
               }
           }
       }
             public void redo() throws CannotRedoException {
           if (java.awt.EventQueue.isDispatchThread()) {
               superRedo();
           } else {
               try {
                   Mutex.EVENT.readAccess(runRedo);
               } catch (MutexException ex) {
                   Exception e = ex.getException();
                   if (e instanceof CannotRedoException)
                       throw (CannotRedoException) e;
                   else // should not happen, ignore
                       e.printStackTrace();
               }
           }
       }
   }


3. To show that it works you can add some example undoable edit (e.g. in the constructor):


 undoRedoManager.addEdit(new UndoableEdit() {
            public boolean addEdit(UndoableEdit anEdit) {
                return true;
            }
            public boolean canRedo() {
                return true;
            }
            public boolean canUndo() {
                return true;
            }
            public void die() {
            }
            public String getPresentationName() {
                return "my edit";
            }
            public String getRedoPresentationName() {
                 return "my edit";
            }
            public String getUndoPresentationName() {
                 return "my edit";
            }
            public boolean isSignificant() {
                return true;
            }
            public void redo() throws CannotRedoException {
            }
            public boolean replaceEdit(UndoableEdit anEdit) {
                return true;
            }
            public void undo() throws CannotUndoException {
            }
        });
              

In the last blog of this series we have added some basic support for IzPack via a module suites build script and an Install script. Now we will edit the scripts to make the installer a little more useful. I don’t now how I could tell the Installer to unzip the file we have added, so we’ll use ant to unzip the distribution file generated by the build-zip task. Afterwards we will edit the IzPack-installer.xml to pack it again.


1. Add a new target “build-unzip” to your modules build.xml and alter the izpack target to depend on it

      
        <izpack input="${basedir}/IzPack-install.xml"
                output="${basedir}/IzPack-install.jar"
                installerType="standard"
                basedir="${basedir}"
                izPackDir="${basedir}/"/>
   


2. Alter the IzPack-install.xml to pack the directories . Replace the occurrences of  by your applications name:
       
            The base files
           
            " targetdir="$INSTALL_PATH"/>
            .conf" targetdir="$INSTALL_PATH//etc/"/>
            .conf"/>
       
   
8<------8

The new file definition for .conf will overwrite the default file. The parsable tag indicates that your .conf contains variables that the installer will replace with their values during the installation.

3. Now you need to supply this file (.conf) and add it  to your module suites root dir:

8.conf---8


 # ${HOME} will be replaced by JVM user.home system property
default_userdir="${HOME}/.${APPNAME}/dev"
default_mac_userdir="${HOME}/Library/Application Support/${APPNAME}/dev"

# options used by the launcher by default, can be overridden by explicit
# command line switches
default_options="-J-Xms24m -J-Xmx64m -J-Dnetbeans.logger.console=true -J-ea"

# default location of JDK/JRE, can be overridden by using --jdkhome  switch
jdkhome="$JAVA_HOME"

# clusters' paths separated by path.separator (semicolon on Windows, colon on Unices)
#extra_clusters=

The $JAVA_HOME variable will be replaced by IzPack with the current Runtime.

4. Now run the install task. The installer built from this will create the correct directory structure. If you install on your own machine the installed application can be launched from the bin directory.


Demikianlah Artikel : NetBeans Platform Training

Semoga artikel NetBeans Platform Training ini, bisa memberi manfaat untuk anda semua dan jangan bosan untuk datang kembali mengunjungi blog ini. Baiklah, sampai jumpa di postingan artikel lainnya.

Artikel yang anda baca saat ini NetBeans Platform Training dengan alamat link https://idkingcode.blogspot.com/2016/08/netbeans-platform-training.html

Artikel Terkait

NetBeans Platform Training
4/ 5
Oleh

Berlangganan

Suka dengan artikel di atas? Silakan berlangganan gratis via email