1 13 package org.eclipse.compare.internal.patch; 14 15 import java.io.*; 16 17 import org.eclipse.compare.internal.*; 18 import org.eclipse.core.resources.*; 19 import org.eclipse.core.runtime.IPath; 20 import org.eclipse.core.runtime.Path; 21 import org.eclipse.jface.dialogs.*; 22 import org.eclipse.jface.dialogs.Dialog; 23 import org.eclipse.jface.viewers.*; 24 import org.eclipse.jface.wizard.IWizardPage; 25 import org.eclipse.jface.wizard.WizardPage; 26 import org.eclipse.swt.SWT; 27 import org.eclipse.swt.dnd.Clipboard; 28 import org.eclipse.swt.dnd.TextTransfer; 29 import org.eclipse.swt.events.*; 30 import org.eclipse.swt.graphics.Point; 31 import org.eclipse.swt.layout.GridData; 32 import org.eclipse.swt.layout.GridLayout; 33 import org.eclipse.swt.widgets.*; 34 import org.eclipse.ui.PlatformUI; 35 import org.eclipse.ui.model.WorkbenchContentProvider; 36 import org.eclipse.ui.model.WorkbenchLabelProvider; 37 import org.eclipse.ui.views.navigator.ResourceComparator; 38 39 import com.ibm.icu.text.MessageFormat; 40 41 class InputPatchPage extends WizardPage { 42 43 protected static final int SIZING_TEXT_FIELD_WIDTH= 250; 45 protected static final int COMBO_HISTORY_LENGTH= 5; 46 47 private final static String PAGE_NAME= "PatchWizardPage1"; private final static String STORE_PATCH_FILES_ID= PAGE_NAME+".PATCH_FILES"; private final static String STORE_INPUT_METHOD_ID= PAGE_NAME+".INPUT_METHOD"; private final static String STORE_WORKSPACE_PATH_ID= PAGE_NAME+".WORKSPACE_PATH"; 53 protected final static int CLIPBOARD= 1; 55 protected final static int FILE= 2; 56 protected final static int WORKSPACE= 3; 57 58 protected final static String INPUTPATCHPAGE_NAME= "InputPatchPage"; 60 static final char SEPARATOR= System.getProperty("file.separator").charAt(0); 62 private boolean fShowError= false; 63 private String fPatchSource; 64 private boolean fPatchRead= false; 65 private PatchWizard fPatchWizard; 66 private ActivationListener fActivationListener= new ActivationListener(); 67 68 private Button fUseClipboardButton; 70 private Combo fPatchFileNameField; 71 private Button fPatchFileBrowseButton; 72 private Button fUsePatchFileButton; 73 private Button fUseWorkspaceButton; 74 private Label fWorkspaceSelectLabel; 75 private TreeViewer fTreeViewer; 76 77 class ActivationListener extends ShellAdapter { 78 public void shellActivated(ShellEvent e) { 79 fShowError=true; 81 switch(getInputMethod()) { 82 case FILE: 83 fShowError= (fPatchFileNameField.getText() != ""); break; 85 86 case WORKSPACE: 87 fShowError= (!fTreeViewer.getSelection().isEmpty()); 88 break; 89 } 90 updateWidgetEnablements(); 91 } 92 } 93 94 InputPatchPage(PatchWizard pw) { 95 super(INPUTPATCHPAGE_NAME, PatchMessages.InputPatchPage_title, null); 96 fPatchWizard= pw; 97 setMessage(PatchMessages.InputPatchPage_message); 98 } 99 100 104 protected IPath getPathFromText(Text textField) { 105 return (new Path(textField.getText())).makeAbsolute(); 106 } 107 108 String getPatchName() { 109 if (getInputMethod() == CLIPBOARD) 110 return PatchMessages.InputPatchPage_Clipboard; 111 return getPatchFilePath(); 112 } 113 114 public void createControl(Composite parent) { 115 116 Composite composite= new Composite(parent, SWT.NULL); 117 composite.setLayout(new GridLayout()); 118 composite.setLayoutData(new GridData(GridData.VERTICAL_ALIGN_FILL | GridData.HORIZONTAL_ALIGN_FILL)); 119 setControl(composite); 120 121 initializeDialogUnits(parent); 122 123 buildPatchFileGroup(composite); 124 125 restoreWidgetValues(); 128 129 adjustToCurrentTarget(); 132 133 fShowError= false; 135 clearErrorMessage(); 136 updateWidgetEnablements(); 137 138 Shell shell= getShell(); 139 shell.addShellListener(fActivationListener); 140 141 Dialog.applyDialogFont(composite); 142 PlatformUI.getWorkbench().getHelpSystem().setHelp(composite, ICompareContextIds.PATCH_INPUT_WIZARD_PAGE); 143 } 144 145 152 public IWizardPage getNextPage() { 153 154 WorkspacePatcher patcher= ((PatchWizard) getWizard()).getPatcher(); 155 156 readInPatch(); 158 159 FileDiff[] diffs= patcher.getDiffs(); 160 if (diffs == null || diffs.length == 0) { 161 String format= PatchMessages.InputPatchPage_NoDiffsFound_format; 162 String message= MessageFormat.format(format, new String [] { fPatchSource }); 163 MessageDialog.openInformation(null, 164 PatchMessages.InputPatchPage_PatchErrorDialog_title, message); 165 return this; 166 } 167 168 int guess= 0; patcher.setStripPrefixSegments(guess); 171 172 if (patcher.isWorkspacePatch()) { 176 return fPatchWizard.getPage(PreviewPatchPage2.PREVIEWPATCHPAGE_NAME); 177 } 178 179 return super.getNextPage(); 180 } 181 182 185 public void readInPatch(){ 186 WorkspacePatcher patcher= ((PatchWizard) getWizard()).getPatcher(); 187 Reader reader= null; 189 try { 190 int inputMethod= getInputMethod(); 191 if (inputMethod == CLIPBOARD) { 192 Control c= getControl(); 193 if (c != null) { 194 Clipboard clipboard= new Clipboard(c.getDisplay()); 195 Object o= clipboard.getContents(TextTransfer.getInstance()); 196 clipboard.dispose(); 197 if (o instanceof String ) 198 reader= new StringReader((String )o); 199 } 200 fPatchSource= PatchMessages.InputPatchPage_Clipboard_title; 201 } else if (inputMethod==FILE) { 202 String patchFilePath= getPatchFilePath(); 203 if (patchFilePath != null) { 204 try { 205 reader= new FileReader(patchFilePath); 206 } catch (FileNotFoundException ex) { 207 MessageDialog.openError(null, 208 PatchMessages.InputPatchPage_PatchErrorDialog_title, 209 PatchMessages.InputPatchPage_PatchFileNotFound_message); 210 } 211 } 212 fPatchSource= PatchMessages.InputPatchPage_PatchFile_title; 213 } else if (inputMethod==WORKSPACE) { 214 IResource[] resources= Utilities.getResources(fTreeViewer.getSelection()); 216 IResource patchFile= resources[0]; 217 if (patchFile != null) { 218 try { 219 reader= new FileReader(patchFile.getRawLocation().toFile()); 220 } catch (FileNotFoundException ex) { 221 MessageDialog.openError(null, PatchMessages.InputPatchPage_PatchErrorDialog_title, PatchMessages.InputPatchPage_PatchFileNotFound_message); 222 } catch (NullPointerException nex) { 223 MessageDialog.openError(null, PatchMessages.InputPatchPage_PatchErrorDialog_title, PatchMessages.InputPatchPage_PatchFileNotFound_message); 225 } 226 } 227 fPatchSource= PatchMessages.InputPatchPage_WorkspacePatch_title; 228 } 229 230 if (reader != null) { 232 try { 233 patcher.parse(new BufferedReader(reader)); 234 fPatchWizard.patchReadIn(); 236 fPatchRead=true; 237 } catch (Exception ex) { 238 } 240 } 241 } finally { 242 if (reader != null) { 243 try { 244 reader.close(); 245 } catch (IOException x) { 246 } 248 } 249 } 250 } 251 252 255 public boolean canFlipToNextPage() { 256 return isPageComplete(); 259 } 260 261 private void setEnablePatchFile(boolean enable) { 262 fPatchFileNameField.setEnabled(enable); 263 fPatchFileBrowseButton.setEnabled(enable); 264 } 265 266 private void setEnableWorkspacePatch(boolean enable) { 267 fWorkspaceSelectLabel.setEnabled(enable); 268 fTreeViewer.getTree().setEnabled(enable); 269 } 270 271 274 private void buildPatchFileGroup(Composite parent) { 275 276 final Composite composite= new Composite(parent, SWT.NULL); 277 GridLayout gridLayout= new GridLayout(); 278 gridLayout.numColumns= 3; 279 composite.setLayout(gridLayout); 280 composite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); 281 282 GridData gd= new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING); 284 gd.horizontalSpan= 3; 285 fUseClipboardButton= new Button(composite, SWT.RADIO); 286 fUseClipboardButton.setText(PatchMessages.InputPatchPage_UseClipboardButton_text); 287 fUseClipboardButton.setLayoutData(gd); 288 289 fUsePatchFileButton= new Button(composite, SWT.RADIO); 291 fUsePatchFileButton.setText(PatchMessages.InputPatchPage_FileButton_text); 292 293 fPatchFileNameField= new Combo(composite, SWT.BORDER); 294 gd= new GridData(GridData.FILL_HORIZONTAL); 295 gd.widthHint= SIZING_TEXT_FIELD_WIDTH; 296 fPatchFileNameField.setLayoutData(gd); 297 298 fPatchFileBrowseButton= new Button(composite, SWT.PUSH); 299 fPatchFileBrowseButton.setText(PatchMessages.InputPatchPage_ChooseFileButton_text); 300 GridData data= new GridData(GridData.HORIZONTAL_ALIGN_FILL); 301 int widthHint= convertHorizontalDLUsToPixels(IDialogConstants.BUTTON_WIDTH); 302 Point minSize= fPatchFileBrowseButton.computeSize(SWT.DEFAULT, SWT.DEFAULT, true); 303 data.widthHint= Math.max(widthHint, minSize.x); 304 fPatchFileBrowseButton.setLayoutData(data); 305 306 fUseWorkspaceButton= new Button(composite, SWT.RADIO); 308 fUseWorkspaceButton.setText(PatchMessages.InputPatchPage_UseWorkspaceButton_text); 309 gd= new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING); 310 fUseWorkspaceButton.setLayoutData(gd); 311 312 addWorkspaceControls(parent); 313 314 fUseClipboardButton.addSelectionListener(new SelectionAdapter() { 316 public void widgetSelected(SelectionEvent e) { 317 if (!fUseClipboardButton.getSelection()) 318 return; 319 320 clearErrorMessage(); 321 fShowError= true; 322 int state= getInputMethod(); 323 setEnablePatchFile(state == FILE); 324 setEnableWorkspacePatch(state == WORKSPACE); 325 updateWidgetEnablements(); 326 } 327 }); 328 329 fUsePatchFileButton.addSelectionListener(new SelectionAdapter() { 330 public void widgetSelected(SelectionEvent e) { 331 if (!fUsePatchFileButton.getSelection()) 332 return; 333 clearErrorMessage(); 335 fShowError= (fPatchFileNameField.getText() != ""); int state= getInputMethod(); 337 setEnablePatchFile(state==FILE); 338 setEnableWorkspacePatch(state==WORKSPACE); 339 updateWidgetEnablements(); 340 } 341 }); 342 fPatchFileNameField.addSelectionListener(new SelectionAdapter() { 343 public void widgetSelected(SelectionEvent e) { 344 updateWidgetEnablements(); 345 } 346 }); 347 fPatchFileNameField.addModifyListener(new ModifyListener() { 348 public void modifyText(ModifyEvent e) { 349 clearErrorMessage(); 350 fShowError= true; 351 updateWidgetEnablements(); 352 } 353 }); 354 fPatchFileBrowseButton.addSelectionListener(new SelectionAdapter() { 355 public void widgetSelected(SelectionEvent e) { 356 clearErrorMessage(); 357 fShowError= true; 358 handlePatchFileBrowseButtonPressed(); 359 updateWidgetEnablements(); 360 } 361 }); 362 fUseWorkspaceButton.addSelectionListener(new SelectionAdapter() { 363 public void widgetSelected(SelectionEvent e) { 364 if (!fUseWorkspaceButton.getSelection()) 365 return; 366 clearErrorMessage(); 367 fShowError= (!fTreeViewer.getSelection().isEmpty()); 369 int state= getInputMethod(); 370 setEnablePatchFile(state == FILE); 371 setEnableWorkspacePatch(state == WORKSPACE); 372 updateWidgetEnablements(); 373 } 374 }); 375 376 fTreeViewer.addSelectionChangedListener(new ISelectionChangedListener() { 377 public void selectionChanged(SelectionChangedEvent event) { 378 clearErrorMessage(); 379 updateWidgetEnablements(); 380 } 381 }); 382 383 fTreeViewer.addDoubleClickListener(new IDoubleClickListener() { 384 public void doubleClick(DoubleClickEvent event) { 385 ISelection selection= event.getSelection(); 386 if (selection instanceof TreeSelection) { 387 TreeSelection treeSel= (TreeSelection) selection; 388 Object res= treeSel.getFirstElement(); 389 if (res != null) { 390 if (res instanceof IProject || res instanceof IFolder) { 391 if (fTreeViewer.getExpandedState(res)) 392 fTreeViewer.collapseToLevel(res, 1); 393 else 394 fTreeViewer.expandToLevel(res, 1); 395 } else if (res instanceof IFile) 396 fPatchWizard.showPage(getNextPage()); 397 } 398 } 399 } 400 }); 401 } 402 403 private void addWorkspaceControls(Composite composite) { 404 405 Composite newComp= new Composite(composite, SWT.NONE); 406 GridLayout layout= new GridLayout(1, false); 407 layout.marginLeft= 16; newComp.setLayout(layout); 409 newComp.setLayoutData(new GridData(GridData.FILL_BOTH)); 410 411 fWorkspaceSelectLabel= new Label(newComp, SWT.LEFT); 412 fWorkspaceSelectLabel.setText(PatchMessages.InputPatchPage_WorkspaceSelectPatch_text); 413 414 fTreeViewer= new TreeViewer(newComp, SWT.BORDER); 415 fTreeViewer.getTree().setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); 416 417 fTreeViewer.setLabelProvider(new WorkbenchLabelProvider()); 418 fTreeViewer.setContentProvider(new WorkbenchContentProvider()); 419 fTreeViewer.setComparator(new ResourceComparator(ResourceComparator.NAME)); 420 fTreeViewer.setInput(ResourcesPlugin.getWorkspace().getRoot()); 421 } 422 423 424 427 private void updateWidgetEnablements() { 428 429 String error= null; 430 431 boolean gotPatch= false; 432 int inputMethod= getInputMethod(); 433 if (inputMethod==CLIPBOARD) { 434 Control c= getControl(); 435 if (c != null) { 436 Clipboard clipboard= new Clipboard(c.getDisplay()); 437 Object o= clipboard.getContents(TextTransfer.getInstance()); 438 clipboard.dispose(); 439 if (o instanceof String ) { 440 String s= ((String ) o).trim(); 441 if (s.length() > 0) 442 gotPatch= true; 443 else 444 error= PatchMessages.InputPatchPage_ClipboardIsEmpty_message; 445 } else 446 error= PatchMessages.InputPatchPage_NoTextInClipboard_message; 447 } else 448 error= PatchMessages.InputPatchPage_CouldNotReadClipboard_message; 449 } else if (inputMethod==FILE) { 450 String path= fPatchFileNameField.getText(); 451 if (path != null && path.length() > 0) { 452 File file= new File(path); 453 gotPatch= file.exists() && file.isFile() && file.length() > 0; 454 if (!gotPatch) 455 error= PatchMessages.InputPatchPage_CannotLocatePatch_message + path; 456 } else { 457 error= PatchMessages.InputPatchPage_NoFileName_message; 458 } 459 } else if (inputMethod == WORKSPACE) { 460 IResource[] resources= Utilities.getResources(fTreeViewer.getSelection()); 462 if (resources != null && resources.length > 0) { 463 IResource patchFile= resources[0]; 464 if (patchFile != null && patchFile.getType() == IResource.FILE) { 465 File actualFile= patchFile.getRawLocation().toFile(); 466 gotPatch= actualFile.exists()&&actualFile.isFile()&&actualFile.length() > 0; 467 if (!gotPatch) 468 error= PatchMessages.InputPatchPage_FileSelectedNotPatch_message; 469 } 470 } else { 471 error= PatchMessages.InputPatchPage_NoFileName_message; 472 } 473 } 474 475 setPageComplete(gotPatch); 476 477 if (fShowError) 478 setErrorMessage(error); 479 } 480 481 protected void handlePatchFileBrowseButtonPressed() { 482 FileDialog dialog= new FileDialog(getShell(), SWT.NONE); 483 dialog.setText(PatchMessages.InputPatchPage_SelectPatchFileDialog_title); 484 String patchFilePath= getPatchFilePath(); 485 if (patchFilePath != null) { 486 int lastSegment= patchFilePath.lastIndexOf(SEPARATOR); 487 if (lastSegment > 0) { 488 patchFilePath= patchFilePath.substring(0, lastSegment); 489 } 490 } 491 dialog.setFilterPath(patchFilePath); 492 String res= dialog.open(); 493 if (res == null) 494 return; 495 496 patchFilePath= dialog.getFileName(); 497 IPath filterPath= new Path(dialog.getFilterPath()); 498 IPath path= filterPath.append(patchFilePath).makeAbsolute(); 499 patchFilePath= path.toOSString(); 500 502 fPatchFileNameField.setText(patchFilePath); 503 } 505 506 513 protected void setSourceName(String path) { 514 515 if (path.length() > 0) { 516 517 String [] currentItems= fPatchFileNameField.getItems(); 518 int selectionIndex= -1; 519 for (int i= 0; i < currentItems.length; i++) 520 if (currentItems[i].equals(path)) 521 selectionIndex= i; 522 523 if (selectionIndex < 0) { int oldLength= currentItems.length; 525 String [] newItems= new String [oldLength + 1]; 526 System.arraycopy(currentItems, 0, newItems, 0, oldLength); 527 newItems[oldLength]= path; 528 fPatchFileNameField.setItems(newItems); 529 selectionIndex= oldLength; 530 } 531 fPatchFileNameField.select(selectionIndex); 532 533 } 535 } 536 537 544 public boolean finish() { 545 548 saveWidgetValues(); 549 550 568 return true; 569 } 570 571 575 private void restoreWidgetValues() { 576 577 int inputMethod= FILE; 578 579 IDialogSettings settings= getDialogSettings(); 580 if (settings != null) { 581 582 try { 583 inputMethod= settings.getInt(STORE_INPUT_METHOD_ID); 584 } catch (NumberFormatException ex) { 585 } 587 588 String [] sourceNames= settings.getArray(STORE_PATCH_FILES_ID); 590 if (sourceNames != null) 591 for (int i= 0; i < sourceNames.length; i++) 592 if (sourceNames[i] != null && sourceNames[i].length() > 0) 593 fPatchFileNameField.add(sourceNames[i]); 594 595 String patchFilePath= settings.get(STORE_PATCH_FILES_ID); 597 if (patchFilePath != null) 598 setSourceName(patchFilePath); 599 600 if (inputMethod == CLIPBOARD){ 605 inputMethod= FILE; 606 fPatchFileNameField.deselectAll(); 607 } 608 609 String workspaceSetting= settings.get(STORE_WORKSPACE_PATH_ID); 611 if (workspaceSetting != null && workspaceSetting.length() > 0) { 612 try { 614 IPath path= new Path(workspaceSetting); 615 IFile targetFile= ResourcesPlugin.getWorkspace().getRoot().getFile(path); 616 if (fTreeViewer != null && targetFile.exists()){ 617 fTreeViewer.expandToLevel(targetFile, 0); 618 fTreeViewer.setSelection(new StructuredSelection(targetFile)); 619 } 620 } catch (RuntimeException e) { 621 } 623 } else { 624 if (inputMethod == WORKSPACE) 628 inputMethod= FILE; 629 } 630 } 631 632 setInputButtonState(inputMethod); 634 } 635 636 640 void saveWidgetValues() { 641 IDialogSettings settings= getDialogSettings(); 642 if (settings != null) { 643 644 settings.put(STORE_INPUT_METHOD_ID, getInputMethod()); 645 settings.put(STORE_PATCH_FILES_ID, getPatchFilePath()); 646 647 String [] sourceNames= settings.getArray(STORE_PATCH_FILES_ID); 649 if (sourceNames == null) 650 sourceNames= new String [0]; 651 652 sourceNames= addToHistory(sourceNames, getPatchFilePath()); 653 settings.put(STORE_PATCH_FILES_ID, sourceNames); 654 655 settings.put(STORE_WORKSPACE_PATH_ID, getWorkspacePath()); 657 658 } 659 } 660 661 private String getWorkspacePath() { 662 if (fTreeViewer != null){ 663 IResource[] resources= Utilities.getResources(fTreeViewer.getSelection()); 664 if (resources.length > 0) { 665 IResource patchFile= resources[0]; 666 return patchFile.getFullPath().toString(); 667 } 668 669 } 670 return ""; } 672 673 675 681 private boolean adjustToCurrentTarget() { 682 IResource patchTarget= fPatchWizard.getTarget(); 685 if (patchTarget instanceof IFile) { 686 Reader reader= null; 687 try { 688 try { 689 reader= new FileReader(patchTarget.getRawLocation().toFile()); 690 if (isPatchFile(reader)) { 691 setInputButtonState(WORKSPACE); 693 if (fTreeViewer != null && patchTarget.exists()) { 694 fTreeViewer.expandToLevel(patchTarget, 0); 695 fTreeViewer.setSelection(new StructuredSelection(patchTarget)); 696 } 697 return true; 698 } 699 } catch (FileNotFoundException ex) { 700 } catch (NullPointerException nex) { 702 } 704 705 } finally { 706 if (reader != null) { 707 try { 708 reader.close(); 709 } catch (IOException x) { 710 } 712 } 713 } 714 } 715 Reader reader = null; 717 Control c = getControl(); 718 if (c != null) { 719 Clipboard clipboard = new Clipboard(c.getDisplay()); 720 Object o = clipboard.getContents(TextTransfer.getInstance()); 721 clipboard.dispose(); 722 try { 723 if (o instanceof String ) { 724 reader = new StringReader((String ) o); 725 if (isPatchFile(reader)) { 726 setInputButtonState(CLIPBOARD); 727 return true; 728 } 729 } 730 } finally { 731 if (reader != null) { 732 try { 733 reader.close(); 734 } catch (IOException x) { 735 } 737 } 738 } 739 } 740 return false; 741 } 742 743 744 745 private boolean isPatchFile(Reader reader) { 746 WorkspacePatcher patcher= ((PatchWizard) getWizard()).getPatcher(); 747 748 try { 749 patcher.parse(new BufferedReader(reader)); 750 } catch (Exception ex) { 751 return false; 752 } 753 754 FileDiff[] diffs= patcher.getDiffs(); 755 if (diffs == null || diffs.length == 0) 756 return false; 757 return true; 758 } 759 760 763 private void clearErrorMessage(){ 764 setErrorMessage(null); 765 } 766 767 private void setInputButtonState(int state) { 768 769 switch (state) { 770 case CLIPBOARD: 771 fUseClipboardButton.setSelection(true); 772 fUsePatchFileButton.setSelection(false); 773 fUseWorkspaceButton.setSelection(false); 774 break; 775 776 case FILE: 777 fUseClipboardButton.setSelection(false); 778 fUsePatchFileButton.setSelection(true); 779 fUseWorkspaceButton.setSelection(false); 780 break; 781 782 case WORKSPACE: 783 fUseClipboardButton.setSelection(false); 784 fUsePatchFileButton.setSelection(false); 785 fUseWorkspaceButton.setSelection(true); 786 break; 787 } 788 789 setEnablePatchFile(state == FILE); 790 setEnableWorkspacePatch(state == WORKSPACE); 791 } 792 793 protected int getInputMethod() { 794 if (fUseClipboardButton.getSelection()) 795 return CLIPBOARD; 796 if (fUsePatchFileButton.getSelection()) 797 return FILE; 798 return WORKSPACE; 799 } 800 801 private String getPatchFilePath() { 802 if (fPatchFileNameField != null) 803 return fPatchFileNameField.getText(); 804 return ""; } 806 807 815 protected static String [] addToHistory(String [] history, String newEntry) { 816 java.util.ArrayList l= new java.util.ArrayList (java.util.Arrays.asList(history)); 817 818 l.remove(newEntry); 819 l.add(0,newEntry); 820 821 if (l.size() > COMBO_HISTORY_LENGTH) 824 l.remove(COMBO_HISTORY_LENGTH); 825 826 return (String []) l.toArray(new String [l.size()]); 827 } 828 829 public boolean isPatchRead() { 830 return fPatchRead; 831 } 832 } 833 834 | Popular Tags |