This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Summary: | if condition statement is not properly formatted in function invocation | ||
---|---|---|---|
Product: | javafx | Reporter: | Alexandr Scherbatiy <sunflower> |
Component: | Editor | Assignee: | Anton Chechel <manowar> |
Status: | VERIFIED FIXED | ||
Severity: | normal | CC: | sustaining |
Priority: | P3 | ||
Version: | 6.x | ||
Hardware: | PC | ||
OS: | Windows XP | ||
Issue Type: | DEFECT | Exception Reporter: | |
Bug Depends on: | |||
Bug Blocks: | 173487 |
Description
Alexandr Scherbatiy
2009-11-18 07:53:29 UTC
How it should be formatted? The if statement is written on one line in this case: ----------------------------------------------------------------------- public function next() { jump(if (currentSlide == null) then 0 else Integer.parseInt(currentSlide)); } ----------------------------------------------------------------------- But the issue editor does not allow to put one long string in a line. It usually breaks the end of the string to the next line. Just format this code: ----------------------------------------------------------------------- class A { var currentSlide: String; public function jump(cur: Integer): Void { } public function next() { jump(if (currentSlide == null) then 0 else Integer.parseInt(currentSlide)); } } ----------------------------------------------------------------------- The point is to not break block that is written on one line. The same is for the for the loop. Format the code --------------------------------------------------------------- import javax.swing.JTable; import javax.swing.JComponent; import javax.swing.table.DefaultTableModel; import javafx.ext.swing.SwingComponent; package class TableColumn{ public var text: String; } package class SwingTable extends SwingComponent{ var table: JTable; var model: DefaultTableModel; public var selection: Integer; public var columns: TableColumn[] on replace{ model = new DefaultTableModel(for(column in columns) column.text, 0); table.setModel(model); }; override protected function createJComponent () : JComponent { return new JTable(model); } } --------------------------------------------------------------- The result is: --------------------------------------------------------------- public var columns: TableColumn[] on replace { model = new DefaultTableModel(for (column in columns) column.text, 0); table.setModel(model); }; --------------------------------------------------------------- verified in NetBeans-JavaFX-Soma: #62 Fixed in release68_fixes http://hg.netbeans.org/javafx/rev/d51b517f64ae Verified in NB 6.8 patch1 2010-01-25_21-27-59 |