id
stringlengths
36
36
text
stringlengths
1
1.25M
e66ddbec-ca81-4c2d-abd9-9cfeb45f8d39
public void setClassName(String className) { this.className = className; }
e9e8b1b6-26bd-433c-a6d3-0fee27eaf60d
public String getOperationName() { return operationName; }
8a52294f-d15d-4792-a4b6-783c458098a5
public void setOperationName(String operationName) { this.operationName = operationName; }
b2bd3940-134c-4bdd-bd9d-73c255aff28b
public long getResponseTime() { return responseTime; }
a7e5f56d-7f4f-488a-8b2f-63edcfc0a2dd
public void setResponseTime(long responseTime) { this.responseTime = responseTime; }
bec99cfb-db16-443d-9c91-b8ae144fbed6
@Override public String toString() { StringBuilder builder = new StringBuilder(); builder.append("SPMetrics [clientIp=").append(clientIp).append(", browser=").append(browser).append(", inputParams=").append(inputParams) .append(", errMsg=").append(errMsg).append(", success=").append(success).append(", className=").append(className) .append(", operationName=").append(operationName).append(", responseTime=").append(responseTime).append("]"); return builder.toString(); }
ad5ffbab-0cb6-437f-baba-f115bb3659f7
public String getName() { return name; }
117d17f3-18f5-4dcc-84e4-4d6658f37d55
public void setName(String name) { this.name = name; }
27230a9c-d57a-4b66-a39b-c06b6e7aff13
@Override public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception { System.out.println("SPSA - Pre Handle"); SPMetrics metrics = new SPMetrics(); metrics.setBrowser(request.getHeader("User-Agent")); metrics.setClientIp(request.getRemoteAddr()); metrics.setResponseTime(System.currentTimeMillis()); request.setAttribute("metrics", metrics); return super.preHandle(request, response, handler); }
7d477d5d-5a05-443b-876b-a7c1bebcca7e
@Override public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) throws Exception { System.out.println("SPSA - Post Handle:"); super.postHandle(request, response, handler, modelAndView); }
fe3a8e86-f64f-4d66-be2d-45b99c08d61a
@Override public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) throws Exception { System.out.println("SPSA - After Completion:" + ex); SPMetrics metrics = (SPMetrics)request.getAttribute("metrics"); if(ex == null){ metrics.setSuccess(true); } metrics.setResponseTime(System.currentTimeMillis() - metrics.getResponseTime()); System.out.println("metrics:"+metrics); super.afterCompletion(request, response, handler, ex); }
07973bf2-486e-4843-b75f-2d304af94bfc
public EclipseUtils() { }
da775378-c839-4d14-bc9a-2547c8997538
public void start(BundleContext context) throws Exception { super.start(context); plugin = this; }
43d9508f-8572-4687-aacb-c44d07889eaa
public void stop(BundleContext context) throws Exception { plugin = null; super.stop(context); }
840ec06c-1684-41e3-ae5c-901a5bfff812
public static EclipseUtils getDefault() { return plugin; }
bb06bc02-dd2f-4b03-bfd8-86f99e6d0331
public static void log(Throwable e) { log(new Status(IStatus.ERROR, PLUGIN_ID, IJavaStatusConstants.INTERNAL_ERROR, JavaUIMessages.JavaPlugin_internal_error, e)); }
b1347813-a1b0-4ac9-a658-7af3e441dfc0
public static void log(IStatus status) { getDefault().getLog().log(status); }
f86478b7-6e42-43cf-aae1-13e10f379e8d
public static String getLibraryPath(Plugin aPlugin) { Bundle theBundle = aPlugin.getBundle(); String pluginLoc = null; if (theBundle != null) { URL installLoc = theBundle.getEntry("/"); URL resolved = null; try { resolved = Platform.resolve(installLoc); pluginLoc = resolved.toExternalForm(); } catch (IOException e) { throw new RuntimeException(e); } } if (pluginLoc != null) { if (pluginLoc.startsWith("file:")) { try { pluginLoc = pluginLoc.replaceAll(" ", "%20"); URI theUri = new URI(pluginLoc+"/lib"); File theFile = new File(theUri); return theFile.getAbsolutePath(); } catch (URISyntaxException e) { e.printStackTrace(); } } } return null; }
9d54dd4b-4c2c-4065-852e-8ebc9f721a62
public static IFile[] findFiles(String aName, IProject aProject) { return findFiles(aName, aProject); }
0a365b40-a26c-4e27-b5a3-29ba326e9e21
public static IFile[] findSourceFiles(String aName, IJavaProject aProject) { try { IClasspathEntry[] theClasspath = aProject.getRawClasspath(); IWorkspaceRoot theRoot = ResourcesPlugin.getWorkspace().getRoot(); List<IFile> theResult = new ArrayList<IFile>(); // Inspect all source folders for (IClasspathEntry theEntry : theClasspath) { if (theEntry.getEntryKind() == IClasspathEntry.CPE_SOURCE) { IFolder theFolder = theRoot.getFolder(theEntry.getPath()); IFile theFile = theFolder.getFile(aName); if (theFile.exists()) theResult.add(theFile); } } return theResult.toArray(new IFile[theResult.size()]); } catch (JavaModelException e) { throw new RuntimeException(e); } }
21698302-2b3b-4729-8909-5f979a0f1e54
public static IFile[] findFiles(String aName, IResource[] aRoots) { try { List<IFile> theMatches = new ArrayList<IFile>(); for (IResource theResource : aRoots) { FindFileVisitor theVisitor = new FindFileVisitor(aName); theResource.accept(theVisitor, 0); theMatches.addAll(theVisitor.getMatches()); } return theMatches.toArray(new IFile[theMatches.size()]); } catch (CoreException e) { throw new RuntimeException(e); } }
cc61197c-4138-4cc3-89e5-440505b06335
public FindFileVisitor(String aName) { itsName = aName; }
09fc7c00-9a29-455e-9243-7edb7d69f13b
public boolean visit(IResourceProxy aProxy) { if (aProxy.getType() == IResource.FILE) { if (aProxy.getName().equals(itsName)) itsMatches.add((IFile) aProxy.requestResource()); return false; } else return true; }
fca8fab3-d3ee-4895-93ad-0324e9ccfe32
public List<IFile> getMatches() { return itsMatches; }
e3940cf4-5cac-4dc4-8433-cdb26dd66adc
public void launch( ILaunchConfiguration aConfiguration, String aMode, ILaunch aLaunch, IProgressMonitor aMonitor) throws CoreException { launch(aConfiguration, aMode, aLaunch, aMonitor, false); }
f8f265b1-3ee9-48c0-aac2-296e982d8a71
public void launch( ILaunchConfiguration aConfiguration, String aMode, ILaunch aLaunch, IProgressMonitor aMonitor, boolean aMonitorStarted) throws CoreException { if (aMonitor == null) aMonitor = new NullProgressMonitor(); String theTaskName = MessageFormat.format("{0}...", new String[] { aConfiguration.getName() }); //$NON-NLS-1$ if (aMonitorStarted) aMonitor.subTask(theTaskName); else aMonitor.beginTask(theTaskName, MONITOR_STEPS); // check for cancellation if (aMonitor.isCanceled()) { return; } aMonitor.subTask(LaunchingMessages.JavaLocalApplicationLaunchConfigurationDelegate_Verifying_launch_attributes____1); //$NON-NLS-1$ IVMRunner theRunner = getVMRunner(aConfiguration, aMode); File theWorkingDir = verifyWorkingDirectory(aConfiguration); String theWorkingDirName = null; if (theWorkingDir != null) { theWorkingDirName = theWorkingDir.getAbsolutePath(); } // Environment variables String[] theEnvironment = getEnvironment(aConfiguration); // Program & VM args String theProgramArgs = getProgramArguments(aConfiguration); System.out.println("Program args: "+theProgramArgs); String theVMArgs = getVMArguments(aConfiguration); System.out.println("VM args: "+theVMArgs); ExecutionArguments theExecutionArguments = new ExecutionArguments(theVMArgs, theProgramArgs); // VM-specific attributes Map theVMAttributesMap = getVMSpecificAttributesMap(aConfiguration); // Classpath String[] theClasspath = getClasspath(aConfiguration); System.out.println("Classpath: "+Arrays.asList(theClasspath)); // Create VM config VMRunnerConfiguration theRunnerConfiguration = new VMRunnerConfiguration( getMainTypeName(aConfiguration), theClasspath); theRunnerConfiguration.setProgramArguments(theExecutionArguments.getProgramArgumentsArray()); theRunnerConfiguration.setEnvironment(theEnvironment); theRunnerConfiguration.setVMArguments(theExecutionArguments.getVMArgumentsArray()); theRunnerConfiguration.setWorkingDirectory(theWorkingDirName); theRunnerConfiguration.setVMSpecificAttributesMap(theVMAttributesMap); // Bootpath theRunnerConfiguration.setBootClassPath(getBootpath(aConfiguration)); // check for cancellation if (aMonitor.isCanceled()) { return; } // stop in main prepareStopInMain(aConfiguration); // done the verification phase aMonitor.worked(1); aMonitor.subTask(LaunchingMessages.JavaLocalApplicationLaunchConfigurationDelegate_Creating_source_locator____2); //$NON-NLS-1$ // set the default source locator if required setDefaultSourceLocator(aLaunch, aConfiguration); aMonitor.worked(1); // Launch the configuration - 1 unit of work theRunner.run(theRunnerConfiguration, aLaunch, aMonitor); // check for cancellation if (aMonitor.isCanceled()) { return; } aMonitor.done(); }
351ad19e-8ae1-4054-89e2-2ac74d2e6ddc
@Override public final String[] getClasspath(ILaunchConfiguration aConfiguration) throws CoreException { String[] theClasspath = super.getClasspath(aConfiguration); Collection<String> theEntries = getAdditionalClassPathEntries(aConfiguration); if (theEntries != null && theEntries.size() > 0) { List<String> theResult = new ArrayList<String>(); for (String thePath : theClasspath) theResult.add(thePath); theResult.addAll(theEntries); return theResult.toArray(new String[0]); } else return theClasspath; }
98ccdee7-d911-453d-bcbb-5288b896d70c
@Override public final String getVMArguments(ILaunchConfiguration aConfiguration) throws CoreException { StringBuilder theArguments = new StringBuilder (super.getVMArguments(aConfiguration)); Map<String, String> theProperties = getAdditionalSystemProperties(aConfiguration); if (theProperties != null) for (Map.Entry<String, String> theEntry : theProperties.entrySet()) { theArguments.append(" -D"); theArguments.append(theEntry.getKey()); theArguments.append("=\""); theArguments.append(theEntry.getValue()); theArguments.append("\""); } List<String> theAdditionalArguments = getAdditionalVMArguments(aConfiguration); for (String theArgument : theAdditionalArguments) { theArguments.append(" \""); theArguments.append(theArgument); theArguments.append("\""); } return theArguments.toString(); }
ebc079aa-b796-4be3-ae3e-e13d233016cb
@Override public final String getProgramArguments(ILaunchConfiguration aConfiguration) throws CoreException { StringBuilder theArguments = new StringBuilder (); // Prepend additional program args. List<String> theAdditionalProgramArguments = getAdditionalPrependedProgramArguments(aConfiguration); for (String theArgument : theAdditionalProgramArguments) { theArguments.append(" "); theArguments.append(theArgument); } // Append original program args theArguments.append (super.getProgramArguments(aConfiguration)); // Append additional program args. theAdditionalProgramArguments = getAdditionalProgramArguments(aConfiguration); for (String theArgument : theAdditionalProgramArguments) { theArguments.append(" "); theArguments.append(theArgument); } return theArguments.toString(); }
923e2bf5-8b8a-4500-ae4b-47c654180490
protected Map<String, String> getAdditionalSystemProperties(ILaunchConfiguration aConfiguration) throws CoreException { return new HashMap<String, String>(); }
62a15fa0-3773-45d7-8ac5-014dbdd7ea13
protected List<String> getAdditionalVMArguments(ILaunchConfiguration aConfiguration) throws CoreException { List<String> theList = new ArrayList<String>(); List<String> theEntries = getPrependedBootClassPathEntries(aConfiguration); if (! theEntries.isEmpty()) { StringBuilder theBuilder = new StringBuilder("-Xbootclasspath/p:"); boolean theFirst = true; for (String theEntry : theEntries) { if (! theFirst) theBuilder.append(File.pathSeparatorChar); else theFirst = false; theBuilder.append(theEntry); } theList.add (theBuilder.toString()); } return theList; }
ba0cf674-46b8-4fa0-b58e-bd90d38619e0
protected List<String> getAdditionalPrependedProgramArguments(ILaunchConfiguration aConfiguration) throws CoreException { return new ArrayList<String>(); }
79845a10-8c1f-47b1-8801-0c8b4afd81e1
protected List<String> getAdditionalProgramArguments(ILaunchConfiguration aConfiguration) throws CoreException { return new ArrayList<String>(); }
b50087f9-15b8-4212-a47d-3d2d83f260ad
protected List<String> getAdditionalClassPathEntries(ILaunchConfiguration aConfiguration) throws CoreException { return new ArrayList<String>(); }
3b81cd6c-e12c-49b5-abb0-ab7e0e2342ff
protected List<String> getPrependedBootClassPathEntries(ILaunchConfiguration aConfiguration) throws CoreException { return new ArrayList<String>(); }
4b79fa1b-6dda-4276-b251-aad82d43778b
@Override public final boolean isValid(ILaunchConfiguration aLaunchConfig) { try { checkValid(aLaunchConfig); setErrorMessage(null); return true; } catch (InvalidLaunchConfiguration e) { setErrorMessage(e.getMessage()); return false; } }
f33c79af-9309-4b8e-9c17-5aa8ca0b9d04
protected void checkValid(ILaunchConfiguration aLaunchConfiguration) throws InvalidLaunchConfiguration { }
5293dc30-9559-4185-9164-d7608f49764d
protected IJavaProject getJavaProject(ILaunchConfiguration aLaunchConfig) { String projectName = EMPTY_STRING; try { projectName = aLaunchConfig.getAttribute( IJavaLaunchConfigurationConstants.ATTR_PROJECT_NAME, EMPTY_STRING); } catch (CoreException ce) { JDIDebugUIPlugin.log(ce); return null; } return getJavaModel().getJavaProject(projectName); }
78a6ed37-c575-4294-91a0-c4d590253c0e
protected IWorkspaceRoot getWorkspaceRoot() { return ResourcesPlugin.getWorkspace().getRoot(); }
492f084d-4112-4a56-af6a-d6771cc57737
protected IJavaModel getJavaModel() { return JavaCore.create(getWorkspaceRoot()); }
ed49b44a-b28f-4ac6-98a1-a0d2dd3ae556
public InvalidLaunchConfiguration(String aMessage) { super (aMessage); }
80b31a6e-0a49-4921-9499-f51cf8ed04d3
public InvalidLaunchConfiguration(Throwable aCause) { super (aCause); }
9543f32a-c37c-4ee3-8c0c-233d7b262696
public int compare(Map<String, String> aMap1, Map<String, String> aMap2) { if (aMap1.size() != aMap2.size()) return -1; for (String theKey : aMap1.keySet()) { String theValue1 = aMap1.get(theKey); String theValue2 = aMap2.get(theKey); boolean theEmpty1 = theValue1 == null || theValue1.length() == 0; boolean theEmpty2 = theValue2 == null || theValue2.length() == 0; if (theEmpty1 && theEmpty2) continue; if (theEmpty1 || theEmpty2) return -1; if (! theValue1.equals(theValue2)) return -1; } return 0; }
0ef92396-27d4-4156-bd1e-7a37e67c0791
public OptionsControl(Composite aParent, int aStyle, K... aItems) { super(aParent, aStyle); itsItems = new ArrayList<K>(); for(K theItem : aItems) itsItems.add(theItem); createControl(this); }
ceec2350-5687-4930-8bbc-a55a525dd93c
public OptionsControl(Composite aParent, int aStyle, List<K> aItems) { super(aParent, aStyle); itsItems = aItems; createControl(this); }
bd8ffbcb-40fd-4bfd-b129-f1dd292d3301
public void createControl(Composite aParent) { GridLayout theTopLayout = new GridLayout(); theTopLayout.numColumns = 1; setLayout(theTopLayout); preFill(this); // Create the argument panes itsControls = new ArrayList<AbstractItemControl<K>>(); itsControlsMap = new HashMap<K, AbstractItemControl<K>>(); itsItemsMap = new HashMap<String, K>(); for (K theItem : itsItems) { AbstractItemControl<K> theControl = createControl(this, theItem); theControl.setLayoutData(new GridData(GridData.FILL_HORIZONTAL | GridData.GRAB_HORIZONTAL)); itsControls.add(theControl); itsControlsMap.put(theItem, theControl); itsItemsMap.put(getKey(theItem), theItem); } postFill(this); Point theSize = this.computeSize(SWT.DEFAULT, SWT.DEFAULT); this.setSize(theSize); }
4a22a193-17ce-476a-bd50-9e2e53a9d041
protected void preFill(Composite aParent) { }
ee6f1de6-5b2b-44e9-bce4-e5144a134426
protected void postFill(Composite aParent) { }
c4844a05-609b-4b00-bf5e-ea5c21193b75
protected abstract String getKey(K aItem);
4c32c267-dcf7-447b-b72e-798fb7603dcf
public abstract String getCaption(K aItem);
ea88d354-91fc-444d-be45-dcb0b7d05959
public abstract String getDescription(K aItem);
1ef7eb86-caa2-4a68-a8f4-ba998a3a1425
protected abstract String getDefault(K aItem);
add0957a-68d4-40ae-89fa-8e7949eb9bf1
protected abstract AbstractItemControl<K> createControl ( Composite aParent, K aItem);
129180aa-9d9d-4fa8-b944-6e12d45f059b
public Map<String, String> getDefaults() { Map<String, String> theMap = new HashMap<String, String>(); for (K theItem : itsItems) { theMap.put(getKey(theItem), getDefault(theItem)); } return theMap; }
09269c20-9d86-41be-b320-e1d1aadb658f
public void setValues(Map<String, String> aMap) { itsUpdating = true; for(Map.Entry<K, AbstractItemControl<K>> theEntry : itsControlsMap.entrySet()) { K theItem = theEntry.getKey(); AbstractItemControl<K> theControl = theEntry.getValue(); String theValue = aMap.get(getKey(theItem)); if (theValue == null) theValue = getDefault(theItem); theControl.setValue(theValue); } itsUpdating = false; }
26bf7ac5-730b-4f6a-9880-acc1f5b56a90
public Map<String, String> getValues() { Map<String, String> theMap = new HashMap<String, String>(); for(Map.Entry<K, AbstractItemControl<K>> theEntry : itsControlsMap.entrySet()) { K theItem = theEntry.getKey(); AbstractItemControl<K> theControl = theEntry.getValue(); String theValue = theControl.getValue(); theMap.put(getKey(theItem), theValue); } return theMap; }
abaeb4a1-b350-4669-ab31-dec9b5b518b6
final void changed() { if (! itsUpdating) { contentChanged(); } }
542ffe46-25d4-4e8d-a1d9-98329027ea2b
protected void contentChanged() { }
88157bee-cf67-43b1-87b7-de6245d67da8
public IntegerControl(Composite aParent, OptionsControl<K> aOptionsTab, K aItem) { super(aParent, aOptionsTab, aItem); }
bb70c30e-0ad9-4468-b456-39b3e2c7b807
@Override protected Control createWidget() { itsText = new Text(this, SWT.BORDER); itsText.addModifyListener(this); return itsText; }
f7524e32-7693-4168-9b2b-220bec1fb998
public void modifyText(ModifyEvent aE) { changed(); }
14bab4ca-d758-467b-bea0-a677450992b5
@Override public String getValue() { String theText = itsText.getText(); if (theText.length() > 0) { try { int theInteger = Integer.parseInt(theText); return Integer.toString(theInteger); } catch (NumberFormatException e) { return null; } } else return null; }
863f9a91-19f3-4802-b6ae-c192793eca00
@Override public void setValue(String aValue) { itsText.setText(aValue != null ? aValue : ""); }
af8b52af-3118-421e-a644-5808e2910080
public TextControl(Composite aParent, OptionsControl<K> aOptionsTab, K aItem) { super(aParent, aOptionsTab, aItem); }
421c34c9-d74e-490e-a981-6c10aa9ddf71
@Override protected Control createWidget() { itsText = new Text(this, SWT.BORDER); itsText.addModifyListener(this); return itsText; }
274d0d5b-d9c1-436a-a1f2-d2e91e620cee
public void modifyText(ModifyEvent aE) { changed(); }
58bc777e-d3a3-4070-9098-be6f1c24b459
@Override public String getValue() { String theText = itsText.getText(); return theText.length() > 0 ? theText : null; }
7a379036-62cf-47f8-8a20-c8d692840ddd
@Override public void setValue(String aValue) { itsText.setText(aValue != null ? aValue : ""); }
da4b478f-db1b-4d4e-b07a-c53416883ddc
public BooleanControl(Composite aParent, OptionsControl<K> aOptionsTab, K aItem) { super(aParent, aOptionsTab, aItem); }
176122c5-b25b-4340-9fc6-9b8c3afda628
@Override protected Control createWidget() { itsCheckButton = new Button(this, SWT.CHECK); itsCheckButton.setText("enable"); itsCheckButton.addSelectionListener(this); return itsCheckButton; }
09b42773-d601-4e74-891f-2135a836bc5b
public void widgetDefaultSelected(SelectionEvent aE) { }
0451df6a-6f30-4431-82ca-a74d5edd4782
public void widgetSelected(SelectionEvent aE) { changed(); }
5b000dc0-5ed5-4a3b-82ce-6bcf166bd66b
@Override public String getValue() { return Boolean.toString(itsCheckButton.getSelection()); }
11a407fb-4aec-4521-8191-d26a6f507512
@Override public void setValue(String aValue) { Boolean theBoolean = Boolean.parseBoolean(aValue); itsCheckButton.setSelection(theBoolean != null && theBoolean.booleanValue()); }
886c6e30-23f2-4381-a2f0-ac2a9673e9b0
protected abstract OptionsControl<K> createOptionsControl(Composite aParent);
022d085a-d10a-4a4c-aff6-b75e6461a4ab
public void createControl(Composite aParent) { ScrolledComposite theScroll = new ScrolledComposite(aParent, SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER); itsOptionsControl = createOptionsControl(theScroll); theScroll.setContent(itsOptionsControl); setControl(theScroll); }
ad45956a-89ba-4514-8445-ad8d2df9db0c
protected abstract String getMapName();
c4cf31da-d7e4-4cf5-b1cd-f000616de58b
public void setDefaults(ILaunchConfigurationWorkingCopy aConfiguration) { if (itsOptionsControl != null) { saveOptionsMap(itsOptionsControl.getDefaults(), aConfiguration); } }
93345f0c-cb4e-4d34-97d3-eb7203d99496
public void initializeFrom(ILaunchConfiguration aConfiguration) { try { itsOptionsControl.setValues(loadOptionsMap(aConfiguration)); } catch (CoreException e) { EclipseUtils.log(e); } }
9ffc4954-53cd-40c6-8d7f-ad2eb04e07f6
public void performApply(ILaunchConfigurationWorkingCopy aConfiguration) { saveOptionsMap(itsOptionsControl.getValues(), aConfiguration); }
66eddea2-6389-44f4-a9c2-efdb07edf6df
private Map<String, String> loadOptionsMap(ILaunchConfiguration aConfiguration) throws CoreException { return loadOptionsMap(aConfiguration, getMapName()); }
d4ea29fc-d6ff-4419-bf8f-beadbee40b90
public static Map<String, String> loadOptionsMap( ILaunchConfiguration aConfiguration, String aMapName) throws CoreException { Map<String, String> theMap = aConfiguration.getAttribute( aMapName, (Map) null); if (theMap == null) theMap = new HashMap<String, String>(); return theMap; }
24495445-edb3-4575-a79c-80b617ca0a39
private void saveOptionsMap( Map<String, String> aMap, ILaunchConfigurationWorkingCopy aConfiguration) { aConfiguration.setAttribute(getMapName(), aMap); }
528b80d5-0d64-4451-ae85-1222a210dcdc
public AbstractItemControl(Composite aParent, OptionsControl<K> aOptionsTab, K aItem) { super(aParent, SWT.BORDER); itsItem = aItem; itsOptionsControl = aOptionsTab; GridLayout theLayout = new GridLayout(); theLayout.numColumns = 1; setLayout(theLayout); GridData theGridData; itsLabel = new Label(this, SWT.WRAP); StringBuilder theText = new StringBuilder(); theText.append(itsOptionsControl.getCaption(itsItem)); theText.append("\n"); theText.append(itsOptionsControl.getDescription(itsItem)); itsLabel.setText(theText.toString()); theGridData = new GridData(GridData.FILL, GridData.FILL, true, true); itsLabel.setLayoutData(theGridData); Control theWidget = createWidget(); theGridData = new GridData(GridData.FILL, GridData.FILL, true, true); theWidget.setLayoutData(theGridData); }
4910fb4b-1928-4e21-88ca-51706782c56f
public K getItem() { return itsItem; }
4b4c2c1e-2c68-410b-9705-b344c5bab34f
protected void changed() { itsOptionsControl.changed(); }
94733ab0-abaa-4e10-a24c-61b175424e6b
protected abstract Control createWidget();
ada1554b-e478-45ae-a4e5-7bd51151787a
public abstract String getValue();
0ee11b1f-f3ba-442f-8e73-2a15a8831de8
public abstract void setValue (String aValue);
803f6eb9-3410-45b6-aebb-797ca70f0bf5
public static void main(String[] args) { // TODO Auto-generated method stub MainFrame frame = new MainFrame(); }
4b85a955-b15e-473a-9eae-6d2b001fba6d
public Field(int size){ createCells(size); this.size = size; }
1b90f523-c695-4ac6-9e60-2ff6af29a1c9
private void createCells(int size){ /* cells = new Cell[size*size]; for(int i=0; i < cells.length; i++){ cells[i] = new Cell(i); } */ cells = new ArrayList<Cell>(); for(int i=0; i < size*size; i++){ cells.add(new Cell(i)); } }
eece183c-4a39-4b42-9c42-b78742bb37d8
public void place(Piece piece, int number){ if(number >= 0 && number < cells.size() && piece != null){ Cell cell = cells.get(number); cell.setPiece(piece); } }
41de19af-f238-4f38-b732-b4b408bc7f23
Player(int id, String name, Piece piece){ this.id = id; this.name = name; this.piece = piece; }
a64f0ddb-8b90-4436-bf95-4f6d1f0af8fd
public Piece getPiece(){ return piece; }
fbd7712a-79c5-4e69-82de-1c8b23658a21
public int getId() { return id; }
72d17a3c-9678-465d-985a-a35367cd2386
public String getName() { return name; }
54cd23ad-d43d-4ca8-86a9-ed0048213577
public void activate() { this.Active = true; }
04fcd31c-3000-4484-a945-68b6205ffac3
public void deactivate() { this.Active = false; }
77a2dc33-064c-4fd9-abbd-7b75b8d5f58f
public boolean isActive() { return Active; }