Previous CloneSet | Next CloneSet | Back to Main Report |
Clone Mass | Clones in CloneSet | Parameter Count | Clone Similarity | Syntax Category [Sequence Length] |
---|---|---|---|---|
20 | 2 | 0 | 1.000 | class_body_declarations[2] |
Clone Abstraction | Parameter Bindings |
Clone Instance (Click to see clone) | Line Count | Source Line | Source File |
---|---|---|---|
1 | 20 | 147 | plugins/org.eclipse.jdt.junit/src/org/eclipse/jdt/internal/junit/util/LayoutUtil.java |
2 | 20 | 77 | plugins/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/util/SWTUtil.java |
| ||||
/** * Returns a width hint for a button control. * @param button the button for which to set the dimension hint * @return the width hint */ public static int getButtonWidthHint(Button button) { button.setFont(JFaceResources.getDialogFont()); PixelConverter converter = new PixelConverter(button); int widthHint = converter.convertHorizontalDLUsToPixels(IDialogConstants.BUTTON_WIDTH); return Math.max(widthHint, button.computeSize(SWT.DEFAULT, SWT.DEFAULT, true).x); } /** * Sets width and height hint for the button control. * <b>Note:</b> This is a NOP if the button's layout data is not * an instance of <code>GridData</code>. * * @param button the button for which to set the dimension hint */ public static void setButtonDimensionHint(Button button) { Assert.isNotNull(button); Object gd = button.getLayoutData(); if (gd instanceof GridData) { ((GridData) gd).widthHint = getButtonWidthHint(button); ((GridData) gd).horizontalAlignment = GridData.FILL; } } |
| ||||
/** * Returns a width hint for a button control. */ public static int getButtonWidthHint(Button button) { button.setFont(JFaceResources.getDialogFont()); PixelConverter converter = new PixelConverter(button); int widthHint = converter.convertHorizontalDLUsToPixels(IDialogConstants.BUTTON_WIDTH); return Math.max(widthHint, button.computeSize(SWT.DEFAULT, SWT.DEFAULT, true).x); } /** * Sets width and height hint for the button control. * <b>Note:</b> This is a NOP if the button's layout data is not * an instance of <code>GridData</code>. * * @param button the button for which to set the dimension hint */ public static void setButtonDimensionHint(Button button) { Assert.isNotNull(button); Object gd = button.getLayoutData(); if (gd instanceof GridData) { ((GridData) gd).widthHint = getButtonWidthHint(button); ((GridData) gd).horizontalAlignment = GridData.FILL; } } |
| |||
/** * Returns a width hint for a button control. * @param button the button for which to set the dimension hint * @return the width hint */ /** * Returns a width hint for a button control. */ public static int getButtonWidthHint(Button button) { button.setFont(JFaceResources.getDialogFont()); PixelConverter converter = new PixelConverter(button); int widthHint = converter.convertHorizontalDLUsToPixels(IDialogConstants.BUTTON_WIDTH); return Math.max(widthHint, button.computeSize(SWT.DEFAULT, SWT.DEFAULT, true).x); } /** * Sets width and height hint for the button control. * <b>Note:</b> This is a NOP if the button's layout data is not * an instance of <code>GridData</code>. * * @param button the button for which to set the dimension hint */ public static void setButtonDimensionHint(Button button) { Assert.isNotNull(button); Object gd = button.getLayoutData(); if (gd instanceof GridData) { ((GridData) gd).widthHint = getButtonWidthHint(button); ((GridData) gd).horizontalAlignment = GridData.FILL; } } |
CloneAbstraction |
Parameter Index | Clone Instance | Parameter Name | Value |
---|---|---|---|
None |