Class Utils
- java.lang.Object
-
- com.biglybt.ui.swt.Utils
-
public class Utils extends java.lang.Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
Utils.ColorButton
static class
Utils.SashWrapper
static class
Utils.SashWrapper2
private static class
Utils.ShellMetricsResizeListener
private static class
Utils.TruncatedTextResult
-
Field Summary
Fields Modifier and Type Field Description private static java.util.regex.Pattern
a_pattern
(package private) static java.util.concurrent.ConcurrentLinkedQueue<java.lang.Object[]>
async_exec_q
(package private) static java.lang.Runnable
async_runner
(package private) static java.util.concurrent.atomic.AtomicInteger
async_seq
private static boolean
browser_install_active_for_url
static int
BUTTON_MARGIN
static int
BUTTON_MINWIDTH
private static ParameterListener
configUIListener
private static ParameterListener
configUserModeListener
private static boolean
dark_misc_things
private static boolean
DEBUG_SWTEXEC
Debug/Diagnose SWT exec calls.private static AEDiagnosticsLogger
diag_logger
private static org.eclipse.swt.widgets.Display
display
private static int
dragDetectMask
static org.eclipse.swt.graphics.Rectangle
EMPTY_RECT
private static AEDiagnosticsEvidenceGenerator
evidenceGenerator
private static AsyncDispatcher
ext_url_dispatcher
static java.lang.String
GOOD_STRING
(package private) static boolean
hasDPIUtils
private static java.util.regex.Pattern
href_pattern
private static boolean
i2p_install_active_for_url
private static org.eclipse.swt.graphics.Image
icon128
(package private) static java.lang.Boolean
is_dark_appearance
private static boolean
isAZ2
private static boolean
isAZ3
static boolean
isGTK
static boolean
isGTK3
static boolean
LAST_TABLECOLUMN_EXPANDS
Some platforms expand the last column to fit the remaining width of the table.private static ParameterListener
pconfigQuickViewListeners
private static java.util.Set<java.lang.String>
pending_ext_urls
private static java.util.ArrayList<java.lang.Runnable>
queue
private static java.util.Set<DiskManagerFileInfo>
quick_view_active
private static TimerEventPeriodic
quick_view_event
private static java.util.Set<java.lang.String>
qv_exts
private static int
qv_max_bytes
static java.lang.String
RELAYOUT_UP_STOP_HERE
private static org.eclipse.swt.graphics.Image[]
shellIcons
private static java.lang.String
SWT_PLATFORM
private static int
SWT_REVISION
private static int
SWT_VERSION
static boolean
TABLE_GRIDLINE_IS_ALTERNATING_COLOR
GTK already handles alternating background for tablesprivate static boolean
tb_installing
private static boolean
terminated
static java.lang.String
THREAD_NAME_OFFSWT
private static ThreadPool
tp
private static java.util.Map
truncatedTextCache
private static boolean
tt_enabled
(package private) static boolean
USE_ASYNC_EXEC_QUEUE
private static int
userMode
-
Constructor Summary
Constructors Constructor Description Utils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
addAndFireParameterListener(java.util.Map<java.lang.String,ParameterListener> mapConfigListeners, boolean requiresSWTThread, java.lang.String parameter, ParameterListener listener)
static void
addListenerAndChildren(org.eclipse.swt.widgets.Composite area, int event, org.eclipse.swt.widgets.Listener listener)
static void
addSafeMouseUpListener(org.eclipse.swt.widgets.Control control, org.eclipse.swt.widgets.Listener mouseUpListener)
static void
addSafeMouseUpListener(org.eclipse.swt.widgets.Control control, org.eclipse.swt.widgets.Listener mouseDownListener, org.eclipse.swt.widgets.Listener mouseUpListener)
static void
alternateRowBackground(org.eclipse.swt.widgets.TableItem item)
static void
alternateTableBackground(org.eclipse.swt.widgets.Table table)
static boolean
anyShellHaveStyle(int styles)
static void
beep()
static org.eclipse.swt.graphics.Image
blitImage(org.eclipse.swt.graphics.Device device, org.eclipse.swt.graphics.Image srcImage, org.eclipse.swt.graphics.Rectangle srcArea, org.eclipse.swt.graphics.Image dstImage, org.eclipse.swt.graphics.Point dstPos)
static void
centerRelativeTo(org.eclipse.swt.graphics.Rectangle target, org.eclipse.swt.graphics.Rectangle reference)
Centers the targetRectangle
relative to the reference Rectanglestatic void
centerWindowRelativeTo(org.eclipse.swt.widgets.Shell window, org.eclipse.swt.widgets.Control control)
Centers a window relative to a control.static void
centreWindow(org.eclipse.swt.widgets.Shell shell)
static void
centreWindow(org.eclipse.swt.widgets.Shell shell, boolean shrink_if_needed)
static void
clearMenu(org.eclipse.swt.widgets.Menu menu)
static int[]
colorToIntArray(org.eclipse.swt.graphics.Color color)
private static java.awt.image.BufferedImage
convertToAWT(org.eclipse.swt.graphics.ImageData data)
private static org.eclipse.swt.graphics.ImageData
convertToSWT(java.awt.image.BufferedImage bufferedImage)
static org.eclipse.swt.widgets.Button
createAlertButton(org.eclipse.swt.widgets.Composite panel, java.lang.String localizationKey)
static org.eclipse.swt.graphics.Image
createAlphaImage(org.eclipse.swt.graphics.Device device, int width, int height)
static org.eclipse.swt.graphics.Image
createAlphaImage(org.eclipse.swt.graphics.Device device, int width, int height, byte defaultAlpha)
static Utils.ColorButton
createColorButton(org.eclipse.swt.widgets.Composite composite, org.eclipse.swt.graphics.Point size, boolean isForeground, int[] existingColor, int[] defaultColor, java.util.function.Consumer<int[]> listener)
static org.eclipse.swt.widgets.Button[]
createOKCancelButtons(org.eclipse.swt.widgets.Composite panel)
static BrowserWrapper
createSafeBrowser(org.eclipse.swt.widgets.Composite parent, int style)
static org.eclipse.swt.widgets.Sash
createSash(org.eclipse.swt.widgets.Composite form, int SASH_WIDTH)
static org.eclipse.swt.widgets.Sash
createSash(org.eclipse.swt.widgets.Composite form, int SASH_WIDTH, int style)
static Utils.SashWrapper
createSashWrapper(org.eclipse.swt.widgets.Composite parent, java.lang.String config_key, int def_pct)
static Utils.SashWrapper2
createSashWrapper2(org.eclipse.swt.widgets.Composite parent, java.lang.String config_key)
static org.eclipse.swt.widgets.Composite
createScrolledComposite(org.eclipse.swt.widgets.Composite parent)
Creates a ScrollComposite that scrolls vertically and handles recalculating size.static org.eclipse.swt.widgets.Composite
createScrolledComposite(org.eclipse.swt.widgets.Composite parent, int style)
private static org.eclipse.swt.widgets.Composite
createScrolledComposite(org.eclipse.swt.widgets.Composite parent, int style, org.eclipse.swt.widgets.Control mega_parent)
static org.eclipse.swt.widgets.Composite
createScrolledComposite(org.eclipse.swt.widgets.Composite parent, org.eclipse.swt.widgets.Control mega_parent)
static org.eclipse.swt.custom.StyledText
createStyledText(org.eclipse.swt.widgets.Composite parent, int style)
static java.lang.String
createSubViewID(java.lang.String base, java.lang.String sub)
static void
dispose()
static void
disposeComposite(org.eclipse.swt.widgets.Composite composite)
static void
disposeComposite(org.eclipse.swt.widgets.Composite composite, boolean disposeSelf)
static void
disposeSWTObjects(java.lang.Object... disposeList)
static void
disposeSWTObjects(java.util.List disposeList)
Dispose of a list of SWT objectsstatic boolean
drawImage(org.eclipse.swt.graphics.GC gc, org.eclipse.swt.graphics.Image image, org.eclipse.swt.graphics.Point srcStart, org.eclipse.swt.graphics.Rectangle dstRect, org.eclipse.swt.graphics.Rectangle clipping, int hOffset, int vOffset, boolean clearArea)
static void
drawImageCenterScaleDown(org.eclipse.swt.graphics.GC gc, org.eclipse.swt.graphics.Image imgSrc, org.eclipse.swt.graphics.Rectangle area)
static void
drawResizedImage(org.eclipse.swt.graphics.GC gc, org.eclipse.swt.graphics.Image image, int srcX, int srcY, int srcWidth, int srcHeight, int destX, int destY, int destWidth, int destHeight)
static void
drawStriped(org.eclipse.swt.graphics.GC gcImg, int x, int y, int width, int height, int lineDist, int leftshift, boolean fallingLines)
Draws diagonal stripes onto the specified area of a GCprivate static void
dump(IndentWriter iw, org.eclipse.swt.widgets.Control comp, java.util.Set<java.lang.Object> done)
static void
dump(org.eclipse.swt.widgets.Control comp)
static void
editSpeedLimitHandlerConfig(SpeedLimitHandler slh)
static void
ensureDisplayUpdated(org.eclipse.swt.widgets.Display display)
static java.lang.String
escapeAccelerators(java.lang.String str)
static boolean
execSWTThread(java.lang.Runnable code)
Execute code in the Runnable object using SWT's thread.static boolean
execSWTThread(java.lang.Runnable code, boolean async)
Execute code in the Runnable object using SWT's thread.private static boolean
execSWTThread(java.lang.Runnable code, int msLater)
static boolean
execSWTThreadLater(int msLater, java.lang.Runnable code)
Schedule execution of the code in the Runnable object using SWT's thread.static java.lang.Boolean
execSWTThreadWithBool(java.lang.String ID, AERunnableBoolean code, long millis)
Runs code within the SWT thread, waits for code to complete executing, (using a semaphore), and then returns a value.static java.lang.Object
execSWTThreadWithObject(java.lang.String ID, AERunnableObject code, long millis)
Runs code within the SWT thread, waits for code to complete executing, (using a semaphore), and then returns a value.private static boolean
fallbackLaunch(java.lang.String command, java.lang.String... args)
static org.eclipse.swt.widgets.Shell
findAnyShell()
static org.eclipse.swt.widgets.Shell
findAnyShell(boolean preferMainShell)
static org.eclipse.swt.widgets.Control
findBackgroundImageControl(org.eclipse.swt.widgets.Control control)
static org.eclipse.swt.widgets.Control
findChild(org.eclipse.swt.widgets.Composite comp, int x, int y)
static org.eclipse.swt.widgets.Shell
findFirstShellWithStyle(int styles)
static org.eclipse.swt.widgets.Shell
getActiveShell()
static java.util.List<org.eclipse.swt.widgets.Control>
getAllChildren(org.eclipse.swt.widgets.Composite c)
private static void
getAllChildren(org.eclipse.swt.widgets.Control c, java.util.List<org.eclipse.swt.widgets.Control> kids)
static java.lang.String
getBaseViewID(java.lang.String id)
static java.lang.String
getCCString(java.lang.String cc)
static org.eclipse.swt.graphics.Color
getConfigColor(java.lang.String name, org.eclipse.swt.graphics.Color def)
static org.eclipse.swt.widgets.Control
getCursorControl()
Sometimes, Display.getCursorControl doesn't go deep enough..static org.eclipse.swt.widgets.Control
getCursorControl(org.eclipse.swt.widgets.Composite parent, org.eclipse.swt.graphics.Point cursorLocation)
static java.util.List<org.eclipse.swt.graphics.RGB>
getCustomColors()
static int
getDeviceZoom()
static org.eclipse.swt.widgets.Display
getDisplay()
private static org.eclipse.swt.widgets.Display
getDisplay(boolean warn)
static org.eclipse.swt.widgets.Display
getDisplayIfNotDisposing()
static int
getDragDetectModifiers()
private static java.lang.String
getExplicitLauncher(java.lang.String file)
static org.eclipse.swt.layout.FormData
getFilledFormData()
static org.eclipse.swt.layout.GridData
getHSpanGridData(int hspan, int styles)
static java.lang.String
getLinkFromClipboard(org.eclipse.swt.widgets.Display display)
Gets a URL from the clipboardstatic org.eclipse.swt.graphics.Point
getLocationRelativeToShell(org.eclipse.swt.widgets.Control control)
private static org.eclipse.swt.widgets.Monitor
getMonitor(int x, int y)
Returns theMonitor
that the given x,y coordinates resides instatic org.eclipse.swt.widgets.Monitor
getMonitor(org.eclipse.swt.graphics.Point location)
Returns theMonitor
that the givenPoint
resides instatic void
getOffOfSWTThread(AERunnable runnable)
static void
getOffOfSWTThread(java.lang.Runnable runnable)
static org.eclipse.swt.graphics.Image
getResizedImage(org.eclipse.swt.graphics.Image image, int srcX, int srcY, int srcWidth, int srcHeight, int destWidth, int destHeight)
static org.eclipse.swt.layout.RowLayout
getSimpleRowLayout(boolean fill)
static java.lang.String
getSWTPlatform()
static int
getSWTRevision()
static int
getSWTVersion()
static java.lang.String
getSWTVersionAndRevision()
static int
getTableBottomIndex(org.eclipse.swt.widgets.Table table, int iTopIndex)
Bottom Index may be negative.static boolean
getTTEnabled()
static int
getUserMode()
static java.lang.String
getWidgetBGColorURLParam()
static org.eclipse.swt.layout.GridData
getWrappableLabelGridData(int hspan, int styles)
private static void
handlePluginLaunch(java.lang.String eb_choice, java.lang.String net_type, boolean use_plugins, java.lang.String sFileOriginal, java.lang.String sFileModified, boolean sync, boolean force_url, boolean force_anon)
static boolean
hasAlpha(org.eclipse.swt.graphics.Image image)
static boolean
hasShellMetricsConfig(java.lang.String sConfigPrefix)
static void
initialize(org.eclipse.swt.widgets.Display _display)
(package private) static void
initStatic()
private static boolean
installTorBrowser(java.lang.String remember_id, boolean[] install_outcome, java.lang.Runnable callback)
static boolean
isAZ2UI()
static boolean
isAZ3UI()
static boolean
isDarkAppearanceNative()
static boolean
isDarkAppearancePartial()
Hack to switch some things to dark on Windows until proper support availablestatic boolean
isDisplayDisposed()
static boolean
isInstallingTorBrowser()
static boolean
isQuickViewActive(DiskManagerFileInfo file)
static boolean
isQuickViewSupported(DiskManagerFileInfo file)
static boolean
isSWTThread()
static boolean
isThisThreadSWT()
static void
launch(DiskManagerFileInfo fileInfo)
static void
launch(java.lang.Object urlOrFile)
static void
launch(java.lang.String sFile)
static void
launch(java.lang.String sFileOriginal, boolean sync)
static void
launch(java.lang.String sFileOriginal, boolean sync, boolean force_url)
static void
launch(java.lang.String sFileOriginal, boolean sync, boolean force_url, boolean force_anon)
static void
launch(java.net.URL url)
static boolean
linkShellMetricsToConfig(org.eclipse.swt.widgets.Shell shell, java.lang.String sConfigPrefix)
static void
maintainSashPanelWidth(org.eclipse.swt.custom.SashForm sash, org.eclipse.swt.widgets.Composite comp, int[] default_weights, java.lang.String config_key)
static void
makeButtonsEqualWidth(java.util.List<org.eclipse.swt.widgets.Button> buttons)
private static java.lang.Runnable
makeRunnableSafe(java.lang.Runnable code)
static void
makeVisibleOnCursor(org.eclipse.swt.graphics.Rectangle rect)
Ensure that the givenRectangle
is fully visible on the monitor that the cursor is currently in.static void
makeVisibleOnMonitor(org.eclipse.swt.graphics.Rectangle rect, org.eclipse.swt.widgets.Monitor monitor)
Ensure that the givenRectangle
is fully visible on the givenMonitor
.private static void
quickView(DiskManagerFileInfo file)
private static void
quickViewRAR(DiskManagerFileInfo file)
static void
relayout(org.eclipse.swt.widgets.Control control)
Relayout all composites up from control until there's enough room for the control to fitstatic void
relayout(org.eclipse.swt.widgets.Control control, boolean expandOnly)
Relayout all composites up from control until there's enough room for the control to fitstatic void
relayoutUp(org.eclipse.swt.widgets.Composite c)
static void
removeParameterListeners(java.util.Map<java.lang.String,ParameterListener> mapListeners)
static org.eclipse.swt.graphics.Image
renderTransparency(org.eclipse.swt.widgets.Display display, org.eclipse.swt.graphics.Image background, org.eclipse.swt.graphics.Image foreground, org.eclipse.swt.graphics.Point foregroundOffsetOnBg, int modifyForegroundAlpha)
static void
reportError(java.lang.Throwable e)
static org.eclipse.swt.graphics.Image
resizeImage(org.eclipse.swt.graphics.Image image, int newWidth, int newHeight)
Resizes an image, using the given scaling factor.static boolean
runIfNotSWTThread(java.lang.Runnable code)
Run code on SWT Thread if we are calling from non-SWT Thread.static void
setCheckedInSetData(org.eclipse.swt.widgets.TableItem item, boolean checked)
Sets the checkbox in a Virtual Table while inside a SWT.SetData listener trigger.static void
setClipping(org.eclipse.swt.graphics.GC gc, org.eclipse.swt.graphics.Rectangle r)
static void
setConfigColor(java.lang.String name, org.eclipse.swt.graphics.Color c)
static void
setEnabled(org.eclipse.swt.widgets.Composite composite, boolean enabled)
static org.eclipse.swt.layout.GridData
setGridData(org.eclipse.swt.widgets.Composite composite, int gridStyle, org.eclipse.swt.widgets.Control ctrlBestSize, int maxHeight)
static void
setMenuItemImage(MenuItem item, java.lang.String repoKey)
static void
setMenuItemImage(org.eclipse.swt.custom.CLabel item, java.lang.String repoKey)
static void
setMenuItemImage(org.eclipse.swt.widgets.MenuItem item, java.lang.String repoKey)
Set a MenuItem's image with the given ImageRepository key.static void
setMenuItemImage(org.eclipse.swt.widgets.MenuItem item, org.eclipse.swt.graphics.Image image)
static void
setPeronalShare(java.util.Map<java.lang.String,java.lang.String> properties)
static void
setQuickViewActive(DiskManagerFileInfo file, boolean active)
static void
setShellIcon(org.eclipse.swt.widgets.Shell shell)
Sets the shell's Icon(s) to the default App icon.static void
setTerminated()
static void
setTextWithURLs(org.eclipse.swt.custom.StyledText text, java.lang.String value, boolean allow_focus)
static void
setTT(BufferedTruncatedLabel c, java.lang.String text)
static void
setTT(UISWTStatusEntry c, java.lang.String text)
static void
setTT(TrayItemDelegate c, java.lang.String text)
static void
setTT(org.eclipse.swt.custom.CTabItem c, java.lang.String text)
static void
setTT(org.eclipse.swt.widgets.Control c, java.lang.String text)
static void
setTT(org.eclipse.swt.widgets.TableColumn c, java.lang.String text)
static void
setTT(org.eclipse.swt.widgets.ToolItem c, java.lang.String text)
static void
setTT(org.eclipse.swt.widgets.TrayItem c, java.lang.String text)
static org.eclipse.swt.graphics.RGB
showColorDialog(org.eclipse.swt.widgets.Control parent, org.eclipse.swt.graphics.RGB existing)
static org.eclipse.swt.graphics.RGB
showColorDialog(org.eclipse.swt.widgets.Shell parent_shell, org.eclipse.swt.graphics.RGB existing)
static void
showText(java.lang.String title, java.lang.String message, java.util.List<java.lang.String> lines)
static java.lang.String
toColorHexString(org.eclipse.swt.graphics.Color color)
static java.lang.String
truncateText(org.eclipse.swt.graphics.GC gc, java.lang.String text, int maxWidth, boolean cache)
private static void
twoHex(java.lang.StringBuffer sb, int h)
static void
updateCustomColors(org.eclipse.swt.graphics.RGB[] new_cc)
static void
updateScrolledComposite(org.eclipse.swt.custom.ScrolledComposite sc)
protected static void
updateScrolledComposite(org.eclipse.swt.custom.ScrolledComposite sc, int style)
static boolean
verifyShellRect(org.eclipse.swt.widgets.Shell shell, boolean bAdjustIfInvalid)
private static boolean
verifyShellRect(org.eclipse.swt.widgets.Shell shell, boolean bAdjustIfInvalid, boolean reverifyOnChange)
static void
waitForModals()
Waits until modal dialogs are disposed.
-
-
-
Field Detail
-
hasDPIUtils
static final boolean hasDPIUtils
-
GOOD_STRING
public static final java.lang.String GOOD_STRING
- See Also:
- Constant Field Values
-
isGTK
public static final boolean isGTK
-
isGTK3
public static boolean isGTK3
-
LAST_TABLECOLUMN_EXPANDS
public static final boolean LAST_TABLECOLUMN_EXPANDS
Some platforms expand the last column to fit the remaining width of the table.
-
TABLE_GRIDLINE_IS_ALTERNATING_COLOR
public static final boolean TABLE_GRIDLINE_IS_ALTERNATING_COLOR
GTK already handles alternating background for tables
-
BUTTON_MARGIN
public static int BUTTON_MARGIN
-
BUTTON_MINWIDTH
public static int BUTTON_MINWIDTH
-
DEBUG_SWTEXEC
private static final boolean DEBUG_SWTEXEC
Debug/Diagnose SWT exec calls. Provides usefull information like how many we are queuing up, and how long each call takes. Good to turn on occassionally to see if we coded something stupid.
-
queue
private static java.util.ArrayList<java.lang.Runnable> queue
-
diag_logger
private static AEDiagnosticsLogger diag_logger
-
shellIcons
private static org.eclipse.swt.graphics.Image[] shellIcons
-
icon128
private static org.eclipse.swt.graphics.Image icon128
-
EMPTY_RECT
public static final org.eclipse.swt.graphics.Rectangle EMPTY_RECT
-
userMode
private static int userMode
-
isAZ2
private static boolean isAZ2
-
isAZ3
private static boolean isAZ3
-
evidenceGenerator
private static AEDiagnosticsEvidenceGenerator evidenceGenerator
-
configUserModeListener
private static ParameterListener configUserModeListener
-
configUIListener
private static ParameterListener configUIListener
-
terminated
private static boolean terminated
-
SWT_VERSION
private static final int SWT_VERSION
-
SWT_REVISION
private static final int SWT_REVISION
-
SWT_PLATFORM
private static final java.lang.String SWT_PLATFORM
-
dark_misc_things
private static volatile boolean dark_misc_things
-
display
private static org.eclipse.swt.widgets.Display display
-
quick_view_active
private static java.util.Set<DiskManagerFileInfo> quick_view_active
-
quick_view_event
private static TimerEventPeriodic quick_view_event
-
dragDetectMask
private static volatile int dragDetectMask
-
USE_ASYNC_EXEC_QUEUE
static final boolean USE_ASYNC_EXEC_QUEUE
- Since:
- 3.0.4.3
- See Also:
- Constant Field Values
-
async_seq
static java.util.concurrent.atomic.AtomicInteger async_seq
-
async_exec_q
static java.util.concurrent.ConcurrentLinkedQueue<java.lang.Object[]> async_exec_q
-
async_runner
static java.lang.Runnable async_runner
-
pending_ext_urls
private static java.util.Set<java.lang.String> pending_ext_urls
-
ext_url_dispatcher
private static AsyncDispatcher ext_url_dispatcher
-
i2p_install_active_for_url
private static boolean i2p_install_active_for_url
-
browser_install_active_for_url
private static boolean browser_install_active_for_url
-
tb_installing
private static boolean tb_installing
-
truncatedTextCache
private static java.util.Map truncatedTextCache
-
THREAD_NAME_OFFSWT
public static final java.lang.String THREAD_NAME_OFFSWT
- See Also:
- Constant Field Values
-
tp
private static ThreadPool tp
-
qv_exts
private static java.util.Set<java.lang.String> qv_exts
-
qv_max_bytes
private static int qv_max_bytes
-
pconfigQuickViewListeners
private static ParameterListener pconfigQuickViewListeners
-
RELAYOUT_UP_STOP_HERE
public static final java.lang.String RELAYOUT_UP_STOP_HERE
- See Also:
- Constant Field Values
-
tt_enabled
private static boolean tt_enabled
-
is_dark_appearance
static java.lang.Boolean is_dark_appearance
-
a_pattern
private static java.util.regex.Pattern a_pattern
-
href_pattern
private static java.util.regex.Pattern href_pattern
-
-
Method Detail
-
initStatic
static void initStatic()
-
initialize
public static void initialize(org.eclipse.swt.widgets.Display _display)
-
getDragDetectModifiers
public static int getDragDetectModifiers()
-
getSWTVersion
public static int getSWTVersion()
-
getSWTRevision
public static int getSWTRevision()
-
getSWTPlatform
public static java.lang.String getSWTPlatform()
-
getSWTVersionAndRevision
public static java.lang.String getSWTVersionAndRevision()
-
getDeviceZoom
public static int getDeviceZoom()
-
setTerminated
public static void setTerminated()
-
isAZ2UI
public static boolean isAZ2UI()
-
isAZ3UI
public static boolean isAZ3UI()
-
getUserMode
public static int getUserMode()
-
setEnabled
public static void setEnabled(org.eclipse.swt.widgets.Composite composite, boolean enabled)
-
disposeComposite
public static void disposeComposite(org.eclipse.swt.widgets.Composite composite, boolean disposeSelf)
-
disposeComposite
public static void disposeComposite(org.eclipse.swt.widgets.Composite composite)
-
disposeSWTObjects
public static void disposeSWTObjects(java.util.List disposeList)
Dispose of a list of SWT objects- Parameters:
disposeList
-
-
disposeSWTObjects
public static void disposeSWTObjects(java.lang.Object... disposeList)
-
getLinkFromClipboard
public static java.lang.String getLinkFromClipboard(org.eclipse.swt.widgets.Display display)
Gets a URL from the clipboard
The supported protocols currently are http, https and udp.
- Parameters:
display
-- Returns:
- first valid link from clipboard, else "http://"
-
centreWindow
public static void centreWindow(org.eclipse.swt.widgets.Shell shell)
-
centreWindow
public static void centreWindow(org.eclipse.swt.widgets.Shell shell, boolean shrink_if_needed)
-
centerWindowRelativeTo
public static void centerWindowRelativeTo(org.eclipse.swt.widgets.Shell window, org.eclipse.swt.widgets.Control control)
Centers a window relative to a control. That is to say, the window will be located at the center of the control.- Parameters:
window
-control
-
-
getCustomColors
public static java.util.List<org.eclipse.swt.graphics.RGB> getCustomColors()
-
updateCustomColors
public static void updateCustomColors(org.eclipse.swt.graphics.RGB[] new_cc)
-
getConfigColor
public static org.eclipse.swt.graphics.Color getConfigColor(java.lang.String name, org.eclipse.swt.graphics.Color def)
-
setConfigColor
public static void setConfigColor(java.lang.String name, org.eclipse.swt.graphics.Color c)
-
createColorButton
public static Utils.ColorButton createColorButton(org.eclipse.swt.widgets.Composite composite, org.eclipse.swt.graphics.Point size, boolean isForeground, int[] existingColor, int[] defaultColor, java.util.function.Consumer<int[]> listener)
-
showColorDialog
public static org.eclipse.swt.graphics.RGB showColorDialog(org.eclipse.swt.widgets.Control parent, org.eclipse.swt.graphics.RGB existing)
-
showColorDialog
public static org.eclipse.swt.graphics.RGB showColorDialog(org.eclipse.swt.widgets.Shell parent_shell, org.eclipse.swt.graphics.RGB existing)
-
isDisplayDisposed
public static boolean isDisplayDisposed()
-
getDisplayIfNotDisposing
public static org.eclipse.swt.widgets.Display getDisplayIfNotDisposing()
-
getSimpleRowLayout
public static org.eclipse.swt.layout.RowLayout getSimpleRowLayout(boolean fill)
-
alternateRowBackground
public static void alternateRowBackground(org.eclipse.swt.widgets.TableItem item)
-
alternateTableBackground
public static void alternateTableBackground(org.eclipse.swt.widgets.Table table)
-
setMenuItemImage
public static void setMenuItemImage(org.eclipse.swt.widgets.MenuItem item, java.lang.String repoKey)
Set a MenuItem's image with the given ImageRepository key. In compliance with platform human interface guidelines, the images are not set under Mac OS X.
- Parameters:
item
- SWT MenuItemrepoKey
- ImageRepository image key- See Also:
- Apple HIG
-
setMenuItemImage
public static void setMenuItemImage(MenuItem item, java.lang.String repoKey)
-
setMenuItemImage
public static void setMenuItemImage(org.eclipse.swt.custom.CLabel item, java.lang.String repoKey)
-
setMenuItemImage
public static void setMenuItemImage(org.eclipse.swt.widgets.MenuItem item, org.eclipse.swt.graphics.Image image)
-
setShellIcon
public static void setShellIcon(org.eclipse.swt.widgets.Shell shell)
Sets the shell's Icon(s) to the default App icon. OSX doesn't require an icon, so they are skipped- Parameters:
shell
-
-
getDisplay
public static org.eclipse.swt.widgets.Display getDisplay()
-
getDisplay
private static org.eclipse.swt.widgets.Display getDisplay(boolean warn)
-
execSWTThread
public static boolean execSWTThread(java.lang.Runnable code, boolean async)
Execute code in the Runnable object using SWT's thread. If current thread it already SWT's thread, the code will run immediately. If the current thread is not SWT's, code will be run either synchronously or asynchronously on SWT's thread at the next reasonable opportunity. This method does not catch any exceptions.- Parameters:
code
- code to runasync
- true if SWT asyncExec, false if SWT syncExec- Returns:
- success
-
execSWTThreadLater
public static boolean execSWTThreadLater(int msLater, java.lang.Runnable code)
Schedule execution of the code in the Runnable object using SWT's thread. Even if the current thread is the SWT Thread, the code will be scheduled.Much like Display.asyncExec, except getting the display is handled for you, and provides the ability to diagnose and monitor scheduled code run.
- Parameters:
msLater
- time to wait before running code on SWT thread. 0 does not mean immediate, but as soon as possible.code
- Code to run- Returns:
- sucess
- Since:
- 3.0.4.3
-
isSWTThread
public static boolean isSWTThread()
-
execSWTThread
private static boolean execSWTThread(java.lang.Runnable code, int msLater)
-
makeRunnableSafe
private static java.lang.Runnable makeRunnableSafe(java.lang.Runnable code)
-
execSWTThread
public static boolean execSWTThread(java.lang.Runnable code)
Execute code in the Runnable object using SWT's thread. If current thread it already SWT's thread, the code will run immediately. If the current thread is not SWT's, code will be run asynchronously on SWT's thread at the next reasonable opportunity. This method does not catch any exceptions.- Parameters:
code
- code to run- Returns:
- success
-
isThisThreadSWT
public static boolean isThisThreadSWT()
-
getTableBottomIndex
public static int getTableBottomIndex(org.eclipse.swt.widgets.Table table, int iTopIndex)
Bottom Index may be negative. Returns bottom index even if invisible.Used by rssfeed
-
launch
public static void launch(DiskManagerFileInfo fileInfo)
-
launch
public static void launch(java.net.URL url)
-
launch
public static void launch(java.lang.Object urlOrFile)
-
launch
public static void launch(java.lang.String sFile)
-
launch
public static void launch(java.lang.String sFileOriginal, boolean sync)
-
launch
public static void launch(java.lang.String sFileOriginal, boolean sync, boolean force_url)
-
launch
public static void launch(java.lang.String sFileOriginal, boolean sync, boolean force_url, boolean force_anon)
-
fallbackLaunch
private static boolean fallbackLaunch(java.lang.String command, java.lang.String... args)
-
handlePluginLaunch
private static void handlePluginLaunch(java.lang.String eb_choice, java.lang.String net_type, boolean use_plugins, java.lang.String sFileOriginal, java.lang.String sFileModified, boolean sync, boolean force_url, boolean force_anon)
-
isInstallingTorBrowser
public static boolean isInstallingTorBrowser()
-
installTorBrowser
private static boolean installTorBrowser(java.lang.String remember_id, boolean[] install_outcome, java.lang.Runnable callback)
-
getExplicitLauncher
private static java.lang.String getExplicitLauncher(java.lang.String file)
-
setCheckedInSetData
public static void setCheckedInSetData(org.eclipse.swt.widgets.TableItem item, boolean checked)
Sets the checkbox in a Virtual Table while inside a SWT.SetData listener trigger. SWT 3.1 has an OSX bug that needs working around.- Parameters:
item
-checked
-
-
linkShellMetricsToConfig
public static boolean linkShellMetricsToConfig(org.eclipse.swt.widgets.Shell shell, java.lang.String sConfigPrefix)
-
hasShellMetricsConfig
public static boolean hasShellMetricsConfig(java.lang.String sConfigPrefix)
-
setGridData
public static org.eclipse.swt.layout.GridData setGridData(org.eclipse.swt.widgets.Composite composite, int gridStyle, org.eclipse.swt.widgets.Control ctrlBestSize, int maxHeight)
-
getFilledFormData
public static org.eclipse.swt.layout.FormData getFilledFormData()
-
drawImageCenterScaleDown
public static void drawImageCenterScaleDown(org.eclipse.swt.graphics.GC gc, org.eclipse.swt.graphics.Image imgSrc, org.eclipse.swt.graphics.Rectangle area)
-
hasAlpha
public static boolean hasAlpha(org.eclipse.swt.graphics.Image image)
-
drawResizedImage
public static void drawResizedImage(org.eclipse.swt.graphics.GC gc, org.eclipse.swt.graphics.Image image, int srcX, int srcY, int srcWidth, int srcHeight, int destX, int destY, int destWidth, int destHeight)
-
getResizedImage
public static org.eclipse.swt.graphics.Image getResizedImage(org.eclipse.swt.graphics.Image image, int srcX, int srcY, int srcWidth, int srcHeight, int destWidth, int destHeight)
-
drawImage
public static boolean drawImage(org.eclipse.swt.graphics.GC gc, org.eclipse.swt.graphics.Image image, org.eclipse.swt.graphics.Point srcStart, org.eclipse.swt.graphics.Rectangle dstRect, org.eclipse.swt.graphics.Rectangle clipping, int hOffset, int vOffset, boolean clearArea)
-
findChild
public static org.eclipse.swt.widgets.Control findChild(org.eclipse.swt.widgets.Composite comp, int x, int y)
-
dump
public static void dump(org.eclipse.swt.widgets.Control comp)
-
dump
private static void dump(IndentWriter iw, org.eclipse.swt.widgets.Control comp, java.util.Set<java.lang.Object> done)
-
addListenerAndChildren
public static void addListenerAndChildren(org.eclipse.swt.widgets.Composite area, int event, org.eclipse.swt.widgets.Listener listener)
- Parameters:
area
-event
- idlistener
-
-
getActiveShell
public static org.eclipse.swt.widgets.Shell getActiveShell()
-
findAnyShell
public static org.eclipse.swt.widgets.Shell findAnyShell()
-
findAnyShell
public static org.eclipse.swt.widgets.Shell findAnyShell(boolean preferMainShell)
-
verifyShellRect
public static boolean verifyShellRect(org.eclipse.swt.widgets.Shell shell, boolean bAdjustIfInvalid)
-
verifyShellRect
private static boolean verifyShellRect(org.eclipse.swt.widgets.Shell shell, boolean bAdjustIfInvalid, boolean reverifyOnChange)
-
relayout
public static void relayout(org.eclipse.swt.widgets.Control control)
Relayout all composites up from control until there's enough room for the control to fit- Parameters:
control
- Control that had it's sized changed and needs more room
-
relayout
public static void relayout(org.eclipse.swt.widgets.Control control, boolean expandOnly)
Relayout all composites up from control until there's enough room for the control to fit- Parameters:
control
- Control that had it's sized changed and needs more room
-
beep
public static void beep()
-
execSWTThreadWithBool
public static java.lang.Boolean execSWTThreadWithBool(java.lang.String ID, AERunnableBoolean code, long millis)
Runs code within the SWT thread, waits for code to complete executing, (using a semaphore), and then returns a value.- Parameters:
ID
- id for debugcode
- code to runmillis
- ms to timeout in- Returns:
- returns NULL if code never run
-
execSWTThreadWithObject
public static java.lang.Object execSWTThreadWithObject(java.lang.String ID, AERunnableObject code, long millis)
Runs code within the SWT thread, waits for code to complete executing, (using a semaphore), and then returns a value.- Parameters:
ID
- id for debugcode
- code to runmillis
- ms to timeout in- Returns:
-
waitForModals
public static void waitForModals()
Waits until modal dialogs are disposed. Assumes we are on SWT thread- Since:
- 3.0.1.3
-
getWrappableLabelGridData
public static org.eclipse.swt.layout.GridData getWrappableLabelGridData(int hspan, int styles)
-
getHSpanGridData
public static org.eclipse.swt.layout.GridData getHSpanGridData(int hspan, int styles)
-
createAlphaImage
public static org.eclipse.swt.graphics.Image createAlphaImage(org.eclipse.swt.graphics.Device device, int width, int height)
-
createAlphaImage
public static org.eclipse.swt.graphics.Image createAlphaImage(org.eclipse.swt.graphics.Device device, int width, int height, byte defaultAlpha)
-
blitImage
public static org.eclipse.swt.graphics.Image blitImage(org.eclipse.swt.graphics.Device device, org.eclipse.swt.graphics.Image srcImage, org.eclipse.swt.graphics.Rectangle srcArea, org.eclipse.swt.graphics.Image dstImage, org.eclipse.swt.graphics.Point dstPos)
-
drawStriped
public static void drawStriped(org.eclipse.swt.graphics.GC gcImg, int x, int y, int width, int height, int lineDist, int leftshift, boolean fallingLines)
Draws diagonal stripes onto the specified area of a GC- Parameters:
lineDist
- spacing between the individual linesleftshift
- moves the stripes to the left, useful to shift with the backgroundfallingLines
- true for top left to bottom-right lines, false otherwise
-
renderTransparency
public static org.eclipse.swt.graphics.Image renderTransparency(org.eclipse.swt.widgets.Display display, org.eclipse.swt.graphics.Image background, org.eclipse.swt.graphics.Image foreground, org.eclipse.swt.graphics.Point foregroundOffsetOnBg, int modifyForegroundAlpha)
- Parameters:
display
-background
-foreground
-foregroundOffsetOnBg
-modifyForegroundAlpha
- 0 (fully transparent) to 255 (retain current alpha)- Returns:
-
findBackgroundImageControl
public static org.eclipse.swt.widgets.Control findBackgroundImageControl(org.eclipse.swt.widgets.Control control)
-
anyShellHaveStyle
public static boolean anyShellHaveStyle(int styles)
- Returns:
- Since:
- 3.0.3.5
-
findFirstShellWithStyle
public static org.eclipse.swt.widgets.Shell findFirstShellWithStyle(int styles)
-
colorToIntArray
public static int[] colorToIntArray(org.eclipse.swt.graphics.Color color)
-
centerRelativeTo
public static void centerRelativeTo(org.eclipse.swt.graphics.Rectangle target, org.eclipse.swt.graphics.Rectangle reference)
Centers the targetRectangle
relative to the reference Rectangle- Parameters:
target
-reference
-
-
makeVisibleOnCursor
public static void makeVisibleOnCursor(org.eclipse.swt.graphics.Rectangle rect)
Ensure that the givenRectangle
is fully visible on the monitor that the cursor is currently in. This method does not resize the given Rectangle; it merely reposition it if appropriate. If the given Rectangle is taller or wider than the current monitor then it may not fit 'fully' in the monitor.We use a best-effort approach with an emphasis to have at least the top-left of the Rectangle be visible. If the given Rectangle does not fit entirely in the monitor then portion of the right and/or left may be off-screen.
This method does honor global screen elements when possible. Screen elements include the TaskBar on Windows and the Application menu on OSX, and possibly others. The re-positioned Rectangle returned will fit on the screen without overlapping (or sliding under) these screen elements.
- Parameters:
rect
-
-
makeVisibleOnMonitor
public static void makeVisibleOnMonitor(org.eclipse.swt.graphics.Rectangle rect, org.eclipse.swt.widgets.Monitor monitor)
Ensure that the givenRectangle
is fully visible on the givenMonitor
. This method does not resize the given Rectangle; it merely reposition it if appropriate. If the given Rectangle is taller or wider than the current monitor then it may not fit 'fully' in the monitor.We use a best-effort approach with an emphasis to have at least the top-left of the Rectangle be visible. If the given Rectangle does not fit entirely in the monitor then portion of the right and/or left may be off-screen.
This method does honor global screen elements when possible. Screen elements include the TaskBar on Windows and the Application menu on OSX, and possibly others. The re-positioned Rectangle returned will fit on the screen without overlapping (or sliding under) these screen elements.
- Parameters:
rect
-monitor
-
-
getMonitor
private static org.eclipse.swt.widgets.Monitor getMonitor(int x, int y)
Returns theMonitor
that the given x,y coordinates resides in- Parameters:
x
-y
-- Returns:
- the monitor if found; otherwise returns
null
-
getMonitor
public static org.eclipse.swt.widgets.Monitor getMonitor(org.eclipse.swt.graphics.Point location)
Returns theMonitor
that the givenPoint
resides in- Parameters:
location
-- Returns:
- the monitor if found; otherwise returns
null
-
makeButtonsEqualWidth
public static void makeButtonsEqualWidth(java.util.List<org.eclipse.swt.widgets.Button> buttons)
-
createOKCancelButtons
public static org.eclipse.swt.widgets.Button[] createOKCancelButtons(org.eclipse.swt.widgets.Composite panel)
-
createAlertButton
public static org.eclipse.swt.widgets.Button createAlertButton(org.eclipse.swt.widgets.Composite panel, java.lang.String localizationKey)
-
truncateText
public static java.lang.String truncateText(org.eclipse.swt.graphics.GC gc, java.lang.String text, int maxWidth, boolean cache)
-
toColorHexString
public static java.lang.String toColorHexString(org.eclipse.swt.graphics.Color color)
- Parameters:
color
-- Returns:
- Since:
- 3.1.1.1
-
twoHex
private static void twoHex(java.lang.StringBuffer sb, int h)
-
getWidgetBGColorURLParam
public static java.lang.String getWidgetBGColorURLParam()
-
reportError
public static void reportError(java.lang.Throwable e)
-
getOffOfSWTThread
public static void getOffOfSWTThread(java.lang.Runnable runnable)
-
getOffOfSWTThread
public static void getOffOfSWTThread(AERunnable runnable)
-
runIfNotSWTThread
public static boolean runIfNotSWTThread(java.lang.Runnable code)
Run code on SWT Thread if we are calling from non-SWT Thread. Otherwise, do nothing and return false Use Case:
void foo() { if (Utils.runIfNotSWTThread(this::foo)) { return; } // Do SWT Stuff }
Use Case:
void foo(Object param) { if (Utils.runIfNotSWTThread(() -> foo(param)) { return; } // Do SWT Stuff }
-
createSafeBrowser
public static BrowserWrapper createSafeBrowser(org.eclipse.swt.widgets.Composite parent, int style)
-
getLocationRelativeToShell
public static org.eclipse.swt.graphics.Point getLocationRelativeToShell(org.eclipse.swt.widgets.Control control)
-
isQuickViewSupported
public static boolean isQuickViewSupported(DiskManagerFileInfo file)
-
isQuickViewActive
public static boolean isQuickViewActive(DiskManagerFileInfo file)
-
setQuickViewActive
public static void setQuickViewActive(DiskManagerFileInfo file, boolean active)
-
quickView
private static void quickView(DiskManagerFileInfo file)
-
quickViewRAR
private static void quickViewRAR(DiskManagerFileInfo file)
-
createSash
public static org.eclipse.swt.widgets.Sash createSash(org.eclipse.swt.widgets.Composite form, int SASH_WIDTH)
-
createSash
public static org.eclipse.swt.widgets.Sash createSash(org.eclipse.swt.widgets.Composite form, int SASH_WIDTH, int style)
-
createSashWrapper
public static Utils.SashWrapper createSashWrapper(org.eclipse.swt.widgets.Composite parent, java.lang.String config_key, int def_pct)
-
createSashWrapper2
public static Utils.SashWrapper2 createSashWrapper2(org.eclipse.swt.widgets.Composite parent, java.lang.String config_key)
-
getCursorControl
public static org.eclipse.swt.widgets.Control getCursorControl()
Sometimes, Display.getCursorControl doesn't go deep enough..
-
getCursorControl
public static org.eclipse.swt.widgets.Control getCursorControl(org.eclipse.swt.widgets.Composite parent, org.eclipse.swt.graphics.Point cursorLocation)
-
relayoutUp
public static void relayoutUp(org.eclipse.swt.widgets.Composite c)
-
createScrolledComposite
public static org.eclipse.swt.widgets.Composite createScrolledComposite(org.eclipse.swt.widgets.Composite parent)
Creates a ScrollComposite that scrolls vertically and handles recalculating size.
If parent's layout isn't GridLayout, sets parent to GridLayout with 1 column.- Returns:
- a new Composite that is the main view of the ScrolledComposite. No layout for this composite has been set
-
createScrolledComposite
public static org.eclipse.swt.widgets.Composite createScrolledComposite(org.eclipse.swt.widgets.Composite parent, int style)
-
createScrolledComposite
public static org.eclipse.swt.widgets.Composite createScrolledComposite(org.eclipse.swt.widgets.Composite parent, org.eclipse.swt.widgets.Control mega_parent)
-
createScrolledComposite
private static org.eclipse.swt.widgets.Composite createScrolledComposite(org.eclipse.swt.widgets.Composite parent, int style, org.eclipse.swt.widgets.Control mega_parent)
-
updateScrolledComposite
public static void updateScrolledComposite(org.eclipse.swt.custom.ScrolledComposite sc)
-
updateScrolledComposite
protected static void updateScrolledComposite(org.eclipse.swt.custom.ScrolledComposite sc, int style)
-
maintainSashPanelWidth
public static void maintainSashPanelWidth(org.eclipse.swt.custom.SashForm sash, org.eclipse.swt.widgets.Composite comp, int[] default_weights, java.lang.String config_key)
-
setClipping
public static void setClipping(org.eclipse.swt.graphics.GC gc, org.eclipse.swt.graphics.Rectangle r)
-
addAndFireParameterListener
public static void addAndFireParameterListener(java.util.Map<java.lang.String,ParameterListener> mapConfigListeners, boolean requiresSWTThread, java.lang.String parameter, ParameterListener listener)
-
removeParameterListeners
public static void removeParameterListeners(java.util.Map<java.lang.String,ParameterListener> mapListeners)
-
ensureDisplayUpdated
public static void ensureDisplayUpdated(org.eclipse.swt.widgets.Display display)
-
setPeronalShare
public static void setPeronalShare(java.util.Map<java.lang.String,java.lang.String> properties)
-
getTTEnabled
public static boolean getTTEnabled()
-
setTT
public static void setTT(org.eclipse.swt.widgets.Control c, java.lang.String text)
-
setTT
public static void setTT(BufferedTruncatedLabel c, java.lang.String text)
-
setTT
public static void setTT(org.eclipse.swt.custom.CTabItem c, java.lang.String text)
-
setTT
public static void setTT(UISWTStatusEntry c, java.lang.String text)
-
setTT
public static void setTT(org.eclipse.swt.widgets.TableColumn c, java.lang.String text)
-
setTT
public static void setTT(org.eclipse.swt.widgets.ToolItem c, java.lang.String text)
-
setTT
public static void setTT(org.eclipse.swt.widgets.TrayItem c, java.lang.String text)
-
setTT
public static void setTT(TrayItemDelegate c, java.lang.String text)
-
dispose
public static void dispose()
-
createSubViewID
public static java.lang.String createSubViewID(java.lang.String base, java.lang.String sub)
-
getBaseViewID
public static java.lang.String getBaseViewID(java.lang.String id)
-
isDarkAppearanceNative
public static boolean isDarkAppearanceNative()
-
isDarkAppearancePartial
public static boolean isDarkAppearancePartial()
Hack to switch some things to dark on Windows until proper support available- Returns:
-
editSpeedLimitHandlerConfig
public static void editSpeedLimitHandlerConfig(SpeedLimitHandler slh)
-
showText
public static void showText(java.lang.String title, java.lang.String message, java.util.List<java.lang.String> lines)
-
setTextWithURLs
public static void setTextWithURLs(org.eclipse.swt.custom.StyledText text, java.lang.String value, boolean allow_focus)
-
escapeAccelerators
public static java.lang.String escapeAccelerators(java.lang.String str)
-
addSafeMouseUpListener
public static void addSafeMouseUpListener(org.eclipse.swt.widgets.Control control, org.eclipse.swt.widgets.Listener mouseUpListener)
-
addSafeMouseUpListener
public static void addSafeMouseUpListener(org.eclipse.swt.widgets.Control control, org.eclipse.swt.widgets.Listener mouseDownListener, org.eclipse.swt.widgets.Listener mouseUpListener)
-
createStyledText
public static org.eclipse.swt.custom.StyledText createStyledText(org.eclipse.swt.widgets.Composite parent, int style)
-
clearMenu
public static void clearMenu(org.eclipse.swt.widgets.Menu menu)
-
getAllChildren
public static java.util.List<org.eclipse.swt.widgets.Control> getAllChildren(org.eclipse.swt.widgets.Composite c)
-
getAllChildren
private static void getAllChildren(org.eclipse.swt.widgets.Control c, java.util.List<org.eclipse.swt.widgets.Control> kids)
-
getCCString
public static java.lang.String getCCString(java.lang.String cc)
-
resizeImage
public static org.eclipse.swt.graphics.Image resizeImage(org.eclipse.swt.graphics.Image image, int newWidth, int newHeight)
Resizes an image, using the given scaling factor. Constructs a new image resource, please take care of resource disposal if you no longer need the original one. This method is optimized for quality, not for speed.- Parameters:
image
- source image- Returns:
- scaled image
-
convertToAWT
private static java.awt.image.BufferedImage convertToAWT(org.eclipse.swt.graphics.ImageData data)
-
convertToSWT
private static org.eclipse.swt.graphics.ImageData convertToSWT(java.awt.image.BufferedImage bufferedImage)
-
-