@ -2,7 +2,12 @@ package com.fr.design.update.push;
import com.fr.design.dialog.UIDialog ;
import com.fr.design.dialog.UIDialog ;
import com.fr.design.ui.ModernUIPane ;
import com.fr.design.ui.ModernUIPane ;
import com.fr.design.utils.BrowseUtils ;
import com.fr.design.utils.gui.GUICoreUtils ;
import com.fr.design.utils.gui.GUICoreUtils ;
import com.fr.intelli.record.FocusPoint ;
import com.fr.intelli.record.MetricRegistry ;
import com.fr.intelli.record.Original ;
import com.fr.stable.StringUtils ;
import com.fr.web.struct.AssembleComponent ;
import com.fr.web.struct.AssembleComponent ;
import com.fr.web.struct.Atom ;
import com.fr.web.struct.Atom ;
import com.fr.web.struct.browser.RequestClient ;
import com.fr.web.struct.browser.RequestClient ;
@ -19,7 +24,7 @@ import java.awt.Frame;
* Created by plough on 2019 / 4 / 10 .
* Created by plough on 2019 / 4 / 10 .
* /
* /
class DesignerPushUpdateDialog extends UIDialog {
class DesignerPushUpdateDialog extends UIDialog {
public static final Dimension DEFAULT = new Dimension ( 640 , 32 0 ) ;
public static final Dimension DEFAULT = new Dimension ( 640 , 36 0 ) ;
private ModernUIPane < Model > jsPane ;
private ModernUIPane < Model > jsPane ;
@ -111,8 +116,10 @@ class DesignerPushUpdateDialog extends UIDialog {
this . content = content ;
this . content = content ;
}
}
public String getMoreInfoUrl ( ) {
public void browseMoreInfoUrl ( ) {
return moreInfoUrl ;
if ( StringUtils . isNotEmpty ( moreInfoUrl ) ) {
BrowseUtils . browser ( moreInfoUrl ) ;
}
}
}
public void setMoreInfoUrl ( String moreInfoUrl ) {
public void setMoreInfoUrl ( String moreInfoUrl ) {
@ -129,15 +136,18 @@ class DesignerPushUpdateDialog extends UIDialog {
public void updateNow ( ) {
public void updateNow ( ) {
DesignerPushUpdateManager . getInstance ( ) . doUpdate ( ) ;
DesignerPushUpdateManager . getInstance ( ) . doUpdate ( ) ;
FocusPointManager . submit ( FocusPointManager . OperateType . UPDATE ) ;
exit ( ) ;
exit ( ) ;
}
}
public void remindNextTime ( ) {
public void remindNextTime ( ) {
FocusPointManager . submit ( FocusPointManager . OperateType . REMIND_NEXT_TIME ) ;
exit ( ) ;
exit ( ) ;
}
}
public void skipThisVersion ( ) {
public void skipThisVersion ( ) {
DesignerPushUpdateManager . getInstance ( ) . skipCurrentPushVersion ( ) ;
DesignerPushUpdateManager . getInstance ( ) . skipCurrentPushVersion ( ) ;
FocusPointManager . submit ( FocusPointManager . OperateType . SKIP ) ;
exit ( ) ;
exit ( ) ;
}
}
@ -149,4 +159,28 @@ class DesignerPushUpdateDialog extends UIDialog {
DesignerPushUpdateDialog . this . dialogExit ( ) ;
DesignerPushUpdateDialog . this . dialogExit ( ) ;
}
}
}
}
private static class FocusPointManager {
private static final String ID = "com.fr.update.push" ;
private static final int SOURCE = Original . EMBED . toInt ( ) ;
private static final String TITLE = com . fr . design . i18n . Toolkit . i18nText ( "Fine-Design_Push_Update_Focus_Point" ) ;
private enum OperateType {
UPDATE ( 1 ) , REMIND_NEXT_TIME ( 2 ) , SKIP ( 3 ) ;
private int index ;
OperateType ( int index ) {
this . index = index ;
}
private String toText ( ) {
return String . valueOf ( this . index ) ;
}
}
private static void submit ( OperateType opType ) {
FocusPoint focusPoint = FocusPoint . create ( ID , opType . toText ( ) , SOURCE ) ;
focusPoint . setTitle ( TITLE ) ;
MetricRegistry . getMetric ( ) . submit ( focusPoint ) ;
}
}
}
}