Documentation

Trace:

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision Both sides next revision
jvx:firstapp_step-by-step [2018/01/30 08:13]
admin
jvx:firstapp_step-by-step [2018/01/30 08:16]
admin
Line 378: Line 378:
   /**   /**
    * Creates a new instance of DBEditFrame for a specific application.    * Creates a new instance of DBEditFrame for a specific application.
- * <​p/>​ +   * <​p/>​ 
- * @param pApp the application +   ​* @param pApp the application 
- * @throws Throwable if the remote access fails +   ​* @throws Throwable if the remote access fails 
- */ +   ​*/ 
- ​public DBEditFrame(Application pApp) throws Throwable +  public DBEditFrame(Application pApp) throws Throwable 
- { +  
- ​super(pApp.getDesktopPane());​+    super(pApp.getDesktopPane());​
    
- application = pApp;+    ​application = pApp;
    
- initializeModel();​ +    ​initializeModel();​ 
- ​initializeUI();​ +    initializeUI();​ 
- }+  }
    
- /** +  ​/** 
- * Initializes the model. +   ​* Initializes the model. 
- * <​p/>​ +   ​* <​p/>​ 
- * @throws Throwable if the initialization throws an error +   ​* @throws Throwable if the initialization throws an error 
- */ +   ​*/ 
- ​private void initializeModel() throws Throwable +  private void initializeModel() throws Throwable 
- { +  
- //we use a new "​session"​ for the screen +    //we use a new "​session"​ for the screen 
- ​connection = ((MasterConnection)application.getConnection()). +    connection = ((MasterConnection)application.getConnection()). 
- ​createSubConnection("​apps.firstapp.frames.DBEdit"​);​ +    createSubConnection("​apps.firstapp.frames.DBEdit"​);​ 
- ​connection.open();​+    connection.open();​
  
- //data connection +    ​//data connection 
- ​dataSource.setConnection(connection);​ +    dataSource.setConnection(connection);​ 
- ​dataSource.open();​+    dataSource.open();​
    
- //table +    ​//table 
- ​rdbContacts.setDataSource(dataSource);​ +    rdbContacts.setDataSource(dataSource);​ 
- ​rdbContacts.setName("​contacts"​);​ +    rdbContacts.setName("​contacts"​);​ 
- ​rdbContacts.open();​ +    rdbContacts.open();​ 
- }+  }
    
- /** +  ​/** 
- * Initializes the UI. +   ​* Initializes the UI. 
- * <​p/>​ +   ​* <​p/>​ 
- * @throws Exception if the initialization throws an error +   ​* @throws Exception if the initialization throws an error 
- */ +   ​*/ 
- ​private void initializeUI() throws Exception +  private void initializeUI() throws Exception 
- { +  
- ​UIGroupPanel group = new UIGroupPanel();​ +    UIGroupPanel group = new UIGroupPanel();​ 
- ​group.setText("​Available Contacts"​);​+    group.setText("​Available Contacts"​);​
    
- UITable table = new UITable();​ +    ​UITable table = new UITable();​ 
- ​table.setDataBook(rdbContacts);​+    table.setDataBook(rdbContacts);​
    
- group.setLayout(new UIBorderLayout());​ +    ​group.setLayout(new UIBorderLayout());​ 
- ​group.add(table);​+    group.add(table);​
    
- //same behaviour as centered component in BorderLayout  +    ​//same behaviour as centered component in BorderLayout  
- ​setLayout(new UIBorderLayout());​ +    setLayout(new UIBorderLayout());​ 
- ​add(group); ​+    add(group); ​
  
- setTitle("​Contacts"​);​ +    ​setTitle("​Contacts"​);​ 
- ​setSize(new UIDimension(400,​ 500)); +    setSize(new UIDimension(400,​ 500)); 
- ​} ​+  
  
- //​~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +  ​//​~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
- // Overwritten methods +  // Overwritten methods 
- //​~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~+  //​~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  
- /** +  ​/** 
- * Closes the communication connection and disposes the frame. +   ​* Closes the communication connection and disposes the frame. 
- */ +   ​*/ 
- ​@Override +  @Override 
- ​public void dispose() +  public void dispose() 
- { +  
- try +    try 
- { +    
- ​connection.close();​ +      connection.close();​ 
- } +    
- catch (Throwable th) +    catch (Throwable th) 
- { +    
- //​nothing to be done +      //nothing to be done 
- } +    
- ​finally +    finally 
- { +    
- ​super.dispose();​ +      super.dispose();​ 
- } +    
- }+  }
  
 } // DBEditFrame } // DBEditFrame
This website uses cookies for visitor traffic analysis. By using the website, you agree with storing the cookies on your computer.More information