@ -24,6 +24,7 @@ import com.fr.design.mainframe.share.util.ShareUIUtils;
import com.fr.design.utils.gui.GUICoreUtils ;
import com.fr.form.share.DefaultSharableWidget ;
import com.fr.form.share.SharableWidgetProvider ;
import com.fr.form.share.bean.OnlineShareWidget ;
import com.fr.form.share.constants.ShareComponentConstants ;
import com.fr.form.share.Group ;
import com.fr.form.share.record.ShareWidgetInfoManager ;
@ -32,12 +33,14 @@ import com.fr.form.ui.Widget;
import com.fr.general.ComparatorUtils ;
import com.fr.general.IOUtils ;
import com.fr.stable.Constants ;
import com.fr.stable.StringUtils ;
import org.jetbrains.annotations.NotNull ;
import org.jetbrains.annotations.Nullable ;
import javax.swing.Action ;
import javax.swing.Icon ;
import javax.swing.JPanel ;
import javax.swing.JPopupMenu ;
import java.awt.BorderLayout ;
import java.awt.Color ;
import java.awt.Cursor ;
@ -135,12 +138,8 @@ public class LocalWidgetBlock extends PreviewWidgetBlock<DefaultSharableWidget>
super . mouseClicked ( e ) ;
if ( e . getButton ( ) = = MouseEvent . BUTTON3 & & ! isEdit ) {
this . parentPane . hidePreviewPane ( ) ;
UIPopupMenu popupMenu = new UIPopupMenu ( ) ;
popupMenu . setOnlyText ( true ) ;
popupMenu . setBackground ( UIConstants . DEFAULT_BG_RULER ) ;
popupMenu . add ( new PopupMenuItem ( new MoveGroupAction ( ) ) ) ;
popupMenu . add ( new PopupMenuItem ( new RemoveAction ( ) ) ) ;
GUICoreUtils . showPopupMenu ( popupMenu , this , e . getX ( ) , e . getY ( ) ) ;
JPopupMenu rightClickPopupMenu = getRightClickPopupMenu ( ) ;
GUICoreUtils . showPopupMenu ( rightClickPopupMenu , this , e . getX ( ) , e . getY ( ) ) ;
}
}
@ -271,6 +270,18 @@ public class LocalWidgetBlock extends PreviewWidgetBlock<DefaultSharableWidget>
return ! WidgetSelectedManager . getInstance ( ) . isSelectEmpty ( ) ;
}
@Override
public JPopupMenu createRightClickPopupMenu ( ) {
UIPopupMenu popupMenu = new UIPopupMenu ( ) ;
popupMenu . setOnlyText ( true ) ;
popupMenu . setBackground ( UIConstants . DEFAULT_BG_RULER ) ;
popupMenu . add ( new PopupMenuItem ( new MoveGroupAction ( ) ) ) ;
popupMenu . add ( new PopupMenuItem ( new RemoveAction ( ) ) ) ;
return popupMenu ;
}
private class MoveGroupAction extends UpdateAction {
public MoveGroupAction ( ) {
this . putValue ( Action . SMALL_ICON , null ) ;