@ -1,8 +1,10 @@
package com.fr.design.mainframe ;
package com.fr.design.mainframe ;
import com.fanruan.repository.TemplateRepository ;
import com.fanruan.repository.TemplateRepository ;
import com.fine.swing.ui.layout.Layouts ;
import com.fine.theme.icon.LazyIcon ;
import com.fine.theme.icon.LazyIcon ;
import com.fine.theme.utils.FineLayoutBuilder ;
import com.fine.theme.utils.FineLayoutBuilder ;
import com.fine.theme.utils.FineUIScale ;
import com.fine.theme.utils.FineUIStyle ;
import com.fine.theme.utils.FineUIStyle ;
import com.formdev.flatlaf.util.ScaledEmptyBorder ;
import com.formdev.flatlaf.util.ScaledEmptyBorder ;
import com.fr.base.BaseUtils ;
import com.fr.base.BaseUtils ;
@ -641,11 +643,7 @@ public class DesignerFrameFileDealerPane extends JPanel implements FileToolbarSt
this . setModal ( true ) ;
this . setModal ( true ) ;
// 输入框前提示
// 输入框前提示
UILabel newNameLabel = new UILabel ( Toolkit . i18nText (
UILabel newNameLabel = new UILabel ( Toolkit . i18nText ( "Fine-Design_Basic_Enter_New_Folder_Name" ) ) ;
"Fine-Design_Basic_Enter_New_Folder_Name" )
) ;
newNameLabel . setHorizontalAlignment ( SwingConstants . RIGHT ) ;
newNameLabel . setBorder ( BorderFactory . createEmptyBorder ( 0 , 0 , 0 , 10 ) ) ;
// 文件名输入框
// 文件名输入框
nameField = new UITextField ( ) ;
nameField = new UITextField ( ) ;
@ -667,12 +665,9 @@ public class DesignerFrameFileDealerPane extends JPanel implements FileToolbarSt
}
}
} ) ;
} ) ;
nameField . selectAll ( ) ;
nameField . selectAll ( ) ;
nameField . setPreferredSize ( new Dimension ( 180 , 20 ) ) ;
JPanel topPanel = new JPanel ( new FlowLayout ( FlowLayout . LEFT , 0 , 5 ) ) ;
JPanel topPanel = Layouts . row ( 10 , Layouts . cell ( newNameLabel ) , Layouts . cell ( nameField ) . weight ( 1 ) ) . getComponent ( ) ;
topPanel . setBorder ( BorderFactory . createEmptyBorder ( 15 , 15 , 0 , 15 ) ) ;
topPanel . setBorder ( new ScaledEmptyBorder ( 15 , 10 , 0 , 10 ) ) ;
topPanel . add ( newNameLabel ) ;
topPanel . add ( nameField ) ;
// 增加enter以及esc快捷键的支持
// 增加enter以及esc快捷键的支持
nameField . addKeyListener ( new KeyAdapter ( ) {
nameField . addKeyListener ( new KeyAdapter ( ) {
@ -689,15 +684,14 @@ public class DesignerFrameFileDealerPane extends JPanel implements FileToolbarSt
} ) ;
} ) ;
// 重名提示
// 重名提示
warnLabel = new UILabel ( ) ;
warnLabel = new UILabel ( ) ;
warnLabel . setPreferredSize ( new Dimension ( 300 , 50 ) ) ;
warnLabel . setHorizontalAlignment ( SwingConstants . LEFT ) ;
warnLabel . setHorizontalAlignment ( SwingConstants . LEFT ) ;
warnLabel . setVerticalAlignment ( SwingConstants . TOP ) ;
warnLabel . setVerticalAlignment ( SwingConstants . TOP ) ;
warnLabel . setForeground ( Color . RED ) ;
warnLabel . setVisible ( false ) ;
warnLabel . setVisible ( false ) ;
FineUIStyle . setStyle ( warnLabel , FineUIStyle . LABEL_WARNING_TIP ) ;
JPanel midPanel = new JPanel ( new BorderLayout ( ) ) ;
JPanel midPanel = new JPanel ( new BorderLayout ( ) ) ;
midPanel . setBorder ( BorderFactory . create EmptyBorder( 0 , 15 , 0 , 15 ) ) ;
midPanel . setBorder ( new Scaled EmptyBorder( 0 , 10 , 0 , 10 ) ) ;
midPanel . add ( warnLabel , BorderLayout . WEST ) ;
midPanel . add ( Layouts . column ( Layouts . flex ( ) , Layouts . cell ( warnLabel ) , Layouts . flex ( ) ) . getComponent ( ) ) ;
// 确认按钮
// 确认按钮
confirmButton = new UIButton ( Toolkit . i18nText ( "Fine-Design_Basic_Confirm" ) ) ;
confirmButton = new UIButton ( Toolkit . i18nText ( "Fine-Design_Basic_Confirm" ) ) ;
@ -719,10 +713,8 @@ public class DesignerFrameFileDealerPane extends JPanel implements FileToolbarSt
}
}
} ) ;
} ) ;
JPanel bottomPanel = new JPanel ( new FlowLayout ( FlowLayout . RIGHT , 10 , 0 ) ) ;
JPanel bottomPanel = Layouts . row ( 10 , Layouts . flex ( ) , Layouts . cell ( confirmButton ) , Layouts . cell ( cancelButton ) ) . getComponent ( ) ;
bottomPanel . setBorder ( BorderFactory . createEmptyBorder ( 10 , 15 , 10 , 10 ) ) ;
bottomPanel . setBorder ( new ScaledEmptyBorder ( 10 , 10 , 10 , 10 ) ) ;
bottomPanel . add ( confirmButton ) ;
bottomPanel . add ( cancelButton ) ;
this . add (
this . add (
TableLayoutHelper . createTableLayoutPane (
TableLayoutHelper . createTableLayoutPane (
@ -731,13 +723,12 @@ public class DesignerFrameFileDealerPane extends JPanel implements FileToolbarSt
new Component [ ] { midPanel } ,
new Component [ ] { midPanel } ,
new Component [ ] { bottomPanel }
new Component [ ] { bottomPanel }
} ,
} ,
new double [ ] { TableLayout . FILL , TableLayout . PREFERRED , TableLayout . PREFERRED } ,
new double [ ] { TableLayout . PREFERRED , TableLayout . FILL , TableLayout . PREFERRED } ,
new double [ ] { TableLayout . FILL }
new double [ ] { TableLayout . FILL }
) ,
) ,
BorderLayout . CENTER ) ;
BorderLayout . CENTER ) ;
this . setSize ( FineUIScale . createScaleDimension ( 380 , 200 ) ) ;
this . setSize ( 380 , 200 ) ;
this . setTitle ( Toolkit . i18nText ( "Fine-Design_Basic_Mkdir" ) ) ;
this . setTitle ( Toolkit . i18nText ( "Fine-Design_Basic_Mkdir" ) ) ;
this . setResizable ( false ) ;
this . setResizable ( false ) ;
this . setAlwaysOnTop ( true ) ;
this . setAlwaysOnTop ( true ) ;