rem
stringlengths 0
477k
| add
stringlengths 0
313k
| context
stringlengths 6
599k
| meta
stringlengths 141
403
|
---|---|---|---|
if (attributeIsTrue(shortcutSpec, SPEC_ATTRIBUTE_STARTUP)) | if (XMLHelper.attributeIsTrue(shortcutSpec, SPEC_ATTRIBUTE_STARTUP)) | private void analyzeShortcutSpec() { if (!haveShortcutSpec) { shortcutsToCreate = false; return; } XMLElement skipper = spec.getFirstChildNamed(SPEC_KEY_SKIP_IFNOT_SUPPORTED); skipIfNotSupported = (skipper != null); // ---------------------------------------------------- // find out if we should simulate a not supported // scenario // ---------------------------------------------------- XMLElement support = spec.getFirstChildNamed(SPEC_KEY_NOT_SUPPORTED); if (support != null) { simulteNotSupported = true; } // ---------------------------------------------------- // find out in which program group the shortcuts should // be placed and where this program group should be // located // ---------------------------------------------------- XMLElement group = spec.getFirstChildNamed(SPEC_KEY_PROGRAM_GROUP); String location = null; hasDesktopShortcuts = false; if (group != null) { suggestedProgramGroup = group.getAttribute(SPEC_ATTRIBUTE_DEFAULT_GROUP, ""); location = group.getAttribute(SPEC_ATTRIBUTE_LOCATION, SPEC_VALUE_APPLICATIONS); } else { suggestedProgramGroup = ""; location = SPEC_VALUE_APPLICATIONS; } int groupLocation; if (location.equals(SPEC_VALUE_APPLICATIONS)) { groupLocation = Shortcut.APPLICATIONS; } else if (location.equals(SPEC_VALUE_START_MENU)) { groupLocation = Shortcut.START_MENU; } // ---------------------------------------------------- // create a list of all shortcuts that need to be // created, containing all details about each shortcut // ---------------------------------------------------- VariableSubstitutor substitutor = new VariableSubstitutor(idata.getVariables()); String temp; Vector shortcutSpecs = spec.getChildrenNamed(SPEC_KEY_SHORTCUT); XMLElement shortcutSpec; ShortcutData data; for (int i = 0; i < shortcutSpecs.size(); i++) { shortcutSpec = (XMLElement) shortcutSpecs.elementAt(i); if (!OsConstraint.oneMatchesCurrentSystem(shortcutSpec)) continue; data = new ShortcutData(); data.name = shortcutSpec.getAttribute(SPEC_ATTRIBUTE_NAME); data.subgroup = shortcutSpec.getAttribute(SPEC_ATTRIBUTE_SUBGROUP); data.description = shortcutSpec.getAttribute(SPEC_ATTRIBUTE_DESCRIPTION, ""); //** Linux **// data.deskTopEntryLinux_Encoding = shortcutSpec .getAttribute(SPEC_ATTRIBUTE_ENCODING, ""); data.deskTopEntryLinux_MimeType = shortcutSpec .getAttribute(SPEC_ATTRIBUTE_MIMETYPE, ""); data.deskTopEntryLinux_Terminal = shortcutSpec .getAttribute(SPEC_ATTRIBUTE_TERMINAL, ""); data.deskTopEntryLinux_TerminalOptions = shortcutSpec.getAttribute( SPEC_ATTRIBUTE_TERMINAL_OPTIONS, ""); data.deskTopEntryLinux_Type = shortcutSpec.getAttribute(SPEC_ATTRIBUTE_TYPE, ""); data.deskTopEntryLinux_URL = substitutor.substitute(shortcutSpec.getAttribute( SPEC_ATTRIBUTE_URL, ""), null); data.deskTopEntryLinux_X_KDE_SubstituteUID = shortcutSpec.getAttribute( SPEC_ATTRIBUTE_KDE_SUBST_UID, ""); data.createForAll = Boolean.valueOf(shortcutSpec.getAttribute(CREATE_FOR_ALL, "false")); //** EndOf LINUX **// temp = fixSeparatorChar(shortcutSpec.getAttribute(SPEC_ATTRIBUTE_TARGET, "")); data.target = substitutor.substitute(temp, null); temp = shortcutSpec.getAttribute(SPEC_ATTRIBUTE_COMMAND, ""); data.commandLine = substitutor.substitute(temp, null); temp = fixSeparatorChar(shortcutSpec.getAttribute(SPEC_ATTRIBUTE_ICON, "")); data.iconFile = substitutor.substitute(temp, null); data.iconIndex = Integer.parseInt(shortcutSpec.getAttribute(SPEC_ATTRIBUTE_ICON_INDEX, "0")); temp = fixSeparatorChar(shortcutSpec.getAttribute(SPEC_ATTRIBUTE_WORKING_DIR, "")); data.workingDirectory = substitutor.substitute(temp, null); String initialState = shortcutSpec.getAttribute(SPEC_ATTRIBUTE_INITIAL_STATE, ""); if (initialState.equals(SPEC_VALUE_NO_SHOW)) { data.initialState = Shortcut.HIDE; } else if (initialState.equals(SPEC_VALUE_NORMAL)) { data.initialState = Shortcut.NORMAL; } else if (initialState.equals(SPEC_VALUE_MAXIMIZED)) { data.initialState = Shortcut.MAXIMIZED; } else if (initialState.equals(SPEC_VALUE_MINIMIZED)) { data.initialState = Shortcut.MINIMIZED; } else { data.initialState = Shortcut.NORMAL; } // -------------------------------------------------- // if the minimal data requirements are met to create // the shortcut, create one entry each for each of // the requested types. // Eventually this will cause the creation of one // shortcut in each of the associated locations. // -------------------------------------------------- // without a name we can not create a shortcut if (data.name == null) { continue; } //1. Elmar: "Without a target we can not create a shortcut." //2. Marc: "No, Even on Linux a Link can be an URL and has no target." if (data.target == null) { continue; } // the shortcut is not actually required for any of the selected packs Vector forPacks = shortcutSpec.getChildrenNamed(SPEC_KEY_PACKS); if (!shortcutRequiredFor(forPacks)) { continue; } // -------------------------------------------------- // This section is executed if we don't skip. // -------------------------------------------------- // For each of the categories set the type and if // the link should be placed in the program group, // then clone the data set to obtain an independent // instance and add this to the list of shortcuts // to be created. In this way, we will set up an // identical copy for each of the locations at which // a shortcut should be placed. Therefore you must // not use 'else if' statements! // -------------------------------------------------- { if (attributeIsTrue(shortcutSpec, SPEC_ATTRIBUTE_DESKTOP)) { hasDesktopShortcuts = true; data.addToGroup = false; data.type = Shortcut.DESKTOP; shortcuts.add(data.clone()); } if (attributeIsTrue(shortcutSpec, SPEC_ATTRIBUTE_APPLICATIONS)) { data.addToGroup = false; data.type = Shortcut.APPLICATIONS; shortcuts.add(data.clone()); } if (attributeIsTrue(shortcutSpec, SPEC_ATTRIBUTE_START_MENU)) { data.addToGroup = false; data.type = Shortcut.START_MENU; shortcuts.add(data.clone()); } if (attributeIsTrue(shortcutSpec, SPEC_ATTRIBUTE_STARTUP)) { data.addToGroup = false; data.type = Shortcut.START_UP; shortcuts.add(data.clone()); } if (attributeIsTrue(shortcutSpec, SPEC_ATTRIBUTE_PROGRAM_GROUP)) { data.addToGroup = true; data.type = Shortcut.APPLICATIONS; shortcuts.add(data.clone()); } } } // ---------------------------------------------------- // signal if there are any shortcuts to create // ---------------------------------------------------- if (shortcuts.size() > 0) { shortcutsToCreate = true; } } | 54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/ea2c1c334b491cd6926af6502699f487604c17bc/ShortcutPanel.java/clean/src/lib/com/izforge/izpack/panels/ShortcutPanel.java |
if (attributeIsTrue(shortcutSpec, SPEC_ATTRIBUTE_PROGRAM_GROUP)) | if (XMLHelper.attributeIsTrue(shortcutSpec, SPEC_ATTRIBUTE_PROGRAM_GROUP)) | private void analyzeShortcutSpec() { if (!haveShortcutSpec) { shortcutsToCreate = false; return; } XMLElement skipper = spec.getFirstChildNamed(SPEC_KEY_SKIP_IFNOT_SUPPORTED); skipIfNotSupported = (skipper != null); // ---------------------------------------------------- // find out if we should simulate a not supported // scenario // ---------------------------------------------------- XMLElement support = spec.getFirstChildNamed(SPEC_KEY_NOT_SUPPORTED); if (support != null) { simulteNotSupported = true; } // ---------------------------------------------------- // find out in which program group the shortcuts should // be placed and where this program group should be // located // ---------------------------------------------------- XMLElement group = spec.getFirstChildNamed(SPEC_KEY_PROGRAM_GROUP); String location = null; hasDesktopShortcuts = false; if (group != null) { suggestedProgramGroup = group.getAttribute(SPEC_ATTRIBUTE_DEFAULT_GROUP, ""); location = group.getAttribute(SPEC_ATTRIBUTE_LOCATION, SPEC_VALUE_APPLICATIONS); } else { suggestedProgramGroup = ""; location = SPEC_VALUE_APPLICATIONS; } int groupLocation; if (location.equals(SPEC_VALUE_APPLICATIONS)) { groupLocation = Shortcut.APPLICATIONS; } else if (location.equals(SPEC_VALUE_START_MENU)) { groupLocation = Shortcut.START_MENU; } // ---------------------------------------------------- // create a list of all shortcuts that need to be // created, containing all details about each shortcut // ---------------------------------------------------- VariableSubstitutor substitutor = new VariableSubstitutor(idata.getVariables()); String temp; Vector shortcutSpecs = spec.getChildrenNamed(SPEC_KEY_SHORTCUT); XMLElement shortcutSpec; ShortcutData data; for (int i = 0; i < shortcutSpecs.size(); i++) { shortcutSpec = (XMLElement) shortcutSpecs.elementAt(i); if (!OsConstraint.oneMatchesCurrentSystem(shortcutSpec)) continue; data = new ShortcutData(); data.name = shortcutSpec.getAttribute(SPEC_ATTRIBUTE_NAME); data.subgroup = shortcutSpec.getAttribute(SPEC_ATTRIBUTE_SUBGROUP); data.description = shortcutSpec.getAttribute(SPEC_ATTRIBUTE_DESCRIPTION, ""); //** Linux **// data.deskTopEntryLinux_Encoding = shortcutSpec .getAttribute(SPEC_ATTRIBUTE_ENCODING, ""); data.deskTopEntryLinux_MimeType = shortcutSpec .getAttribute(SPEC_ATTRIBUTE_MIMETYPE, ""); data.deskTopEntryLinux_Terminal = shortcutSpec .getAttribute(SPEC_ATTRIBUTE_TERMINAL, ""); data.deskTopEntryLinux_TerminalOptions = shortcutSpec.getAttribute( SPEC_ATTRIBUTE_TERMINAL_OPTIONS, ""); data.deskTopEntryLinux_Type = shortcutSpec.getAttribute(SPEC_ATTRIBUTE_TYPE, ""); data.deskTopEntryLinux_URL = substitutor.substitute(shortcutSpec.getAttribute( SPEC_ATTRIBUTE_URL, ""), null); data.deskTopEntryLinux_X_KDE_SubstituteUID = shortcutSpec.getAttribute( SPEC_ATTRIBUTE_KDE_SUBST_UID, ""); data.createForAll = Boolean.valueOf(shortcutSpec.getAttribute(CREATE_FOR_ALL, "false")); //** EndOf LINUX **// temp = fixSeparatorChar(shortcutSpec.getAttribute(SPEC_ATTRIBUTE_TARGET, "")); data.target = substitutor.substitute(temp, null); temp = shortcutSpec.getAttribute(SPEC_ATTRIBUTE_COMMAND, ""); data.commandLine = substitutor.substitute(temp, null); temp = fixSeparatorChar(shortcutSpec.getAttribute(SPEC_ATTRIBUTE_ICON, "")); data.iconFile = substitutor.substitute(temp, null); data.iconIndex = Integer.parseInt(shortcutSpec.getAttribute(SPEC_ATTRIBUTE_ICON_INDEX, "0")); temp = fixSeparatorChar(shortcutSpec.getAttribute(SPEC_ATTRIBUTE_WORKING_DIR, "")); data.workingDirectory = substitutor.substitute(temp, null); String initialState = shortcutSpec.getAttribute(SPEC_ATTRIBUTE_INITIAL_STATE, ""); if (initialState.equals(SPEC_VALUE_NO_SHOW)) { data.initialState = Shortcut.HIDE; } else if (initialState.equals(SPEC_VALUE_NORMAL)) { data.initialState = Shortcut.NORMAL; } else if (initialState.equals(SPEC_VALUE_MAXIMIZED)) { data.initialState = Shortcut.MAXIMIZED; } else if (initialState.equals(SPEC_VALUE_MINIMIZED)) { data.initialState = Shortcut.MINIMIZED; } else { data.initialState = Shortcut.NORMAL; } // -------------------------------------------------- // if the minimal data requirements are met to create // the shortcut, create one entry each for each of // the requested types. // Eventually this will cause the creation of one // shortcut in each of the associated locations. // -------------------------------------------------- // without a name we can not create a shortcut if (data.name == null) { continue; } //1. Elmar: "Without a target we can not create a shortcut." //2. Marc: "No, Even on Linux a Link can be an URL and has no target." if (data.target == null) { continue; } // the shortcut is not actually required for any of the selected packs Vector forPacks = shortcutSpec.getChildrenNamed(SPEC_KEY_PACKS); if (!shortcutRequiredFor(forPacks)) { continue; } // -------------------------------------------------- // This section is executed if we don't skip. // -------------------------------------------------- // For each of the categories set the type and if // the link should be placed in the program group, // then clone the data set to obtain an independent // instance and add this to the list of shortcuts // to be created. In this way, we will set up an // identical copy for each of the locations at which // a shortcut should be placed. Therefore you must // not use 'else if' statements! // -------------------------------------------------- { if (attributeIsTrue(shortcutSpec, SPEC_ATTRIBUTE_DESKTOP)) { hasDesktopShortcuts = true; data.addToGroup = false; data.type = Shortcut.DESKTOP; shortcuts.add(data.clone()); } if (attributeIsTrue(shortcutSpec, SPEC_ATTRIBUTE_APPLICATIONS)) { data.addToGroup = false; data.type = Shortcut.APPLICATIONS; shortcuts.add(data.clone()); } if (attributeIsTrue(shortcutSpec, SPEC_ATTRIBUTE_START_MENU)) { data.addToGroup = false; data.type = Shortcut.START_MENU; shortcuts.add(data.clone()); } if (attributeIsTrue(shortcutSpec, SPEC_ATTRIBUTE_STARTUP)) { data.addToGroup = false; data.type = Shortcut.START_UP; shortcuts.add(data.clone()); } if (attributeIsTrue(shortcutSpec, SPEC_ATTRIBUTE_PROGRAM_GROUP)) { data.addToGroup = true; data.type = Shortcut.APPLICATIONS; shortcuts.add(data.clone()); } } } // ---------------------------------------------------- // signal if there are any shortcuts to create // ---------------------------------------------------- if (shortcuts.size() > 0) { shortcutsToCreate = true; } } | 54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/ea2c1c334b491cd6926af6502699f487604c17bc/ShortcutPanel.java/clean/src/lib/com/izforge/izpack/panels/ShortcutPanel.java |
shortCuts.add((data.name == null) ? "" : data.name); | private void analyzeShortcutSpec() { if (!haveShortcutSpec) { shortcutsToCreate = false; return; } XMLElement skipper = spec.getFirstChildNamed(SPEC_KEY_SKIP_IFNOT_SUPPORTED); skipIfNotSupported = (skipper != null); // ---------------------------------------------------- // find out if we should simulate a not supported // scenario // ---------------------------------------------------- XMLElement support = spec.getFirstChildNamed(SPEC_KEY_NOT_SUPPORTED); if (support != null) { simulteNotSupported = true; } // ---------------------------------------------------- // find out in which program group the shortcuts should // be placed and where this program group should be // located // ---------------------------------------------------- XMLElement group = spec.getFirstChildNamed(SPEC_KEY_PROGRAM_GROUP); String location = null; hasDesktopShortcuts = false; if (group != null) { suggestedProgramGroup = group.getAttribute(SPEC_ATTRIBUTE_DEFAULT_GROUP, ""); location = group.getAttribute(SPEC_ATTRIBUTE_LOCATION, SPEC_VALUE_APPLICATIONS); } else { suggestedProgramGroup = ""; location = SPEC_VALUE_APPLICATIONS; } int groupLocation; if (location.equals(SPEC_VALUE_APPLICATIONS)) { groupLocation = Shortcut.APPLICATIONS; } else if (location.equals(SPEC_VALUE_START_MENU)) { groupLocation = Shortcut.START_MENU; } // ---------------------------------------------------- // create a list of all shortcuts that need to be // created, containing all details about each shortcut // ---------------------------------------------------- VariableSubstitutor substitutor = new VariableSubstitutor(idata.getVariables()); String temp; Vector shortcutSpecs = spec.getChildrenNamed(SPEC_KEY_SHORTCUT); XMLElement shortcutSpec; ShortcutData data; for (int i = 0; i < shortcutSpecs.size(); i++) { shortcutSpec = (XMLElement) shortcutSpecs.elementAt(i); if (!OsConstraint.oneMatchesCurrentSystem(shortcutSpec)) continue; data = new ShortcutData(); data.name = shortcutSpec.getAttribute(SPEC_ATTRIBUTE_NAME); data.subgroup = shortcutSpec.getAttribute(SPEC_ATTRIBUTE_SUBGROUP); data.description = shortcutSpec.getAttribute(SPEC_ATTRIBUTE_DESCRIPTION, ""); //** Linux **// data.deskTopEntryLinux_Encoding = shortcutSpec .getAttribute(SPEC_ATTRIBUTE_ENCODING, ""); data.deskTopEntryLinux_MimeType = shortcutSpec .getAttribute(SPEC_ATTRIBUTE_MIMETYPE, ""); data.deskTopEntryLinux_Terminal = shortcutSpec .getAttribute(SPEC_ATTRIBUTE_TERMINAL, ""); data.deskTopEntryLinux_TerminalOptions = shortcutSpec.getAttribute( SPEC_ATTRIBUTE_TERMINAL_OPTIONS, ""); data.deskTopEntryLinux_Type = shortcutSpec.getAttribute(SPEC_ATTRIBUTE_TYPE, ""); data.deskTopEntryLinux_URL = substitutor.substitute(shortcutSpec.getAttribute( SPEC_ATTRIBUTE_URL, ""), null); data.deskTopEntryLinux_X_KDE_SubstituteUID = shortcutSpec.getAttribute( SPEC_ATTRIBUTE_KDE_SUBST_UID, ""); data.createForAll = Boolean.valueOf(shortcutSpec.getAttribute(CREATE_FOR_ALL, "false")); //** EndOf LINUX **// temp = fixSeparatorChar(shortcutSpec.getAttribute(SPEC_ATTRIBUTE_TARGET, "")); data.target = substitutor.substitute(temp, null); temp = shortcutSpec.getAttribute(SPEC_ATTRIBUTE_COMMAND, ""); data.commandLine = substitutor.substitute(temp, null); temp = fixSeparatorChar(shortcutSpec.getAttribute(SPEC_ATTRIBUTE_ICON, "")); data.iconFile = substitutor.substitute(temp, null); data.iconIndex = Integer.parseInt(shortcutSpec.getAttribute(SPEC_ATTRIBUTE_ICON_INDEX, "0")); temp = fixSeparatorChar(shortcutSpec.getAttribute(SPEC_ATTRIBUTE_WORKING_DIR, "")); data.workingDirectory = substitutor.substitute(temp, null); String initialState = shortcutSpec.getAttribute(SPEC_ATTRIBUTE_INITIAL_STATE, ""); if (initialState.equals(SPEC_VALUE_NO_SHOW)) { data.initialState = Shortcut.HIDE; } else if (initialState.equals(SPEC_VALUE_NORMAL)) { data.initialState = Shortcut.NORMAL; } else if (initialState.equals(SPEC_VALUE_MAXIMIZED)) { data.initialState = Shortcut.MAXIMIZED; } else if (initialState.equals(SPEC_VALUE_MINIMIZED)) { data.initialState = Shortcut.MINIMIZED; } else { data.initialState = Shortcut.NORMAL; } // -------------------------------------------------- // if the minimal data requirements are met to create // the shortcut, create one entry each for each of // the requested types. // Eventually this will cause the creation of one // shortcut in each of the associated locations. // -------------------------------------------------- // without a name we can not create a shortcut if (data.name == null) { continue; } //1. Elmar: "Without a target we can not create a shortcut." //2. Marc: "No, Even on Linux a Link can be an URL and has no target." if (data.target == null) { continue; } // the shortcut is not actually required for any of the selected packs Vector forPacks = shortcutSpec.getChildrenNamed(SPEC_KEY_PACKS); if (!shortcutRequiredFor(forPacks)) { continue; } // -------------------------------------------------- // This section is executed if we don't skip. // -------------------------------------------------- // For each of the categories set the type and if // the link should be placed in the program group, // then clone the data set to obtain an independent // instance and add this to the list of shortcuts // to be created. In this way, we will set up an // identical copy for each of the locations at which // a shortcut should be placed. Therefore you must // not use 'else if' statements! // -------------------------------------------------- { if (attributeIsTrue(shortcutSpec, SPEC_ATTRIBUTE_DESKTOP)) { hasDesktopShortcuts = true; data.addToGroup = false; data.type = Shortcut.DESKTOP; shortcuts.add(data.clone()); } if (attributeIsTrue(shortcutSpec, SPEC_ATTRIBUTE_APPLICATIONS)) { data.addToGroup = false; data.type = Shortcut.APPLICATIONS; shortcuts.add(data.clone()); } if (attributeIsTrue(shortcutSpec, SPEC_ATTRIBUTE_START_MENU)) { data.addToGroup = false; data.type = Shortcut.START_MENU; shortcuts.add(data.clone()); } if (attributeIsTrue(shortcutSpec, SPEC_ATTRIBUTE_STARTUP)) { data.addToGroup = false; data.type = Shortcut.START_UP; shortcuts.add(data.clone()); } if (attributeIsTrue(shortcutSpec, SPEC_ATTRIBUTE_PROGRAM_GROUP)) { data.addToGroup = true; data.type = Shortcut.APPLICATIONS; shortcuts.add(data.clone()); } } } // ---------------------------------------------------- // signal if there are any shortcuts to create // ---------------------------------------------------- if (shortcuts.size() > 0) { shortcutsToCreate = true; } } | 54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/ea2c1c334b491cd6926af6502699f487604c17bc/ShortcutPanel.java/clean/src/lib/com/izforge/izpack/panels/ShortcutPanel.java |
|
JList targetList = new JList(targets); | targetList = new JList(targets); | private void buildAlternateUI() { layout = new GridBagLayout(); constraints = new GridBagConstraints(); setLayout(layout); // ---------------------------------------------------- // static text a the top of the panel, that apologizes // about the fact that we can not create shortcuts on // this particular target OS. // ---------------------------------------------------- MultiLineLabel apologyLabel = new MultiLineLabel(parent.langpack .getString("ShortcutPanel.alternate.apology"), 0, 0); constraints.gridx = 0; constraints.gridy = 0; constraints.gridwidth = 1; constraints.gridheight = 1; constraints.weightx = 1.0; constraints.weighty = 1.0; constraints.insets = new Insets(5, 5, 5, 5); constraints.fill = GridBagConstraints.HORIZONTAL; constraints.anchor = GridBagConstraints.WEST; layout.addLayoutComponent(apologyLabel, constraints); add(apologyLabel); // ---------------------------------------------------- // label that explains the significance ot the list box // ---------------------------------------------------- MultiLineLabel listLabel = new MultiLineLabel(parent.langpack .getString("ShortcutPanel.alternate.targetsLabel"), 0, 0); constraints.gridx = 0; constraints.gridy = 1; constraints.gridwidth = 1; constraints.gridheight = 1; constraints.weightx = 1.0; constraints.weighty = 1.0; layout.addLayoutComponent(listLabel, constraints); add(listLabel); // ---------------------------------------------------- // list box to list all of the intended shortcut targets // ---------------------------------------------------- Vector targets = new Vector(); for (int i = 0; i < shortcuts.size(); i++) { targets.add(((ShortcutData) shortcuts.elementAt(i)).target); } JList targetList = new JList(targets); JScrollPane scrollPane = new JScrollPane(targetList); constraints.gridx = 0; constraints.gridy = 2; constraints.fill = GridBagConstraints.BOTH; layout.addLayoutComponent(scrollPane, constraints); add(scrollPane); // ---------------------------------------------------- // static text that explains about the text file // ---------------------------------------------------- MultiLineLabel fileExplanation = new MultiLineLabel(parent.langpack .getString("ShortcutPanel.alternate.textFileExplanation"), 0, 0); constraints.gridx = 0; constraints.gridy = 3; constraints.weightx = 1.0; constraints.weighty = 1.0; constraints.fill = GridBagConstraints.HORIZONTAL; layout.addLayoutComponent(fileExplanation, constraints); add(fileExplanation); // ---------------------------------------------------- // button to save the text file // ---------------------------------------------------- saveButton = ButtonFactory.createButton(parent.langpack .getString("ShortcutPanel.alternate.saveButton"), idata.buttonsHColor); saveButton.addActionListener(this); constraints.gridx = 0; constraints.gridy = 4; constraints.gridwidth = 1; constraints.gridheight = 1; constraints.fill = GridBagConstraints.NONE; constraints.anchor = GridBagConstraints.CENTER; layout.addLayoutComponent(saveButton, constraints); add(saveButton); } | 54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/ea2c1c334b491cd6926af6502699f487604c17bc/ShortcutPanel.java/clean/src/lib/com/izforge/izpack/panels/ShortcutPanel.java |
File itsProgramFolder = groups; constraints.gridx = 0; constraints.gridy = 0; constraints.gridwidth = 3; | itsProgramFolder = groups; constraints.insets = new Insets(10, 10, 0, 0); String menuKind = parent.langpack.getString("ShortcutPanel.regular.StartMenu:Start-Menu"); if (OsVersion.IS_UNIX && UnixHelper.kdeIsInstalled()) { menuKind = parent.langpack.getString("ShortcutPanel.regular.StartMenu:K-Menu"); } createShortcuts = new JCheckBox(StringTool.replace(parent.langpack .getString("ShortcutPanel.regular.create"), "StartMenu", menuKind), true); createShortcuts.addActionListener(this); constraints.gridx = col; constraints.gridy = line + 1; constraints.gridwidth = 1; | private void buildUI(File groups) { File itsProgramFolder = groups; constraints.gridx = 0; constraints.gridy = 0; constraints.gridwidth = 3; constraints.gridheight = 1; constraints.weightx = 1.0; constraints.weighty = 1.0; constraints.fill = GridBagConstraints.HORIZONTAL; constraints.anchor = GridBagConstraints.WEST; /**/ // Add a CheckBox which enables the user to entirely supress shortcut creation. String menuKind = parent.langpack.getString("ShortcutPanel.regular.StartMenu:Start-Menu"); if( OsVersion.IS_UNIX && UnixHelper.kdeIsInstalled() ) menuKind = parent.langpack.getString("ShortcutPanel.regular.StartMenu:K-Menu"); createShortcuts = new JCheckBox( StringTool.replace( parent.langpack.getString("ShortcutPanel.regular.create"), "StartMenu", menuKind ), true); createShortcuts.addActionListener(this); constraints.gridx = 0; constraints.gridy = 1; constraints.gridwidth = 2; constraints.gridheight = 1; constraints.weighty = 0.2; layout.addLayoutComponent(createShortcuts, constraints); add(createShortcuts); // ---------------------------------------------------- // check box to allow the user to decide if a desktop // shortcut should be created. // this should only be created if needed and requested // in the definition file. // ---------------------------------------------------- if (hasDesktopShortcuts) { String initialAllowedValue = idata.getVariable( "DesktopShortcutCheckboxEnabled" ); boolean initialAllowedFlag = false; if( initialAllowedValue==null) initialAllowedFlag= false; else if( Boolean.TRUE.toString().equals(initialAllowedValue) ) initialAllowedFlag=true; allowDesktopShortcut = new JCheckBox(parent.langpack .getString("ShortcutPanel.regular.desktop"), initialAllowedFlag); constraints.gridx = 0; constraints.gridy = 2; constraints.gridwidth = 3; constraints.gridheight = 1; constraints.weighty = 0.2; layout.addLayoutComponent(allowDesktopShortcut, constraints); add(allowDesktopShortcut); } JLabel listLabel = LabelFactory.create(parent.langpack.getString("ShortcutPanel.regular.list"), JLabel.LEADING); constraints.gridx = 0; constraints.gridy = 3; constraints.gridwidth = 1; constraints.gridheight = 1; constraints.weightx = 0.2; constraints.weighty = 0.2; constraints.fill = GridBagConstraints.NONE; constraints.anchor = GridBagConstraints.WEST; layout.addLayoutComponent(listLabel, constraints); add(listLabel); // ---------------------------------------------------- // list box to list all of already existing folders as program groups // at the intended destination // ---------------------------------------------------- addSelectionList( groups, 0, 4, 2, 1, GridBagConstraints.BOTH ); // ---------------------------------------------------- // radio buttons to select current user or all users. // ---------------------------------------------------- if (shortcut.multipleUsers()) { JPanel usersPanel = new JPanel(new GridLayout(2, 1)); ButtonGroup usersGroup = new ButtonGroup(); currentUser = new JRadioButton(parent.langpack .getString("ShortcutPanel.regular.currentUser"), !isRootUser); currentUser.addActionListener(this); usersGroup.add(currentUser); usersPanel.add(currentUser); allUsers = new JRadioButton( parent.langpack.getString("ShortcutPanel.regular.allUsers"), isRootUser); if (!isRootUser) allUsers.setEnabled(false); allUsers.addActionListener(this); usersGroup.add(allUsers); usersPanel.add(allUsers); TitledBorder border = new TitledBorder(new EmptyBorder(2, 2, 2, 2), parent.langpack .getString("ShortcutPanel.regular.userIntro")); usersPanel.setBorder(border); constraints.gridx = 2; constraints.gridy = 4; constraints.gridwidth = 1; constraints.gridheight = 1; constraints.weighty = 1.0; constraints.weightx = 1.0; constraints.fill = GridBagConstraints.NONE; layout.addLayoutComponent(usersPanel, constraints); add(usersPanel); } // ---------------------------------------------------- // edit box that contains the suggested program group // name, which can be modfied or substituted from the // list by the user // ---------------------------------------------------- programGroup = new JTextField(suggestedProgramGroup, 40); // 40? constraints.gridx = 0; constraints.gridy = 5; constraints.gridwidth = 2; constraints.gridheight = 1; constraints.weighty = 1.0; constraints.weightx = 10.0; constraints.fill = GridBagConstraints.HORIZONTAL; layout.addLayoutComponent(programGroup, constraints); add(programGroup); // ---------------------------------------------------- // reset button that allows the user to revert to the // original suggestion for the program group // ---------------------------------------------------- defaultButton = ButtonFactory.createButton(parent.langpack .getString("ShortcutPanel.regular.default"), idata.buttonsHColor); defaultButton.addActionListener(this); constraints.gridx = 2; constraints.gridy = 5; constraints.gridwidth = 1; constraints.gridheight = 1; constraints.fill = GridBagConstraints.NONE; layout.addLayoutComponent(defaultButton, constraints); add(defaultButton); } | 54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/ea2c1c334b491cd6926af6502699f487604c17bc/ShortcutPanel.java/clean/src/lib/com/izforge/izpack/panels/ShortcutPanel.java |
constraints.weightx = 1.0; constraints.weighty = 1.0; | private void buildUI(File groups) { File itsProgramFolder = groups; constraints.gridx = 0; constraints.gridy = 0; constraints.gridwidth = 3; constraints.gridheight = 1; constraints.weightx = 1.0; constraints.weighty = 1.0; constraints.fill = GridBagConstraints.HORIZONTAL; constraints.anchor = GridBagConstraints.WEST; /**/ // Add a CheckBox which enables the user to entirely supress shortcut creation. String menuKind = parent.langpack.getString("ShortcutPanel.regular.StartMenu:Start-Menu"); if( OsVersion.IS_UNIX && UnixHelper.kdeIsInstalled() ) menuKind = parent.langpack.getString("ShortcutPanel.regular.StartMenu:K-Menu"); createShortcuts = new JCheckBox( StringTool.replace( parent.langpack.getString("ShortcutPanel.regular.create"), "StartMenu", menuKind ), true); createShortcuts.addActionListener(this); constraints.gridx = 0; constraints.gridy = 1; constraints.gridwidth = 2; constraints.gridheight = 1; constraints.weighty = 0.2; layout.addLayoutComponent(createShortcuts, constraints); add(createShortcuts); // ---------------------------------------------------- // check box to allow the user to decide if a desktop // shortcut should be created. // this should only be created if needed and requested // in the definition file. // ---------------------------------------------------- if (hasDesktopShortcuts) { String initialAllowedValue = idata.getVariable( "DesktopShortcutCheckboxEnabled" ); boolean initialAllowedFlag = false; if( initialAllowedValue==null) initialAllowedFlag= false; else if( Boolean.TRUE.toString().equals(initialAllowedValue) ) initialAllowedFlag=true; allowDesktopShortcut = new JCheckBox(parent.langpack .getString("ShortcutPanel.regular.desktop"), initialAllowedFlag); constraints.gridx = 0; constraints.gridy = 2; constraints.gridwidth = 3; constraints.gridheight = 1; constraints.weighty = 0.2; layout.addLayoutComponent(allowDesktopShortcut, constraints); add(allowDesktopShortcut); } JLabel listLabel = LabelFactory.create(parent.langpack.getString("ShortcutPanel.regular.list"), JLabel.LEADING); constraints.gridx = 0; constraints.gridy = 3; constraints.gridwidth = 1; constraints.gridheight = 1; constraints.weightx = 0.2; constraints.weighty = 0.2; constraints.fill = GridBagConstraints.NONE; constraints.anchor = GridBagConstraints.WEST; layout.addLayoutComponent(listLabel, constraints); add(listLabel); // ---------------------------------------------------- // list box to list all of already existing folders as program groups // at the intended destination // ---------------------------------------------------- addSelectionList( groups, 0, 4, 2, 1, GridBagConstraints.BOTH ); // ---------------------------------------------------- // radio buttons to select current user or all users. // ---------------------------------------------------- if (shortcut.multipleUsers()) { JPanel usersPanel = new JPanel(new GridLayout(2, 1)); ButtonGroup usersGroup = new ButtonGroup(); currentUser = new JRadioButton(parent.langpack .getString("ShortcutPanel.regular.currentUser"), !isRootUser); currentUser.addActionListener(this); usersGroup.add(currentUser); usersPanel.add(currentUser); allUsers = new JRadioButton( parent.langpack.getString("ShortcutPanel.regular.allUsers"), isRootUser); if (!isRootUser) allUsers.setEnabled(false); allUsers.addActionListener(this); usersGroup.add(allUsers); usersPanel.add(allUsers); TitledBorder border = new TitledBorder(new EmptyBorder(2, 2, 2, 2), parent.langpack .getString("ShortcutPanel.regular.userIntro")); usersPanel.setBorder(border); constraints.gridx = 2; constraints.gridy = 4; constraints.gridwidth = 1; constraints.gridheight = 1; constraints.weighty = 1.0; constraints.weightx = 1.0; constraints.fill = GridBagConstraints.NONE; layout.addLayoutComponent(usersPanel, constraints); add(usersPanel); } // ---------------------------------------------------- // edit box that contains the suggested program group // name, which can be modfied or substituted from the // list by the user // ---------------------------------------------------- programGroup = new JTextField(suggestedProgramGroup, 40); // 40? constraints.gridx = 0; constraints.gridy = 5; constraints.gridwidth = 2; constraints.gridheight = 1; constraints.weighty = 1.0; constraints.weightx = 10.0; constraints.fill = GridBagConstraints.HORIZONTAL; layout.addLayoutComponent(programGroup, constraints); add(programGroup); // ---------------------------------------------------- // reset button that allows the user to revert to the // original suggestion for the program group // ---------------------------------------------------- defaultButton = ButtonFactory.createButton(parent.langpack .getString("ShortcutPanel.regular.default"), idata.buttonsHColor); defaultButton.addActionListener(this); constraints.gridx = 2; constraints.gridy = 5; constraints.gridwidth = 1; constraints.gridheight = 1; constraints.fill = GridBagConstraints.NONE; layout.addLayoutComponent(defaultButton, constraints); add(defaultButton); } | 54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/ea2c1c334b491cd6926af6502699f487604c17bc/ShortcutPanel.java/clean/src/lib/com/izforge/izpack/panels/ShortcutPanel.java |
|
constraints.anchor = GridBagConstraints.WEST; /**/ | constraints.anchor = GridBagConstraints.NORTHWEST; | private void buildUI(File groups) { File itsProgramFolder = groups; constraints.gridx = 0; constraints.gridy = 0; constraints.gridwidth = 3; constraints.gridheight = 1; constraints.weightx = 1.0; constraints.weighty = 1.0; constraints.fill = GridBagConstraints.HORIZONTAL; constraints.anchor = GridBagConstraints.WEST; /**/ // Add a CheckBox which enables the user to entirely supress shortcut creation. String menuKind = parent.langpack.getString("ShortcutPanel.regular.StartMenu:Start-Menu"); if( OsVersion.IS_UNIX && UnixHelper.kdeIsInstalled() ) menuKind = parent.langpack.getString("ShortcutPanel.regular.StartMenu:K-Menu"); createShortcuts = new JCheckBox( StringTool.replace( parent.langpack.getString("ShortcutPanel.regular.create"), "StartMenu", menuKind ), true); createShortcuts.addActionListener(this); constraints.gridx = 0; constraints.gridy = 1; constraints.gridwidth = 2; constraints.gridheight = 1; constraints.weighty = 0.2; layout.addLayoutComponent(createShortcuts, constraints); add(createShortcuts); // ---------------------------------------------------- // check box to allow the user to decide if a desktop // shortcut should be created. // this should only be created if needed and requested // in the definition file. // ---------------------------------------------------- if (hasDesktopShortcuts) { String initialAllowedValue = idata.getVariable( "DesktopShortcutCheckboxEnabled" ); boolean initialAllowedFlag = false; if( initialAllowedValue==null) initialAllowedFlag= false; else if( Boolean.TRUE.toString().equals(initialAllowedValue) ) initialAllowedFlag=true; allowDesktopShortcut = new JCheckBox(parent.langpack .getString("ShortcutPanel.regular.desktop"), initialAllowedFlag); constraints.gridx = 0; constraints.gridy = 2; constraints.gridwidth = 3; constraints.gridheight = 1; constraints.weighty = 0.2; layout.addLayoutComponent(allowDesktopShortcut, constraints); add(allowDesktopShortcut); } JLabel listLabel = LabelFactory.create(parent.langpack.getString("ShortcutPanel.regular.list"), JLabel.LEADING); constraints.gridx = 0; constraints.gridy = 3; constraints.gridwidth = 1; constraints.gridheight = 1; constraints.weightx = 0.2; constraints.weighty = 0.2; constraints.fill = GridBagConstraints.NONE; constraints.anchor = GridBagConstraints.WEST; layout.addLayoutComponent(listLabel, constraints); add(listLabel); // ---------------------------------------------------- // list box to list all of already existing folders as program groups // at the intended destination // ---------------------------------------------------- addSelectionList( groups, 0, 4, 2, 1, GridBagConstraints.BOTH ); // ---------------------------------------------------- // radio buttons to select current user or all users. // ---------------------------------------------------- if (shortcut.multipleUsers()) { JPanel usersPanel = new JPanel(new GridLayout(2, 1)); ButtonGroup usersGroup = new ButtonGroup(); currentUser = new JRadioButton(parent.langpack .getString("ShortcutPanel.regular.currentUser"), !isRootUser); currentUser.addActionListener(this); usersGroup.add(currentUser); usersPanel.add(currentUser); allUsers = new JRadioButton( parent.langpack.getString("ShortcutPanel.regular.allUsers"), isRootUser); if (!isRootUser) allUsers.setEnabled(false); allUsers.addActionListener(this); usersGroup.add(allUsers); usersPanel.add(allUsers); TitledBorder border = new TitledBorder(new EmptyBorder(2, 2, 2, 2), parent.langpack .getString("ShortcutPanel.regular.userIntro")); usersPanel.setBorder(border); constraints.gridx = 2; constraints.gridy = 4; constraints.gridwidth = 1; constraints.gridheight = 1; constraints.weighty = 1.0; constraints.weightx = 1.0; constraints.fill = GridBagConstraints.NONE; layout.addLayoutComponent(usersPanel, constraints); add(usersPanel); } // ---------------------------------------------------- // edit box that contains the suggested program group // name, which can be modfied or substituted from the // list by the user // ---------------------------------------------------- programGroup = new JTextField(suggestedProgramGroup, 40); // 40? constraints.gridx = 0; constraints.gridy = 5; constraints.gridwidth = 2; constraints.gridheight = 1; constraints.weighty = 1.0; constraints.weightx = 10.0; constraints.fill = GridBagConstraints.HORIZONTAL; layout.addLayoutComponent(programGroup, constraints); add(programGroup); // ---------------------------------------------------- // reset button that allows the user to revert to the // original suggestion for the program group // ---------------------------------------------------- defaultButton = ButtonFactory.createButton(parent.langpack .getString("ShortcutPanel.regular.default"), idata.buttonsHColor); defaultButton.addActionListener(this); constraints.gridx = 2; constraints.gridy = 5; constraints.gridwidth = 1; constraints.gridheight = 1; constraints.fill = GridBagConstraints.NONE; layout.addLayoutComponent(defaultButton, constraints); add(defaultButton); } | 54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/ea2c1c334b491cd6926af6502699f487604c17bc/ShortcutPanel.java/clean/src/lib/com/izforge/izpack/panels/ShortcutPanel.java |
String menuKind = parent.langpack.getString("ShortcutPanel.regular.StartMenu:Start-Menu"); if( OsVersion.IS_UNIX && UnixHelper.kdeIsInstalled() ) menuKind = parent.langpack.getString("ShortcutPanel.regular.StartMenu:K-Menu"); createShortcuts = new JCheckBox( StringTool.replace( parent.langpack.getString("ShortcutPanel.regular.create"), "StartMenu", menuKind ), true); createShortcuts.addActionListener(this); constraints.gridx = 0; constraints.gridy = 1; constraints.gridwidth = 2; constraints.gridheight = 1; constraints.weighty = 0.2; | private void buildUI(File groups) { File itsProgramFolder = groups; constraints.gridx = 0; constraints.gridy = 0; constraints.gridwidth = 3; constraints.gridheight = 1; constraints.weightx = 1.0; constraints.weighty = 1.0; constraints.fill = GridBagConstraints.HORIZONTAL; constraints.anchor = GridBagConstraints.WEST; /**/ // Add a CheckBox which enables the user to entirely supress shortcut creation. String menuKind = parent.langpack.getString("ShortcutPanel.regular.StartMenu:Start-Menu"); if( OsVersion.IS_UNIX && UnixHelper.kdeIsInstalled() ) menuKind = parent.langpack.getString("ShortcutPanel.regular.StartMenu:K-Menu"); createShortcuts = new JCheckBox( StringTool.replace( parent.langpack.getString("ShortcutPanel.regular.create"), "StartMenu", menuKind ), true); createShortcuts.addActionListener(this); constraints.gridx = 0; constraints.gridy = 1; constraints.gridwidth = 2; constraints.gridheight = 1; constraints.weighty = 0.2; layout.addLayoutComponent(createShortcuts, constraints); add(createShortcuts); // ---------------------------------------------------- // check box to allow the user to decide if a desktop // shortcut should be created. // this should only be created if needed and requested // in the definition file. // ---------------------------------------------------- if (hasDesktopShortcuts) { String initialAllowedValue = idata.getVariable( "DesktopShortcutCheckboxEnabled" ); boolean initialAllowedFlag = false; if( initialAllowedValue==null) initialAllowedFlag= false; else if( Boolean.TRUE.toString().equals(initialAllowedValue) ) initialAllowedFlag=true; allowDesktopShortcut = new JCheckBox(parent.langpack .getString("ShortcutPanel.regular.desktop"), initialAllowedFlag); constraints.gridx = 0; constraints.gridy = 2; constraints.gridwidth = 3; constraints.gridheight = 1; constraints.weighty = 0.2; layout.addLayoutComponent(allowDesktopShortcut, constraints); add(allowDesktopShortcut); } JLabel listLabel = LabelFactory.create(parent.langpack.getString("ShortcutPanel.regular.list"), JLabel.LEADING); constraints.gridx = 0; constraints.gridy = 3; constraints.gridwidth = 1; constraints.gridheight = 1; constraints.weightx = 0.2; constraints.weighty = 0.2; constraints.fill = GridBagConstraints.NONE; constraints.anchor = GridBagConstraints.WEST; layout.addLayoutComponent(listLabel, constraints); add(listLabel); // ---------------------------------------------------- // list box to list all of already existing folders as program groups // at the intended destination // ---------------------------------------------------- addSelectionList( groups, 0, 4, 2, 1, GridBagConstraints.BOTH ); // ---------------------------------------------------- // radio buttons to select current user or all users. // ---------------------------------------------------- if (shortcut.multipleUsers()) { JPanel usersPanel = new JPanel(new GridLayout(2, 1)); ButtonGroup usersGroup = new ButtonGroup(); currentUser = new JRadioButton(parent.langpack .getString("ShortcutPanel.regular.currentUser"), !isRootUser); currentUser.addActionListener(this); usersGroup.add(currentUser); usersPanel.add(currentUser); allUsers = new JRadioButton( parent.langpack.getString("ShortcutPanel.regular.allUsers"), isRootUser); if (!isRootUser) allUsers.setEnabled(false); allUsers.addActionListener(this); usersGroup.add(allUsers); usersPanel.add(allUsers); TitledBorder border = new TitledBorder(new EmptyBorder(2, 2, 2, 2), parent.langpack .getString("ShortcutPanel.regular.userIntro")); usersPanel.setBorder(border); constraints.gridx = 2; constraints.gridy = 4; constraints.gridwidth = 1; constraints.gridheight = 1; constraints.weighty = 1.0; constraints.weightx = 1.0; constraints.fill = GridBagConstraints.NONE; layout.addLayoutComponent(usersPanel, constraints); add(usersPanel); } // ---------------------------------------------------- // edit box that contains the suggested program group // name, which can be modfied or substituted from the // list by the user // ---------------------------------------------------- programGroup = new JTextField(suggestedProgramGroup, 40); // 40? constraints.gridx = 0; constraints.gridy = 5; constraints.gridwidth = 2; constraints.gridheight = 1; constraints.weighty = 1.0; constraints.weightx = 10.0; constraints.fill = GridBagConstraints.HORIZONTAL; layout.addLayoutComponent(programGroup, constraints); add(programGroup); // ---------------------------------------------------- // reset button that allows the user to revert to the // original suggestion for the program group // ---------------------------------------------------- defaultButton = ButtonFactory.createButton(parent.langpack .getString("ShortcutPanel.regular.default"), idata.buttonsHColor); defaultButton.addActionListener(this); constraints.gridx = 2; constraints.gridy = 5; constraints.gridwidth = 1; constraints.gridheight = 1; constraints.fill = GridBagConstraints.NONE; layout.addLayoutComponent(defaultButton, constraints); add(defaultButton); } | 54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/ea2c1c334b491cd6926af6502699f487604c17bc/ShortcutPanel.java/clean/src/lib/com/izforge/izpack/panels/ShortcutPanel.java |
|
constraints.insets = new Insets(0, 10, 0, 0); | private void buildUI(File groups) { File itsProgramFolder = groups; constraints.gridx = 0; constraints.gridy = 0; constraints.gridwidth = 3; constraints.gridheight = 1; constraints.weightx = 1.0; constraints.weighty = 1.0; constraints.fill = GridBagConstraints.HORIZONTAL; constraints.anchor = GridBagConstraints.WEST; /**/ // Add a CheckBox which enables the user to entirely supress shortcut creation. String menuKind = parent.langpack.getString("ShortcutPanel.regular.StartMenu:Start-Menu"); if( OsVersion.IS_UNIX && UnixHelper.kdeIsInstalled() ) menuKind = parent.langpack.getString("ShortcutPanel.regular.StartMenu:K-Menu"); createShortcuts = new JCheckBox( StringTool.replace( parent.langpack.getString("ShortcutPanel.regular.create"), "StartMenu", menuKind ), true); createShortcuts.addActionListener(this); constraints.gridx = 0; constraints.gridy = 1; constraints.gridwidth = 2; constraints.gridheight = 1; constraints.weighty = 0.2; layout.addLayoutComponent(createShortcuts, constraints); add(createShortcuts); // ---------------------------------------------------- // check box to allow the user to decide if a desktop // shortcut should be created. // this should only be created if needed and requested // in the definition file. // ---------------------------------------------------- if (hasDesktopShortcuts) { String initialAllowedValue = idata.getVariable( "DesktopShortcutCheckboxEnabled" ); boolean initialAllowedFlag = false; if( initialAllowedValue==null) initialAllowedFlag= false; else if( Boolean.TRUE.toString().equals(initialAllowedValue) ) initialAllowedFlag=true; allowDesktopShortcut = new JCheckBox(parent.langpack .getString("ShortcutPanel.regular.desktop"), initialAllowedFlag); constraints.gridx = 0; constraints.gridy = 2; constraints.gridwidth = 3; constraints.gridheight = 1; constraints.weighty = 0.2; layout.addLayoutComponent(allowDesktopShortcut, constraints); add(allowDesktopShortcut); } JLabel listLabel = LabelFactory.create(parent.langpack.getString("ShortcutPanel.regular.list"), JLabel.LEADING); constraints.gridx = 0; constraints.gridy = 3; constraints.gridwidth = 1; constraints.gridheight = 1; constraints.weightx = 0.2; constraints.weighty = 0.2; constraints.fill = GridBagConstraints.NONE; constraints.anchor = GridBagConstraints.WEST; layout.addLayoutComponent(listLabel, constraints); add(listLabel); // ---------------------------------------------------- // list box to list all of already existing folders as program groups // at the intended destination // ---------------------------------------------------- addSelectionList( groups, 0, 4, 2, 1, GridBagConstraints.BOTH ); // ---------------------------------------------------- // radio buttons to select current user or all users. // ---------------------------------------------------- if (shortcut.multipleUsers()) { JPanel usersPanel = new JPanel(new GridLayout(2, 1)); ButtonGroup usersGroup = new ButtonGroup(); currentUser = new JRadioButton(parent.langpack .getString("ShortcutPanel.regular.currentUser"), !isRootUser); currentUser.addActionListener(this); usersGroup.add(currentUser); usersPanel.add(currentUser); allUsers = new JRadioButton( parent.langpack.getString("ShortcutPanel.regular.allUsers"), isRootUser); if (!isRootUser) allUsers.setEnabled(false); allUsers.addActionListener(this); usersGroup.add(allUsers); usersPanel.add(allUsers); TitledBorder border = new TitledBorder(new EmptyBorder(2, 2, 2, 2), parent.langpack .getString("ShortcutPanel.regular.userIntro")); usersPanel.setBorder(border); constraints.gridx = 2; constraints.gridy = 4; constraints.gridwidth = 1; constraints.gridheight = 1; constraints.weighty = 1.0; constraints.weightx = 1.0; constraints.fill = GridBagConstraints.NONE; layout.addLayoutComponent(usersPanel, constraints); add(usersPanel); } // ---------------------------------------------------- // edit box that contains the suggested program group // name, which can be modfied or substituted from the // list by the user // ---------------------------------------------------- programGroup = new JTextField(suggestedProgramGroup, 40); // 40? constraints.gridx = 0; constraints.gridy = 5; constraints.gridwidth = 2; constraints.gridheight = 1; constraints.weighty = 1.0; constraints.weightx = 10.0; constraints.fill = GridBagConstraints.HORIZONTAL; layout.addLayoutComponent(programGroup, constraints); add(programGroup); // ---------------------------------------------------- // reset button that allows the user to revert to the // original suggestion for the program group // ---------------------------------------------------- defaultButton = ButtonFactory.createButton(parent.langpack .getString("ShortcutPanel.regular.default"), idata.buttonsHColor); defaultButton.addActionListener(this); constraints.gridx = 2; constraints.gridy = 5; constraints.gridwidth = 1; constraints.gridheight = 1; constraints.fill = GridBagConstraints.NONE; layout.addLayoutComponent(defaultButton, constraints); add(defaultButton); } | 54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/ea2c1c334b491cd6926af6502699f487604c17bc/ShortcutPanel.java/clean/src/lib/com/izforge/izpack/panels/ShortcutPanel.java |
|
String initialAllowedValue = idata.getVariable( "DesktopShortcutCheckboxEnabled" ); boolean initialAllowedFlag = false; if( initialAllowedValue==null) initialAllowedFlag= false; else if( Boolean.TRUE.toString().equals(initialAllowedValue) ) initialAllowedFlag=true; allowDesktopShortcut = new JCheckBox(parent.langpack .getString("ShortcutPanel.regular.desktop"), initialAllowedFlag); constraints.gridx = 0; constraints.gridy = 2; constraints.gridwidth = 3; constraints.gridheight = 1; constraints.weighty = 0.2; layout.addLayoutComponent(allowDesktopShortcut, constraints); add(allowDesktopShortcut); | String initialAllowedValue = idata.getVariable("DesktopShortcutCheckboxEnabled"); boolean initialAllowedFlag = false; if (initialAllowedValue == null) { initialAllowedFlag = false; } else if (Boolean.TRUE.toString().equals(initialAllowedValue)) { initialAllowedFlag = true; } allowDesktopShortcut = new JCheckBox(parent.langpack .getString("ShortcutPanel.regular.desktop"), initialAllowedFlag); constraints.gridx = col; constraints.gridy = line + 2; constraints.gridwidth = 1; constraints.gridheight = 1; layout.addLayoutComponent(allowDesktopShortcut, constraints); add(allowDesktopShortcut); | private void buildUI(File groups) { File itsProgramFolder = groups; constraints.gridx = 0; constraints.gridy = 0; constraints.gridwidth = 3; constraints.gridheight = 1; constraints.weightx = 1.0; constraints.weighty = 1.0; constraints.fill = GridBagConstraints.HORIZONTAL; constraints.anchor = GridBagConstraints.WEST; /**/ // Add a CheckBox which enables the user to entirely supress shortcut creation. String menuKind = parent.langpack.getString("ShortcutPanel.regular.StartMenu:Start-Menu"); if( OsVersion.IS_UNIX && UnixHelper.kdeIsInstalled() ) menuKind = parent.langpack.getString("ShortcutPanel.regular.StartMenu:K-Menu"); createShortcuts = new JCheckBox( StringTool.replace( parent.langpack.getString("ShortcutPanel.regular.create"), "StartMenu", menuKind ), true); createShortcuts.addActionListener(this); constraints.gridx = 0; constraints.gridy = 1; constraints.gridwidth = 2; constraints.gridheight = 1; constraints.weighty = 0.2; layout.addLayoutComponent(createShortcuts, constraints); add(createShortcuts); // ---------------------------------------------------- // check box to allow the user to decide if a desktop // shortcut should be created. // this should only be created if needed and requested // in the definition file. // ---------------------------------------------------- if (hasDesktopShortcuts) { String initialAllowedValue = idata.getVariable( "DesktopShortcutCheckboxEnabled" ); boolean initialAllowedFlag = false; if( initialAllowedValue==null) initialAllowedFlag= false; else if( Boolean.TRUE.toString().equals(initialAllowedValue) ) initialAllowedFlag=true; allowDesktopShortcut = new JCheckBox(parent.langpack .getString("ShortcutPanel.regular.desktop"), initialAllowedFlag); constraints.gridx = 0; constraints.gridy = 2; constraints.gridwidth = 3; constraints.gridheight = 1; constraints.weighty = 0.2; layout.addLayoutComponent(allowDesktopShortcut, constraints); add(allowDesktopShortcut); } JLabel listLabel = LabelFactory.create(parent.langpack.getString("ShortcutPanel.regular.list"), JLabel.LEADING); constraints.gridx = 0; constraints.gridy = 3; constraints.gridwidth = 1; constraints.gridheight = 1; constraints.weightx = 0.2; constraints.weighty = 0.2; constraints.fill = GridBagConstraints.NONE; constraints.anchor = GridBagConstraints.WEST; layout.addLayoutComponent(listLabel, constraints); add(listLabel); // ---------------------------------------------------- // list box to list all of already existing folders as program groups // at the intended destination // ---------------------------------------------------- addSelectionList( groups, 0, 4, 2, 1, GridBagConstraints.BOTH ); // ---------------------------------------------------- // radio buttons to select current user or all users. // ---------------------------------------------------- if (shortcut.multipleUsers()) { JPanel usersPanel = new JPanel(new GridLayout(2, 1)); ButtonGroup usersGroup = new ButtonGroup(); currentUser = new JRadioButton(parent.langpack .getString("ShortcutPanel.regular.currentUser"), !isRootUser); currentUser.addActionListener(this); usersGroup.add(currentUser); usersPanel.add(currentUser); allUsers = new JRadioButton( parent.langpack.getString("ShortcutPanel.regular.allUsers"), isRootUser); if (!isRootUser) allUsers.setEnabled(false); allUsers.addActionListener(this); usersGroup.add(allUsers); usersPanel.add(allUsers); TitledBorder border = new TitledBorder(new EmptyBorder(2, 2, 2, 2), parent.langpack .getString("ShortcutPanel.regular.userIntro")); usersPanel.setBorder(border); constraints.gridx = 2; constraints.gridy = 4; constraints.gridwidth = 1; constraints.gridheight = 1; constraints.weighty = 1.0; constraints.weightx = 1.0; constraints.fill = GridBagConstraints.NONE; layout.addLayoutComponent(usersPanel, constraints); add(usersPanel); } // ---------------------------------------------------- // edit box that contains the suggested program group // name, which can be modfied or substituted from the // list by the user // ---------------------------------------------------- programGroup = new JTextField(suggestedProgramGroup, 40); // 40? constraints.gridx = 0; constraints.gridy = 5; constraints.gridwidth = 2; constraints.gridheight = 1; constraints.weighty = 1.0; constraints.weightx = 10.0; constraints.fill = GridBagConstraints.HORIZONTAL; layout.addLayoutComponent(programGroup, constraints); add(programGroup); // ---------------------------------------------------- // reset button that allows the user to revert to the // original suggestion for the program group // ---------------------------------------------------- defaultButton = ButtonFactory.createButton(parent.langpack .getString("ShortcutPanel.regular.default"), idata.buttonsHColor); defaultButton.addActionListener(this); constraints.gridx = 2; constraints.gridy = 5; constraints.gridwidth = 1; constraints.gridheight = 1; constraints.fill = GridBagConstraints.NONE; layout.addLayoutComponent(defaultButton, constraints); add(defaultButton); } | 54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/ea2c1c334b491cd6926af6502699f487604c17bc/ShortcutPanel.java/clean/src/lib/com/izforge/izpack/panels/ShortcutPanel.java |
JLabel listLabel = LabelFactory.create(parent.langpack.getString("ShortcutPanel.regular.list"), | listLabel = LabelFactory.create(parent.langpack.getString("ShortcutPanel.regular.list"), | private void buildUI(File groups) { File itsProgramFolder = groups; constraints.gridx = 0; constraints.gridy = 0; constraints.gridwidth = 3; constraints.gridheight = 1; constraints.weightx = 1.0; constraints.weighty = 1.0; constraints.fill = GridBagConstraints.HORIZONTAL; constraints.anchor = GridBagConstraints.WEST; /**/ // Add a CheckBox which enables the user to entirely supress shortcut creation. String menuKind = parent.langpack.getString("ShortcutPanel.regular.StartMenu:Start-Menu"); if( OsVersion.IS_UNIX && UnixHelper.kdeIsInstalled() ) menuKind = parent.langpack.getString("ShortcutPanel.regular.StartMenu:K-Menu"); createShortcuts = new JCheckBox( StringTool.replace( parent.langpack.getString("ShortcutPanel.regular.create"), "StartMenu", menuKind ), true); createShortcuts.addActionListener(this); constraints.gridx = 0; constraints.gridy = 1; constraints.gridwidth = 2; constraints.gridheight = 1; constraints.weighty = 0.2; layout.addLayoutComponent(createShortcuts, constraints); add(createShortcuts); // ---------------------------------------------------- // check box to allow the user to decide if a desktop // shortcut should be created. // this should only be created if needed and requested // in the definition file. // ---------------------------------------------------- if (hasDesktopShortcuts) { String initialAllowedValue = idata.getVariable( "DesktopShortcutCheckboxEnabled" ); boolean initialAllowedFlag = false; if( initialAllowedValue==null) initialAllowedFlag= false; else if( Boolean.TRUE.toString().equals(initialAllowedValue) ) initialAllowedFlag=true; allowDesktopShortcut = new JCheckBox(parent.langpack .getString("ShortcutPanel.regular.desktop"), initialAllowedFlag); constraints.gridx = 0; constraints.gridy = 2; constraints.gridwidth = 3; constraints.gridheight = 1; constraints.weighty = 0.2; layout.addLayoutComponent(allowDesktopShortcut, constraints); add(allowDesktopShortcut); } JLabel listLabel = LabelFactory.create(parent.langpack.getString("ShortcutPanel.regular.list"), JLabel.LEADING); constraints.gridx = 0; constraints.gridy = 3; constraints.gridwidth = 1; constraints.gridheight = 1; constraints.weightx = 0.2; constraints.weighty = 0.2; constraints.fill = GridBagConstraints.NONE; constraints.anchor = GridBagConstraints.WEST; layout.addLayoutComponent(listLabel, constraints); add(listLabel); // ---------------------------------------------------- // list box to list all of already existing folders as program groups // at the intended destination // ---------------------------------------------------- addSelectionList( groups, 0, 4, 2, 1, GridBagConstraints.BOTH ); // ---------------------------------------------------- // radio buttons to select current user or all users. // ---------------------------------------------------- if (shortcut.multipleUsers()) { JPanel usersPanel = new JPanel(new GridLayout(2, 1)); ButtonGroup usersGroup = new ButtonGroup(); currentUser = new JRadioButton(parent.langpack .getString("ShortcutPanel.regular.currentUser"), !isRootUser); currentUser.addActionListener(this); usersGroup.add(currentUser); usersPanel.add(currentUser); allUsers = new JRadioButton( parent.langpack.getString("ShortcutPanel.regular.allUsers"), isRootUser); if (!isRootUser) allUsers.setEnabled(false); allUsers.addActionListener(this); usersGroup.add(allUsers); usersPanel.add(allUsers); TitledBorder border = new TitledBorder(new EmptyBorder(2, 2, 2, 2), parent.langpack .getString("ShortcutPanel.regular.userIntro")); usersPanel.setBorder(border); constraints.gridx = 2; constraints.gridy = 4; constraints.gridwidth = 1; constraints.gridheight = 1; constraints.weighty = 1.0; constraints.weightx = 1.0; constraints.fill = GridBagConstraints.NONE; layout.addLayoutComponent(usersPanel, constraints); add(usersPanel); } // ---------------------------------------------------- // edit box that contains the suggested program group // name, which can be modfied or substituted from the // list by the user // ---------------------------------------------------- programGroup = new JTextField(suggestedProgramGroup, 40); // 40? constraints.gridx = 0; constraints.gridy = 5; constraints.gridwidth = 2; constraints.gridheight = 1; constraints.weighty = 1.0; constraints.weightx = 10.0; constraints.fill = GridBagConstraints.HORIZONTAL; layout.addLayoutComponent(programGroup, constraints); add(programGroup); // ---------------------------------------------------- // reset button that allows the user to revert to the // original suggestion for the program group // ---------------------------------------------------- defaultButton = ButtonFactory.createButton(parent.langpack .getString("ShortcutPanel.regular.default"), idata.buttonsHColor); defaultButton.addActionListener(this); constraints.gridx = 2; constraints.gridy = 5; constraints.gridwidth = 1; constraints.gridheight = 1; constraints.fill = GridBagConstraints.NONE; layout.addLayoutComponent(defaultButton, constraints); add(defaultButton); } | 54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/ea2c1c334b491cd6926af6502699f487604c17bc/ShortcutPanel.java/clean/src/lib/com/izforge/izpack/panels/ShortcutPanel.java |
constraints.gridx = 0; constraints.gridy = 3; | constraints.gridx = col; constraints.gridy = line + 3; | private void buildUI(File groups) { File itsProgramFolder = groups; constraints.gridx = 0; constraints.gridy = 0; constraints.gridwidth = 3; constraints.gridheight = 1; constraints.weightx = 1.0; constraints.weighty = 1.0; constraints.fill = GridBagConstraints.HORIZONTAL; constraints.anchor = GridBagConstraints.WEST; /**/ // Add a CheckBox which enables the user to entirely supress shortcut creation. String menuKind = parent.langpack.getString("ShortcutPanel.regular.StartMenu:Start-Menu"); if( OsVersion.IS_UNIX && UnixHelper.kdeIsInstalled() ) menuKind = parent.langpack.getString("ShortcutPanel.regular.StartMenu:K-Menu"); createShortcuts = new JCheckBox( StringTool.replace( parent.langpack.getString("ShortcutPanel.regular.create"), "StartMenu", menuKind ), true); createShortcuts.addActionListener(this); constraints.gridx = 0; constraints.gridy = 1; constraints.gridwidth = 2; constraints.gridheight = 1; constraints.weighty = 0.2; layout.addLayoutComponent(createShortcuts, constraints); add(createShortcuts); // ---------------------------------------------------- // check box to allow the user to decide if a desktop // shortcut should be created. // this should only be created if needed and requested // in the definition file. // ---------------------------------------------------- if (hasDesktopShortcuts) { String initialAllowedValue = idata.getVariable( "DesktopShortcutCheckboxEnabled" ); boolean initialAllowedFlag = false; if( initialAllowedValue==null) initialAllowedFlag= false; else if( Boolean.TRUE.toString().equals(initialAllowedValue) ) initialAllowedFlag=true; allowDesktopShortcut = new JCheckBox(parent.langpack .getString("ShortcutPanel.regular.desktop"), initialAllowedFlag); constraints.gridx = 0; constraints.gridy = 2; constraints.gridwidth = 3; constraints.gridheight = 1; constraints.weighty = 0.2; layout.addLayoutComponent(allowDesktopShortcut, constraints); add(allowDesktopShortcut); } JLabel listLabel = LabelFactory.create(parent.langpack.getString("ShortcutPanel.regular.list"), JLabel.LEADING); constraints.gridx = 0; constraints.gridy = 3; constraints.gridwidth = 1; constraints.gridheight = 1; constraints.weightx = 0.2; constraints.weighty = 0.2; constraints.fill = GridBagConstraints.NONE; constraints.anchor = GridBagConstraints.WEST; layout.addLayoutComponent(listLabel, constraints); add(listLabel); // ---------------------------------------------------- // list box to list all of already existing folders as program groups // at the intended destination // ---------------------------------------------------- addSelectionList( groups, 0, 4, 2, 1, GridBagConstraints.BOTH ); // ---------------------------------------------------- // radio buttons to select current user or all users. // ---------------------------------------------------- if (shortcut.multipleUsers()) { JPanel usersPanel = new JPanel(new GridLayout(2, 1)); ButtonGroup usersGroup = new ButtonGroup(); currentUser = new JRadioButton(parent.langpack .getString("ShortcutPanel.regular.currentUser"), !isRootUser); currentUser.addActionListener(this); usersGroup.add(currentUser); usersPanel.add(currentUser); allUsers = new JRadioButton( parent.langpack.getString("ShortcutPanel.regular.allUsers"), isRootUser); if (!isRootUser) allUsers.setEnabled(false); allUsers.addActionListener(this); usersGroup.add(allUsers); usersPanel.add(allUsers); TitledBorder border = new TitledBorder(new EmptyBorder(2, 2, 2, 2), parent.langpack .getString("ShortcutPanel.regular.userIntro")); usersPanel.setBorder(border); constraints.gridx = 2; constraints.gridy = 4; constraints.gridwidth = 1; constraints.gridheight = 1; constraints.weighty = 1.0; constraints.weightx = 1.0; constraints.fill = GridBagConstraints.NONE; layout.addLayoutComponent(usersPanel, constraints); add(usersPanel); } // ---------------------------------------------------- // edit box that contains the suggested program group // name, which can be modfied or substituted from the // list by the user // ---------------------------------------------------- programGroup = new JTextField(suggestedProgramGroup, 40); // 40? constraints.gridx = 0; constraints.gridy = 5; constraints.gridwidth = 2; constraints.gridheight = 1; constraints.weighty = 1.0; constraints.weightx = 10.0; constraints.fill = GridBagConstraints.HORIZONTAL; layout.addLayoutComponent(programGroup, constraints); add(programGroup); // ---------------------------------------------------- // reset button that allows the user to revert to the // original suggestion for the program group // ---------------------------------------------------- defaultButton = ButtonFactory.createButton(parent.langpack .getString("ShortcutPanel.regular.default"), idata.buttonsHColor); defaultButton.addActionListener(this); constraints.gridx = 2; constraints.gridy = 5; constraints.gridwidth = 1; constraints.gridheight = 1; constraints.fill = GridBagConstraints.NONE; layout.addLayoutComponent(defaultButton, constraints); add(defaultButton); } | 54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/ea2c1c334b491cd6926af6502699f487604c17bc/ShortcutPanel.java/clean/src/lib/com/izforge/izpack/panels/ShortcutPanel.java |
constraints.weightx = 0.2; constraints.weighty = 0.2; constraints.fill = GridBagConstraints.NONE; constraints.anchor = GridBagConstraints.WEST; | constraints.insets = new Insets(10, 10, 0, 0); constraints.fill = GridBagConstraints.HORIZONTAL; constraints.anchor = GridBagConstraints.NORTHWEST; | private void buildUI(File groups) { File itsProgramFolder = groups; constraints.gridx = 0; constraints.gridy = 0; constraints.gridwidth = 3; constraints.gridheight = 1; constraints.weightx = 1.0; constraints.weighty = 1.0; constraints.fill = GridBagConstraints.HORIZONTAL; constraints.anchor = GridBagConstraints.WEST; /**/ // Add a CheckBox which enables the user to entirely supress shortcut creation. String menuKind = parent.langpack.getString("ShortcutPanel.regular.StartMenu:Start-Menu"); if( OsVersion.IS_UNIX && UnixHelper.kdeIsInstalled() ) menuKind = parent.langpack.getString("ShortcutPanel.regular.StartMenu:K-Menu"); createShortcuts = new JCheckBox( StringTool.replace( parent.langpack.getString("ShortcutPanel.regular.create"), "StartMenu", menuKind ), true); createShortcuts.addActionListener(this); constraints.gridx = 0; constraints.gridy = 1; constraints.gridwidth = 2; constraints.gridheight = 1; constraints.weighty = 0.2; layout.addLayoutComponent(createShortcuts, constraints); add(createShortcuts); // ---------------------------------------------------- // check box to allow the user to decide if a desktop // shortcut should be created. // this should only be created if needed and requested // in the definition file. // ---------------------------------------------------- if (hasDesktopShortcuts) { String initialAllowedValue = idata.getVariable( "DesktopShortcutCheckboxEnabled" ); boolean initialAllowedFlag = false; if( initialAllowedValue==null) initialAllowedFlag= false; else if( Boolean.TRUE.toString().equals(initialAllowedValue) ) initialAllowedFlag=true; allowDesktopShortcut = new JCheckBox(parent.langpack .getString("ShortcutPanel.regular.desktop"), initialAllowedFlag); constraints.gridx = 0; constraints.gridy = 2; constraints.gridwidth = 3; constraints.gridheight = 1; constraints.weighty = 0.2; layout.addLayoutComponent(allowDesktopShortcut, constraints); add(allowDesktopShortcut); } JLabel listLabel = LabelFactory.create(parent.langpack.getString("ShortcutPanel.regular.list"), JLabel.LEADING); constraints.gridx = 0; constraints.gridy = 3; constraints.gridwidth = 1; constraints.gridheight = 1; constraints.weightx = 0.2; constraints.weighty = 0.2; constraints.fill = GridBagConstraints.NONE; constraints.anchor = GridBagConstraints.WEST; layout.addLayoutComponent(listLabel, constraints); add(listLabel); // ---------------------------------------------------- // list box to list all of already existing folders as program groups // at the intended destination // ---------------------------------------------------- addSelectionList( groups, 0, 4, 2, 1, GridBagConstraints.BOTH ); // ---------------------------------------------------- // radio buttons to select current user or all users. // ---------------------------------------------------- if (shortcut.multipleUsers()) { JPanel usersPanel = new JPanel(new GridLayout(2, 1)); ButtonGroup usersGroup = new ButtonGroup(); currentUser = new JRadioButton(parent.langpack .getString("ShortcutPanel.regular.currentUser"), !isRootUser); currentUser.addActionListener(this); usersGroup.add(currentUser); usersPanel.add(currentUser); allUsers = new JRadioButton( parent.langpack.getString("ShortcutPanel.regular.allUsers"), isRootUser); if (!isRootUser) allUsers.setEnabled(false); allUsers.addActionListener(this); usersGroup.add(allUsers); usersPanel.add(allUsers); TitledBorder border = new TitledBorder(new EmptyBorder(2, 2, 2, 2), parent.langpack .getString("ShortcutPanel.regular.userIntro")); usersPanel.setBorder(border); constraints.gridx = 2; constraints.gridy = 4; constraints.gridwidth = 1; constraints.gridheight = 1; constraints.weighty = 1.0; constraints.weightx = 1.0; constraints.fill = GridBagConstraints.NONE; layout.addLayoutComponent(usersPanel, constraints); add(usersPanel); } // ---------------------------------------------------- // edit box that contains the suggested program group // name, which can be modfied or substituted from the // list by the user // ---------------------------------------------------- programGroup = new JTextField(suggestedProgramGroup, 40); // 40? constraints.gridx = 0; constraints.gridy = 5; constraints.gridwidth = 2; constraints.gridheight = 1; constraints.weighty = 1.0; constraints.weightx = 10.0; constraints.fill = GridBagConstraints.HORIZONTAL; layout.addLayoutComponent(programGroup, constraints); add(programGroup); // ---------------------------------------------------- // reset button that allows the user to revert to the // original suggestion for the program group // ---------------------------------------------------- defaultButton = ButtonFactory.createButton(parent.langpack .getString("ShortcutPanel.regular.default"), idata.buttonsHColor); defaultButton.addActionListener(this); constraints.gridx = 2; constraints.gridy = 5; constraints.gridwidth = 1; constraints.gridheight = 1; constraints.fill = GridBagConstraints.NONE; layout.addLayoutComponent(defaultButton, constraints); add(defaultButton); } | 54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/ea2c1c334b491cd6926af6502699f487604c17bc/ShortcutPanel.java/clean/src/lib/com/izforge/izpack/panels/ShortcutPanel.java |
addSelectionList( groups, 0, 4, 2, 1, GridBagConstraints.BOTH ); | Vector dirEntries = new Vector(); File[] entries = groups.listFiles(); if (entries != null) { for (int idx = 0; idx < entries.length; idx++) { if (entries[idx].isDirectory()) { dirEntries.add(entries[idx].getName()); } } } if (groupList == null) { groupList = new JList(); } groupList = addList(dirEntries, ListSelectionModel.SINGLE_SELECTION, groupList, col, line + 4, 1, 1, GridBagConstraints.BOTH); | private void buildUI(File groups) { File itsProgramFolder = groups; constraints.gridx = 0; constraints.gridy = 0; constraints.gridwidth = 3; constraints.gridheight = 1; constraints.weightx = 1.0; constraints.weighty = 1.0; constraints.fill = GridBagConstraints.HORIZONTAL; constraints.anchor = GridBagConstraints.WEST; /**/ // Add a CheckBox which enables the user to entirely supress shortcut creation. String menuKind = parent.langpack.getString("ShortcutPanel.regular.StartMenu:Start-Menu"); if( OsVersion.IS_UNIX && UnixHelper.kdeIsInstalled() ) menuKind = parent.langpack.getString("ShortcutPanel.regular.StartMenu:K-Menu"); createShortcuts = new JCheckBox( StringTool.replace( parent.langpack.getString("ShortcutPanel.regular.create"), "StartMenu", menuKind ), true); createShortcuts.addActionListener(this); constraints.gridx = 0; constraints.gridy = 1; constraints.gridwidth = 2; constraints.gridheight = 1; constraints.weighty = 0.2; layout.addLayoutComponent(createShortcuts, constraints); add(createShortcuts); // ---------------------------------------------------- // check box to allow the user to decide if a desktop // shortcut should be created. // this should only be created if needed and requested // in the definition file. // ---------------------------------------------------- if (hasDesktopShortcuts) { String initialAllowedValue = idata.getVariable( "DesktopShortcutCheckboxEnabled" ); boolean initialAllowedFlag = false; if( initialAllowedValue==null) initialAllowedFlag= false; else if( Boolean.TRUE.toString().equals(initialAllowedValue) ) initialAllowedFlag=true; allowDesktopShortcut = new JCheckBox(parent.langpack .getString("ShortcutPanel.regular.desktop"), initialAllowedFlag); constraints.gridx = 0; constraints.gridy = 2; constraints.gridwidth = 3; constraints.gridheight = 1; constraints.weighty = 0.2; layout.addLayoutComponent(allowDesktopShortcut, constraints); add(allowDesktopShortcut); } JLabel listLabel = LabelFactory.create(parent.langpack.getString("ShortcutPanel.regular.list"), JLabel.LEADING); constraints.gridx = 0; constraints.gridy = 3; constraints.gridwidth = 1; constraints.gridheight = 1; constraints.weightx = 0.2; constraints.weighty = 0.2; constraints.fill = GridBagConstraints.NONE; constraints.anchor = GridBagConstraints.WEST; layout.addLayoutComponent(listLabel, constraints); add(listLabel); // ---------------------------------------------------- // list box to list all of already existing folders as program groups // at the intended destination // ---------------------------------------------------- addSelectionList( groups, 0, 4, 2, 1, GridBagConstraints.BOTH ); // ---------------------------------------------------- // radio buttons to select current user or all users. // ---------------------------------------------------- if (shortcut.multipleUsers()) { JPanel usersPanel = new JPanel(new GridLayout(2, 1)); ButtonGroup usersGroup = new ButtonGroup(); currentUser = new JRadioButton(parent.langpack .getString("ShortcutPanel.regular.currentUser"), !isRootUser); currentUser.addActionListener(this); usersGroup.add(currentUser); usersPanel.add(currentUser); allUsers = new JRadioButton( parent.langpack.getString("ShortcutPanel.regular.allUsers"), isRootUser); if (!isRootUser) allUsers.setEnabled(false); allUsers.addActionListener(this); usersGroup.add(allUsers); usersPanel.add(allUsers); TitledBorder border = new TitledBorder(new EmptyBorder(2, 2, 2, 2), parent.langpack .getString("ShortcutPanel.regular.userIntro")); usersPanel.setBorder(border); constraints.gridx = 2; constraints.gridy = 4; constraints.gridwidth = 1; constraints.gridheight = 1; constraints.weighty = 1.0; constraints.weightx = 1.0; constraints.fill = GridBagConstraints.NONE; layout.addLayoutComponent(usersPanel, constraints); add(usersPanel); } // ---------------------------------------------------- // edit box that contains the suggested program group // name, which can be modfied or substituted from the // list by the user // ---------------------------------------------------- programGroup = new JTextField(suggestedProgramGroup, 40); // 40? constraints.gridx = 0; constraints.gridy = 5; constraints.gridwidth = 2; constraints.gridheight = 1; constraints.weighty = 1.0; constraints.weightx = 10.0; constraints.fill = GridBagConstraints.HORIZONTAL; layout.addLayoutComponent(programGroup, constraints); add(programGroup); // ---------------------------------------------------- // reset button that allows the user to revert to the // original suggestion for the program group // ---------------------------------------------------- defaultButton = ButtonFactory.createButton(parent.langpack .getString("ShortcutPanel.regular.default"), idata.buttonsHColor); defaultButton.addActionListener(this); constraints.gridx = 2; constraints.gridy = 5; constraints.gridwidth = 1; constraints.gridheight = 1; constraints.fill = GridBagConstraints.NONE; layout.addLayoutComponent(defaultButton, constraints); add(defaultButton); } | 54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/ea2c1c334b491cd6926af6502699f487604c17bc/ShortcutPanel.java/clean/src/lib/com/izforge/izpack/panels/ShortcutPanel.java |
if (!isRootUser) allUsers.setEnabled(false); | if (!isRootUser) { allUsers.setEnabled(false); } | private void buildUI(File groups) { File itsProgramFolder = groups; constraints.gridx = 0; constraints.gridy = 0; constraints.gridwidth = 3; constraints.gridheight = 1; constraints.weightx = 1.0; constraints.weighty = 1.0; constraints.fill = GridBagConstraints.HORIZONTAL; constraints.anchor = GridBagConstraints.WEST; /**/ // Add a CheckBox which enables the user to entirely supress shortcut creation. String menuKind = parent.langpack.getString("ShortcutPanel.regular.StartMenu:Start-Menu"); if( OsVersion.IS_UNIX && UnixHelper.kdeIsInstalled() ) menuKind = parent.langpack.getString("ShortcutPanel.regular.StartMenu:K-Menu"); createShortcuts = new JCheckBox( StringTool.replace( parent.langpack.getString("ShortcutPanel.regular.create"), "StartMenu", menuKind ), true); createShortcuts.addActionListener(this); constraints.gridx = 0; constraints.gridy = 1; constraints.gridwidth = 2; constraints.gridheight = 1; constraints.weighty = 0.2; layout.addLayoutComponent(createShortcuts, constraints); add(createShortcuts); // ---------------------------------------------------- // check box to allow the user to decide if a desktop // shortcut should be created. // this should only be created if needed and requested // in the definition file. // ---------------------------------------------------- if (hasDesktopShortcuts) { String initialAllowedValue = idata.getVariable( "DesktopShortcutCheckboxEnabled" ); boolean initialAllowedFlag = false; if( initialAllowedValue==null) initialAllowedFlag= false; else if( Boolean.TRUE.toString().equals(initialAllowedValue) ) initialAllowedFlag=true; allowDesktopShortcut = new JCheckBox(parent.langpack .getString("ShortcutPanel.regular.desktop"), initialAllowedFlag); constraints.gridx = 0; constraints.gridy = 2; constraints.gridwidth = 3; constraints.gridheight = 1; constraints.weighty = 0.2; layout.addLayoutComponent(allowDesktopShortcut, constraints); add(allowDesktopShortcut); } JLabel listLabel = LabelFactory.create(parent.langpack.getString("ShortcutPanel.regular.list"), JLabel.LEADING); constraints.gridx = 0; constraints.gridy = 3; constraints.gridwidth = 1; constraints.gridheight = 1; constraints.weightx = 0.2; constraints.weighty = 0.2; constraints.fill = GridBagConstraints.NONE; constraints.anchor = GridBagConstraints.WEST; layout.addLayoutComponent(listLabel, constraints); add(listLabel); // ---------------------------------------------------- // list box to list all of already existing folders as program groups // at the intended destination // ---------------------------------------------------- addSelectionList( groups, 0, 4, 2, 1, GridBagConstraints.BOTH ); // ---------------------------------------------------- // radio buttons to select current user or all users. // ---------------------------------------------------- if (shortcut.multipleUsers()) { JPanel usersPanel = new JPanel(new GridLayout(2, 1)); ButtonGroup usersGroup = new ButtonGroup(); currentUser = new JRadioButton(parent.langpack .getString("ShortcutPanel.regular.currentUser"), !isRootUser); currentUser.addActionListener(this); usersGroup.add(currentUser); usersPanel.add(currentUser); allUsers = new JRadioButton( parent.langpack.getString("ShortcutPanel.regular.allUsers"), isRootUser); if (!isRootUser) allUsers.setEnabled(false); allUsers.addActionListener(this); usersGroup.add(allUsers); usersPanel.add(allUsers); TitledBorder border = new TitledBorder(new EmptyBorder(2, 2, 2, 2), parent.langpack .getString("ShortcutPanel.regular.userIntro")); usersPanel.setBorder(border); constraints.gridx = 2; constraints.gridy = 4; constraints.gridwidth = 1; constraints.gridheight = 1; constraints.weighty = 1.0; constraints.weightx = 1.0; constraints.fill = GridBagConstraints.NONE; layout.addLayoutComponent(usersPanel, constraints); add(usersPanel); } // ---------------------------------------------------- // edit box that contains the suggested program group // name, which can be modfied or substituted from the // list by the user // ---------------------------------------------------- programGroup = new JTextField(suggestedProgramGroup, 40); // 40? constraints.gridx = 0; constraints.gridy = 5; constraints.gridwidth = 2; constraints.gridheight = 1; constraints.weighty = 1.0; constraints.weightx = 10.0; constraints.fill = GridBagConstraints.HORIZONTAL; layout.addLayoutComponent(programGroup, constraints); add(programGroup); // ---------------------------------------------------- // reset button that allows the user to revert to the // original suggestion for the program group // ---------------------------------------------------- defaultButton = ButtonFactory.createButton(parent.langpack .getString("ShortcutPanel.regular.default"), idata.buttonsHColor); defaultButton.addActionListener(this); constraints.gridx = 2; constraints.gridy = 5; constraints.gridwidth = 1; constraints.gridheight = 1; constraints.fill = GridBagConstraints.NONE; layout.addLayoutComponent(defaultButton, constraints); add(defaultButton); } | 54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/ea2c1c334b491cd6926af6502699f487604c17bc/ShortcutPanel.java/clean/src/lib/com/izforge/izpack/panels/ShortcutPanel.java |
constraints.gridx = 2; constraints.gridy = 4; | constraints.gridx = col + 1; constraints.gridy = line + 4; | private void buildUI(File groups) { File itsProgramFolder = groups; constraints.gridx = 0; constraints.gridy = 0; constraints.gridwidth = 3; constraints.gridheight = 1; constraints.weightx = 1.0; constraints.weighty = 1.0; constraints.fill = GridBagConstraints.HORIZONTAL; constraints.anchor = GridBagConstraints.WEST; /**/ // Add a CheckBox which enables the user to entirely supress shortcut creation. String menuKind = parent.langpack.getString("ShortcutPanel.regular.StartMenu:Start-Menu"); if( OsVersion.IS_UNIX && UnixHelper.kdeIsInstalled() ) menuKind = parent.langpack.getString("ShortcutPanel.regular.StartMenu:K-Menu"); createShortcuts = new JCheckBox( StringTool.replace( parent.langpack.getString("ShortcutPanel.regular.create"), "StartMenu", menuKind ), true); createShortcuts.addActionListener(this); constraints.gridx = 0; constraints.gridy = 1; constraints.gridwidth = 2; constraints.gridheight = 1; constraints.weighty = 0.2; layout.addLayoutComponent(createShortcuts, constraints); add(createShortcuts); // ---------------------------------------------------- // check box to allow the user to decide if a desktop // shortcut should be created. // this should only be created if needed and requested // in the definition file. // ---------------------------------------------------- if (hasDesktopShortcuts) { String initialAllowedValue = idata.getVariable( "DesktopShortcutCheckboxEnabled" ); boolean initialAllowedFlag = false; if( initialAllowedValue==null) initialAllowedFlag= false; else if( Boolean.TRUE.toString().equals(initialAllowedValue) ) initialAllowedFlag=true; allowDesktopShortcut = new JCheckBox(parent.langpack .getString("ShortcutPanel.regular.desktop"), initialAllowedFlag); constraints.gridx = 0; constraints.gridy = 2; constraints.gridwidth = 3; constraints.gridheight = 1; constraints.weighty = 0.2; layout.addLayoutComponent(allowDesktopShortcut, constraints); add(allowDesktopShortcut); } JLabel listLabel = LabelFactory.create(parent.langpack.getString("ShortcutPanel.regular.list"), JLabel.LEADING); constraints.gridx = 0; constraints.gridy = 3; constraints.gridwidth = 1; constraints.gridheight = 1; constraints.weightx = 0.2; constraints.weighty = 0.2; constraints.fill = GridBagConstraints.NONE; constraints.anchor = GridBagConstraints.WEST; layout.addLayoutComponent(listLabel, constraints); add(listLabel); // ---------------------------------------------------- // list box to list all of already existing folders as program groups // at the intended destination // ---------------------------------------------------- addSelectionList( groups, 0, 4, 2, 1, GridBagConstraints.BOTH ); // ---------------------------------------------------- // radio buttons to select current user or all users. // ---------------------------------------------------- if (shortcut.multipleUsers()) { JPanel usersPanel = new JPanel(new GridLayout(2, 1)); ButtonGroup usersGroup = new ButtonGroup(); currentUser = new JRadioButton(parent.langpack .getString("ShortcutPanel.regular.currentUser"), !isRootUser); currentUser.addActionListener(this); usersGroup.add(currentUser); usersPanel.add(currentUser); allUsers = new JRadioButton( parent.langpack.getString("ShortcutPanel.regular.allUsers"), isRootUser); if (!isRootUser) allUsers.setEnabled(false); allUsers.addActionListener(this); usersGroup.add(allUsers); usersPanel.add(allUsers); TitledBorder border = new TitledBorder(new EmptyBorder(2, 2, 2, 2), parent.langpack .getString("ShortcutPanel.regular.userIntro")); usersPanel.setBorder(border); constraints.gridx = 2; constraints.gridy = 4; constraints.gridwidth = 1; constraints.gridheight = 1; constraints.weighty = 1.0; constraints.weightx = 1.0; constraints.fill = GridBagConstraints.NONE; layout.addLayoutComponent(usersPanel, constraints); add(usersPanel); } // ---------------------------------------------------- // edit box that contains the suggested program group // name, which can be modfied or substituted from the // list by the user // ---------------------------------------------------- programGroup = new JTextField(suggestedProgramGroup, 40); // 40? constraints.gridx = 0; constraints.gridy = 5; constraints.gridwidth = 2; constraints.gridheight = 1; constraints.weighty = 1.0; constraints.weightx = 10.0; constraints.fill = GridBagConstraints.HORIZONTAL; layout.addLayoutComponent(programGroup, constraints); add(programGroup); // ---------------------------------------------------- // reset button that allows the user to revert to the // original suggestion for the program group // ---------------------------------------------------- defaultButton = ButtonFactory.createButton(parent.langpack .getString("ShortcutPanel.regular.default"), idata.buttonsHColor); defaultButton.addActionListener(this); constraints.gridx = 2; constraints.gridy = 5; constraints.gridwidth = 1; constraints.gridheight = 1; constraints.fill = GridBagConstraints.NONE; layout.addLayoutComponent(defaultButton, constraints); add(defaultButton); } | 54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/ea2c1c334b491cd6926af6502699f487604c17bc/ShortcutPanel.java/clean/src/lib/com/izforge/izpack/panels/ShortcutPanel.java |
constraints.weighty = 1.0; constraints.weightx = 1.0; constraints.fill = GridBagConstraints.NONE; | constraints.fill = GridBagConstraints.HORIZONTAL; | private void buildUI(File groups) { File itsProgramFolder = groups; constraints.gridx = 0; constraints.gridy = 0; constraints.gridwidth = 3; constraints.gridheight = 1; constraints.weightx = 1.0; constraints.weighty = 1.0; constraints.fill = GridBagConstraints.HORIZONTAL; constraints.anchor = GridBagConstraints.WEST; /**/ // Add a CheckBox which enables the user to entirely supress shortcut creation. String menuKind = parent.langpack.getString("ShortcutPanel.regular.StartMenu:Start-Menu"); if( OsVersion.IS_UNIX && UnixHelper.kdeIsInstalled() ) menuKind = parent.langpack.getString("ShortcutPanel.regular.StartMenu:K-Menu"); createShortcuts = new JCheckBox( StringTool.replace( parent.langpack.getString("ShortcutPanel.regular.create"), "StartMenu", menuKind ), true); createShortcuts.addActionListener(this); constraints.gridx = 0; constraints.gridy = 1; constraints.gridwidth = 2; constraints.gridheight = 1; constraints.weighty = 0.2; layout.addLayoutComponent(createShortcuts, constraints); add(createShortcuts); // ---------------------------------------------------- // check box to allow the user to decide if a desktop // shortcut should be created. // this should only be created if needed and requested // in the definition file. // ---------------------------------------------------- if (hasDesktopShortcuts) { String initialAllowedValue = idata.getVariable( "DesktopShortcutCheckboxEnabled" ); boolean initialAllowedFlag = false; if( initialAllowedValue==null) initialAllowedFlag= false; else if( Boolean.TRUE.toString().equals(initialAllowedValue) ) initialAllowedFlag=true; allowDesktopShortcut = new JCheckBox(parent.langpack .getString("ShortcutPanel.regular.desktop"), initialAllowedFlag); constraints.gridx = 0; constraints.gridy = 2; constraints.gridwidth = 3; constraints.gridheight = 1; constraints.weighty = 0.2; layout.addLayoutComponent(allowDesktopShortcut, constraints); add(allowDesktopShortcut); } JLabel listLabel = LabelFactory.create(parent.langpack.getString("ShortcutPanel.regular.list"), JLabel.LEADING); constraints.gridx = 0; constraints.gridy = 3; constraints.gridwidth = 1; constraints.gridheight = 1; constraints.weightx = 0.2; constraints.weighty = 0.2; constraints.fill = GridBagConstraints.NONE; constraints.anchor = GridBagConstraints.WEST; layout.addLayoutComponent(listLabel, constraints); add(listLabel); // ---------------------------------------------------- // list box to list all of already existing folders as program groups // at the intended destination // ---------------------------------------------------- addSelectionList( groups, 0, 4, 2, 1, GridBagConstraints.BOTH ); // ---------------------------------------------------- // radio buttons to select current user or all users. // ---------------------------------------------------- if (shortcut.multipleUsers()) { JPanel usersPanel = new JPanel(new GridLayout(2, 1)); ButtonGroup usersGroup = new ButtonGroup(); currentUser = new JRadioButton(parent.langpack .getString("ShortcutPanel.regular.currentUser"), !isRootUser); currentUser.addActionListener(this); usersGroup.add(currentUser); usersPanel.add(currentUser); allUsers = new JRadioButton( parent.langpack.getString("ShortcutPanel.regular.allUsers"), isRootUser); if (!isRootUser) allUsers.setEnabled(false); allUsers.addActionListener(this); usersGroup.add(allUsers); usersPanel.add(allUsers); TitledBorder border = new TitledBorder(new EmptyBorder(2, 2, 2, 2), parent.langpack .getString("ShortcutPanel.regular.userIntro")); usersPanel.setBorder(border); constraints.gridx = 2; constraints.gridy = 4; constraints.gridwidth = 1; constraints.gridheight = 1; constraints.weighty = 1.0; constraints.weightx = 1.0; constraints.fill = GridBagConstraints.NONE; layout.addLayoutComponent(usersPanel, constraints); add(usersPanel); } // ---------------------------------------------------- // edit box that contains the suggested program group // name, which can be modfied or substituted from the // list by the user // ---------------------------------------------------- programGroup = new JTextField(suggestedProgramGroup, 40); // 40? constraints.gridx = 0; constraints.gridy = 5; constraints.gridwidth = 2; constraints.gridheight = 1; constraints.weighty = 1.0; constraints.weightx = 10.0; constraints.fill = GridBagConstraints.HORIZONTAL; layout.addLayoutComponent(programGroup, constraints); add(programGroup); // ---------------------------------------------------- // reset button that allows the user to revert to the // original suggestion for the program group // ---------------------------------------------------- defaultButton = ButtonFactory.createButton(parent.langpack .getString("ShortcutPanel.regular.default"), idata.buttonsHColor); defaultButton.addActionListener(this); constraints.gridx = 2; constraints.gridy = 5; constraints.gridwidth = 1; constraints.gridheight = 1; constraints.fill = GridBagConstraints.NONE; layout.addLayoutComponent(defaultButton, constraints); add(defaultButton); } | 54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/ea2c1c334b491cd6926af6502699f487604c17bc/ShortcutPanel.java/clean/src/lib/com/izforge/izpack/panels/ShortcutPanel.java |
constraints.gridx = 0; constraints.gridy = 5; constraints.gridwidth = 2; | constraints.gridx = col; constraints.gridy = line + 5; constraints.gridwidth = 1; | private void buildUI(File groups) { File itsProgramFolder = groups; constraints.gridx = 0; constraints.gridy = 0; constraints.gridwidth = 3; constraints.gridheight = 1; constraints.weightx = 1.0; constraints.weighty = 1.0; constraints.fill = GridBagConstraints.HORIZONTAL; constraints.anchor = GridBagConstraints.WEST; /**/ // Add a CheckBox which enables the user to entirely supress shortcut creation. String menuKind = parent.langpack.getString("ShortcutPanel.regular.StartMenu:Start-Menu"); if( OsVersion.IS_UNIX && UnixHelper.kdeIsInstalled() ) menuKind = parent.langpack.getString("ShortcutPanel.regular.StartMenu:K-Menu"); createShortcuts = new JCheckBox( StringTool.replace( parent.langpack.getString("ShortcutPanel.regular.create"), "StartMenu", menuKind ), true); createShortcuts.addActionListener(this); constraints.gridx = 0; constraints.gridy = 1; constraints.gridwidth = 2; constraints.gridheight = 1; constraints.weighty = 0.2; layout.addLayoutComponent(createShortcuts, constraints); add(createShortcuts); // ---------------------------------------------------- // check box to allow the user to decide if a desktop // shortcut should be created. // this should only be created if needed and requested // in the definition file. // ---------------------------------------------------- if (hasDesktopShortcuts) { String initialAllowedValue = idata.getVariable( "DesktopShortcutCheckboxEnabled" ); boolean initialAllowedFlag = false; if( initialAllowedValue==null) initialAllowedFlag= false; else if( Boolean.TRUE.toString().equals(initialAllowedValue) ) initialAllowedFlag=true; allowDesktopShortcut = new JCheckBox(parent.langpack .getString("ShortcutPanel.regular.desktop"), initialAllowedFlag); constraints.gridx = 0; constraints.gridy = 2; constraints.gridwidth = 3; constraints.gridheight = 1; constraints.weighty = 0.2; layout.addLayoutComponent(allowDesktopShortcut, constraints); add(allowDesktopShortcut); } JLabel listLabel = LabelFactory.create(parent.langpack.getString("ShortcutPanel.regular.list"), JLabel.LEADING); constraints.gridx = 0; constraints.gridy = 3; constraints.gridwidth = 1; constraints.gridheight = 1; constraints.weightx = 0.2; constraints.weighty = 0.2; constraints.fill = GridBagConstraints.NONE; constraints.anchor = GridBagConstraints.WEST; layout.addLayoutComponent(listLabel, constraints); add(listLabel); // ---------------------------------------------------- // list box to list all of already existing folders as program groups // at the intended destination // ---------------------------------------------------- addSelectionList( groups, 0, 4, 2, 1, GridBagConstraints.BOTH ); // ---------------------------------------------------- // radio buttons to select current user or all users. // ---------------------------------------------------- if (shortcut.multipleUsers()) { JPanel usersPanel = new JPanel(new GridLayout(2, 1)); ButtonGroup usersGroup = new ButtonGroup(); currentUser = new JRadioButton(parent.langpack .getString("ShortcutPanel.regular.currentUser"), !isRootUser); currentUser.addActionListener(this); usersGroup.add(currentUser); usersPanel.add(currentUser); allUsers = new JRadioButton( parent.langpack.getString("ShortcutPanel.regular.allUsers"), isRootUser); if (!isRootUser) allUsers.setEnabled(false); allUsers.addActionListener(this); usersGroup.add(allUsers); usersPanel.add(allUsers); TitledBorder border = new TitledBorder(new EmptyBorder(2, 2, 2, 2), parent.langpack .getString("ShortcutPanel.regular.userIntro")); usersPanel.setBorder(border); constraints.gridx = 2; constraints.gridy = 4; constraints.gridwidth = 1; constraints.gridheight = 1; constraints.weighty = 1.0; constraints.weightx = 1.0; constraints.fill = GridBagConstraints.NONE; layout.addLayoutComponent(usersPanel, constraints); add(usersPanel); } // ---------------------------------------------------- // edit box that contains the suggested program group // name, which can be modfied or substituted from the // list by the user // ---------------------------------------------------- programGroup = new JTextField(suggestedProgramGroup, 40); // 40? constraints.gridx = 0; constraints.gridy = 5; constraints.gridwidth = 2; constraints.gridheight = 1; constraints.weighty = 1.0; constraints.weightx = 10.0; constraints.fill = GridBagConstraints.HORIZONTAL; layout.addLayoutComponent(programGroup, constraints); add(programGroup); // ---------------------------------------------------- // reset button that allows the user to revert to the // original suggestion for the program group // ---------------------------------------------------- defaultButton = ButtonFactory.createButton(parent.langpack .getString("ShortcutPanel.regular.default"), idata.buttonsHColor); defaultButton.addActionListener(this); constraints.gridx = 2; constraints.gridy = 5; constraints.gridwidth = 1; constraints.gridheight = 1; constraints.fill = GridBagConstraints.NONE; layout.addLayoutComponent(defaultButton, constraints); add(defaultButton); } | 54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/ea2c1c334b491cd6926af6502699f487604c17bc/ShortcutPanel.java/clean/src/lib/com/izforge/izpack/panels/ShortcutPanel.java |
constraints.weighty = 1.0; constraints.weightx = 10.0; | private void buildUI(File groups) { File itsProgramFolder = groups; constraints.gridx = 0; constraints.gridy = 0; constraints.gridwidth = 3; constraints.gridheight = 1; constraints.weightx = 1.0; constraints.weighty = 1.0; constraints.fill = GridBagConstraints.HORIZONTAL; constraints.anchor = GridBagConstraints.WEST; /**/ // Add a CheckBox which enables the user to entirely supress shortcut creation. String menuKind = parent.langpack.getString("ShortcutPanel.regular.StartMenu:Start-Menu"); if( OsVersion.IS_UNIX && UnixHelper.kdeIsInstalled() ) menuKind = parent.langpack.getString("ShortcutPanel.regular.StartMenu:K-Menu"); createShortcuts = new JCheckBox( StringTool.replace( parent.langpack.getString("ShortcutPanel.regular.create"), "StartMenu", menuKind ), true); createShortcuts.addActionListener(this); constraints.gridx = 0; constraints.gridy = 1; constraints.gridwidth = 2; constraints.gridheight = 1; constraints.weighty = 0.2; layout.addLayoutComponent(createShortcuts, constraints); add(createShortcuts); // ---------------------------------------------------- // check box to allow the user to decide if a desktop // shortcut should be created. // this should only be created if needed and requested // in the definition file. // ---------------------------------------------------- if (hasDesktopShortcuts) { String initialAllowedValue = idata.getVariable( "DesktopShortcutCheckboxEnabled" ); boolean initialAllowedFlag = false; if( initialAllowedValue==null) initialAllowedFlag= false; else if( Boolean.TRUE.toString().equals(initialAllowedValue) ) initialAllowedFlag=true; allowDesktopShortcut = new JCheckBox(parent.langpack .getString("ShortcutPanel.regular.desktop"), initialAllowedFlag); constraints.gridx = 0; constraints.gridy = 2; constraints.gridwidth = 3; constraints.gridheight = 1; constraints.weighty = 0.2; layout.addLayoutComponent(allowDesktopShortcut, constraints); add(allowDesktopShortcut); } JLabel listLabel = LabelFactory.create(parent.langpack.getString("ShortcutPanel.regular.list"), JLabel.LEADING); constraints.gridx = 0; constraints.gridy = 3; constraints.gridwidth = 1; constraints.gridheight = 1; constraints.weightx = 0.2; constraints.weighty = 0.2; constraints.fill = GridBagConstraints.NONE; constraints.anchor = GridBagConstraints.WEST; layout.addLayoutComponent(listLabel, constraints); add(listLabel); // ---------------------------------------------------- // list box to list all of already existing folders as program groups // at the intended destination // ---------------------------------------------------- addSelectionList( groups, 0, 4, 2, 1, GridBagConstraints.BOTH ); // ---------------------------------------------------- // radio buttons to select current user or all users. // ---------------------------------------------------- if (shortcut.multipleUsers()) { JPanel usersPanel = new JPanel(new GridLayout(2, 1)); ButtonGroup usersGroup = new ButtonGroup(); currentUser = new JRadioButton(parent.langpack .getString("ShortcutPanel.regular.currentUser"), !isRootUser); currentUser.addActionListener(this); usersGroup.add(currentUser); usersPanel.add(currentUser); allUsers = new JRadioButton( parent.langpack.getString("ShortcutPanel.regular.allUsers"), isRootUser); if (!isRootUser) allUsers.setEnabled(false); allUsers.addActionListener(this); usersGroup.add(allUsers); usersPanel.add(allUsers); TitledBorder border = new TitledBorder(new EmptyBorder(2, 2, 2, 2), parent.langpack .getString("ShortcutPanel.regular.userIntro")); usersPanel.setBorder(border); constraints.gridx = 2; constraints.gridy = 4; constraints.gridwidth = 1; constraints.gridheight = 1; constraints.weighty = 1.0; constraints.weightx = 1.0; constraints.fill = GridBagConstraints.NONE; layout.addLayoutComponent(usersPanel, constraints); add(usersPanel); } // ---------------------------------------------------- // edit box that contains the suggested program group // name, which can be modfied or substituted from the // list by the user // ---------------------------------------------------- programGroup = new JTextField(suggestedProgramGroup, 40); // 40? constraints.gridx = 0; constraints.gridy = 5; constraints.gridwidth = 2; constraints.gridheight = 1; constraints.weighty = 1.0; constraints.weightx = 10.0; constraints.fill = GridBagConstraints.HORIZONTAL; layout.addLayoutComponent(programGroup, constraints); add(programGroup); // ---------------------------------------------------- // reset button that allows the user to revert to the // original suggestion for the program group // ---------------------------------------------------- defaultButton = ButtonFactory.createButton(parent.langpack .getString("ShortcutPanel.regular.default"), idata.buttonsHColor); defaultButton.addActionListener(this); constraints.gridx = 2; constraints.gridy = 5; constraints.gridwidth = 1; constraints.gridheight = 1; constraints.fill = GridBagConstraints.NONE; layout.addLayoutComponent(defaultButton, constraints); add(defaultButton); } | 54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/ea2c1c334b491cd6926af6502699f487604c17bc/ShortcutPanel.java/clean/src/lib/com/izforge/izpack/panels/ShortcutPanel.java |
|
constraints.gridx = 2; constraints.gridy = 5; | constraints.gridx = col + 1; constraints.gridy = line + 5; | private void buildUI(File groups) { File itsProgramFolder = groups; constraints.gridx = 0; constraints.gridy = 0; constraints.gridwidth = 3; constraints.gridheight = 1; constraints.weightx = 1.0; constraints.weighty = 1.0; constraints.fill = GridBagConstraints.HORIZONTAL; constraints.anchor = GridBagConstraints.WEST; /**/ // Add a CheckBox which enables the user to entirely supress shortcut creation. String menuKind = parent.langpack.getString("ShortcutPanel.regular.StartMenu:Start-Menu"); if( OsVersion.IS_UNIX && UnixHelper.kdeIsInstalled() ) menuKind = parent.langpack.getString("ShortcutPanel.regular.StartMenu:K-Menu"); createShortcuts = new JCheckBox( StringTool.replace( parent.langpack.getString("ShortcutPanel.regular.create"), "StartMenu", menuKind ), true); createShortcuts.addActionListener(this); constraints.gridx = 0; constraints.gridy = 1; constraints.gridwidth = 2; constraints.gridheight = 1; constraints.weighty = 0.2; layout.addLayoutComponent(createShortcuts, constraints); add(createShortcuts); // ---------------------------------------------------- // check box to allow the user to decide if a desktop // shortcut should be created. // this should only be created if needed and requested // in the definition file. // ---------------------------------------------------- if (hasDesktopShortcuts) { String initialAllowedValue = idata.getVariable( "DesktopShortcutCheckboxEnabled" ); boolean initialAllowedFlag = false; if( initialAllowedValue==null) initialAllowedFlag= false; else if( Boolean.TRUE.toString().equals(initialAllowedValue) ) initialAllowedFlag=true; allowDesktopShortcut = new JCheckBox(parent.langpack .getString("ShortcutPanel.regular.desktop"), initialAllowedFlag); constraints.gridx = 0; constraints.gridy = 2; constraints.gridwidth = 3; constraints.gridheight = 1; constraints.weighty = 0.2; layout.addLayoutComponent(allowDesktopShortcut, constraints); add(allowDesktopShortcut); } JLabel listLabel = LabelFactory.create(parent.langpack.getString("ShortcutPanel.regular.list"), JLabel.LEADING); constraints.gridx = 0; constraints.gridy = 3; constraints.gridwidth = 1; constraints.gridheight = 1; constraints.weightx = 0.2; constraints.weighty = 0.2; constraints.fill = GridBagConstraints.NONE; constraints.anchor = GridBagConstraints.WEST; layout.addLayoutComponent(listLabel, constraints); add(listLabel); // ---------------------------------------------------- // list box to list all of already existing folders as program groups // at the intended destination // ---------------------------------------------------- addSelectionList( groups, 0, 4, 2, 1, GridBagConstraints.BOTH ); // ---------------------------------------------------- // radio buttons to select current user or all users. // ---------------------------------------------------- if (shortcut.multipleUsers()) { JPanel usersPanel = new JPanel(new GridLayout(2, 1)); ButtonGroup usersGroup = new ButtonGroup(); currentUser = new JRadioButton(parent.langpack .getString("ShortcutPanel.regular.currentUser"), !isRootUser); currentUser.addActionListener(this); usersGroup.add(currentUser); usersPanel.add(currentUser); allUsers = new JRadioButton( parent.langpack.getString("ShortcutPanel.regular.allUsers"), isRootUser); if (!isRootUser) allUsers.setEnabled(false); allUsers.addActionListener(this); usersGroup.add(allUsers); usersPanel.add(allUsers); TitledBorder border = new TitledBorder(new EmptyBorder(2, 2, 2, 2), parent.langpack .getString("ShortcutPanel.regular.userIntro")); usersPanel.setBorder(border); constraints.gridx = 2; constraints.gridy = 4; constraints.gridwidth = 1; constraints.gridheight = 1; constraints.weighty = 1.0; constraints.weightx = 1.0; constraints.fill = GridBagConstraints.NONE; layout.addLayoutComponent(usersPanel, constraints); add(usersPanel); } // ---------------------------------------------------- // edit box that contains the suggested program group // name, which can be modfied or substituted from the // list by the user // ---------------------------------------------------- programGroup = new JTextField(suggestedProgramGroup, 40); // 40? constraints.gridx = 0; constraints.gridy = 5; constraints.gridwidth = 2; constraints.gridheight = 1; constraints.weighty = 1.0; constraints.weightx = 10.0; constraints.fill = GridBagConstraints.HORIZONTAL; layout.addLayoutComponent(programGroup, constraints); add(programGroup); // ---------------------------------------------------- // reset button that allows the user to revert to the // original suggestion for the program group // ---------------------------------------------------- defaultButton = ButtonFactory.createButton(parent.langpack .getString("ShortcutPanel.regular.default"), idata.buttonsHColor); defaultButton.addActionListener(this); constraints.gridx = 2; constraints.gridy = 5; constraints.gridwidth = 1; constraints.gridheight = 1; constraints.fill = GridBagConstraints.NONE; layout.addLayoutComponent(defaultButton, constraints); add(defaultButton); } | 54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/ea2c1c334b491cd6926af6502699f487604c17bc/ShortcutPanel.java/clean/src/lib/com/izforge/izpack/panels/ShortcutPanel.java |
constraints.gridheight = 1; constraints.fill = GridBagConstraints.NONE; | constraints.gridheight = 1; constraints.fill = GridBagConstraints.HORIZONTAL; | private void buildUI(File groups) { File itsProgramFolder = groups; constraints.gridx = 0; constraints.gridy = 0; constraints.gridwidth = 3; constraints.gridheight = 1; constraints.weightx = 1.0; constraints.weighty = 1.0; constraints.fill = GridBagConstraints.HORIZONTAL; constraints.anchor = GridBagConstraints.WEST; /**/ // Add a CheckBox which enables the user to entirely supress shortcut creation. String menuKind = parent.langpack.getString("ShortcutPanel.regular.StartMenu:Start-Menu"); if( OsVersion.IS_UNIX && UnixHelper.kdeIsInstalled() ) menuKind = parent.langpack.getString("ShortcutPanel.regular.StartMenu:K-Menu"); createShortcuts = new JCheckBox( StringTool.replace( parent.langpack.getString("ShortcutPanel.regular.create"), "StartMenu", menuKind ), true); createShortcuts.addActionListener(this); constraints.gridx = 0; constraints.gridy = 1; constraints.gridwidth = 2; constraints.gridheight = 1; constraints.weighty = 0.2; layout.addLayoutComponent(createShortcuts, constraints); add(createShortcuts); // ---------------------------------------------------- // check box to allow the user to decide if a desktop // shortcut should be created. // this should only be created if needed and requested // in the definition file. // ---------------------------------------------------- if (hasDesktopShortcuts) { String initialAllowedValue = idata.getVariable( "DesktopShortcutCheckboxEnabled" ); boolean initialAllowedFlag = false; if( initialAllowedValue==null) initialAllowedFlag= false; else if( Boolean.TRUE.toString().equals(initialAllowedValue) ) initialAllowedFlag=true; allowDesktopShortcut = new JCheckBox(parent.langpack .getString("ShortcutPanel.regular.desktop"), initialAllowedFlag); constraints.gridx = 0; constraints.gridy = 2; constraints.gridwidth = 3; constraints.gridheight = 1; constraints.weighty = 0.2; layout.addLayoutComponent(allowDesktopShortcut, constraints); add(allowDesktopShortcut); } JLabel listLabel = LabelFactory.create(parent.langpack.getString("ShortcutPanel.regular.list"), JLabel.LEADING); constraints.gridx = 0; constraints.gridy = 3; constraints.gridwidth = 1; constraints.gridheight = 1; constraints.weightx = 0.2; constraints.weighty = 0.2; constraints.fill = GridBagConstraints.NONE; constraints.anchor = GridBagConstraints.WEST; layout.addLayoutComponent(listLabel, constraints); add(listLabel); // ---------------------------------------------------- // list box to list all of already existing folders as program groups // at the intended destination // ---------------------------------------------------- addSelectionList( groups, 0, 4, 2, 1, GridBagConstraints.BOTH ); // ---------------------------------------------------- // radio buttons to select current user or all users. // ---------------------------------------------------- if (shortcut.multipleUsers()) { JPanel usersPanel = new JPanel(new GridLayout(2, 1)); ButtonGroup usersGroup = new ButtonGroup(); currentUser = new JRadioButton(parent.langpack .getString("ShortcutPanel.regular.currentUser"), !isRootUser); currentUser.addActionListener(this); usersGroup.add(currentUser); usersPanel.add(currentUser); allUsers = new JRadioButton( parent.langpack.getString("ShortcutPanel.regular.allUsers"), isRootUser); if (!isRootUser) allUsers.setEnabled(false); allUsers.addActionListener(this); usersGroup.add(allUsers); usersPanel.add(allUsers); TitledBorder border = new TitledBorder(new EmptyBorder(2, 2, 2, 2), parent.langpack .getString("ShortcutPanel.regular.userIntro")); usersPanel.setBorder(border); constraints.gridx = 2; constraints.gridy = 4; constraints.gridwidth = 1; constraints.gridheight = 1; constraints.weighty = 1.0; constraints.weightx = 1.0; constraints.fill = GridBagConstraints.NONE; layout.addLayoutComponent(usersPanel, constraints); add(usersPanel); } // ---------------------------------------------------- // edit box that contains the suggested program group // name, which can be modfied or substituted from the // list by the user // ---------------------------------------------------- programGroup = new JTextField(suggestedProgramGroup, 40); // 40? constraints.gridx = 0; constraints.gridy = 5; constraints.gridwidth = 2; constraints.gridheight = 1; constraints.weighty = 1.0; constraints.weightx = 10.0; constraints.fill = GridBagConstraints.HORIZONTAL; layout.addLayoutComponent(programGroup, constraints); add(programGroup); // ---------------------------------------------------- // reset button that allows the user to revert to the // original suggestion for the program group // ---------------------------------------------------- defaultButton = ButtonFactory.createButton(parent.langpack .getString("ShortcutPanel.regular.default"), idata.buttonsHColor); defaultButton.addActionListener(this); constraints.gridx = 2; constraints.gridy = 5; constraints.gridwidth = 1; constraints.gridheight = 1; constraints.fill = GridBagConstraints.NONE; layout.addLayoutComponent(defaultButton, constraints); add(defaultButton); } | 54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/ea2c1c334b491cd6926af6502699f487604c17bc/ShortcutPanel.java/clean/src/lib/com/izforge/izpack/panels/ShortcutPanel.java |
if (!create) return; | if (!create) { return; } | private void createShortcuts() { if (!create) return; ShortcutData data; String tmpgn; for (int i = 0; i < shortcuts.size(); i++) { data = (ShortcutData) shortcuts.elementAt(i); try { //The cloning guarantees that data.subgroup will not be null. //See ShortcutData.cloneString if (data.subgroup.length() > 0 && (data.subgroup.charAt(0) == '/' || data.subgroup.charAt(0) == '\\')) { tmpgn = groupName + data.subgroup; } else { tmpgn = groupName + File.separator + data.subgroup; } shortcut.setUserType(itsUserType); shortcut.setLinkName(data.name); shortcut.setLinkType(data.type); shortcut.setArguments(data.commandLine); shortcut.setDescription(data.description); shortcut.setIconLocation(data.iconFile, data.iconIndex); shortcut.setShowCommand(data.initialState); shortcut.setTargetPath(data.target); shortcut.setWorkingDirectory(data.workingDirectory); shortcut.setEncoding(data.deskTopEntryLinux_Encoding); shortcut.setMimetype(data.deskTopEntryLinux_MimeType); shortcut.setTerminal(data.deskTopEntryLinux_Terminal); shortcut.setTerminalOptions(data.deskTopEntryLinux_TerminalOptions); shortcut.setType(data.deskTopEntryLinux_Type); shortcut.setKdeSubstUID(data.deskTopEntryLinux_X_KDE_SubstituteUID); shortcut.setURL(data.deskTopEntryLinux_URL); shortcut.setCreateForAll(data.createForAll); if (data.addToGroup) { shortcut.setProgramGroup(tmpgn); } else { shortcut.setProgramGroup(""); } try { // ---------------------------------------------- // save the shortcut only if it is either not on // the desktop or if it is on the desktop and // the user has signalled that it is ok to place // shortcuts on the desktop. // ---------------------------------------------- if ((data.type != Shortcut.DESKTOP) || ((data.type == Shortcut.DESKTOP) && allowDesktopShortcut .isSelected())) { // save the shortcut shortcut.save(); // add the file and directory name to the file list String fileName = shortcut.getFileName(); files.add(0, fileName); File file = new File(fileName); File base = new File(shortcut.getBasePath()); Vector intermediates = new Vector(); //String directoryName = shortcut.getDirectoryCreated (); execFiles.add(new ExecutableFile(fileName, 2, ExecutableFile.WARN, new ArrayList(), false)); files.add(fileName); while ((file = file.getParentFile()) != null) { if (file.equals(base)) break; intermediates.add(file); } if (file != null) { for (Iterator iter = intermediates.iterator(); iter.hasNext();) files.add(0, iter.next().toString()); } } } catch (Exception exception) {} } catch (Throwable exception) { } } // try { if (execFiles != null) { FileExecutor executor = new FileExecutor(execFiles); // // TODO: Hi Guys, // TODO The following commented-out line sometimes produces an uncatchable // nullpointer Exception! // TODO evaluate for what reason the files should exec. // TODO if there is a serious explanation, why to do that, // TODO the code must be more robust //evaluate executor.executeFiles( ExecutableFile.NEVER, null ); } } catch (NullPointerException nep) { nep.printStackTrace(); } catch (RuntimeException cannot) { cannot.printStackTrace(); } parent.unlockNextButton(); } | 54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/ea2c1c334b491cd6926af6502699f487604c17bc/ShortcutPanel.java/clean/src/lib/com/izforge/izpack/panels/ShortcutPanel.java |
String tmpgn; | private void createShortcuts() { if (!create) return; ShortcutData data; String tmpgn; for (int i = 0; i < shortcuts.size(); i++) { data = (ShortcutData) shortcuts.elementAt(i); try { //The cloning guarantees that data.subgroup will not be null. //See ShortcutData.cloneString if (data.subgroup.length() > 0 && (data.subgroup.charAt(0) == '/' || data.subgroup.charAt(0) == '\\')) { tmpgn = groupName + data.subgroup; } else { tmpgn = groupName + File.separator + data.subgroup; } shortcut.setUserType(itsUserType); shortcut.setLinkName(data.name); shortcut.setLinkType(data.type); shortcut.setArguments(data.commandLine); shortcut.setDescription(data.description); shortcut.setIconLocation(data.iconFile, data.iconIndex); shortcut.setShowCommand(data.initialState); shortcut.setTargetPath(data.target); shortcut.setWorkingDirectory(data.workingDirectory); shortcut.setEncoding(data.deskTopEntryLinux_Encoding); shortcut.setMimetype(data.deskTopEntryLinux_MimeType); shortcut.setTerminal(data.deskTopEntryLinux_Terminal); shortcut.setTerminalOptions(data.deskTopEntryLinux_TerminalOptions); shortcut.setType(data.deskTopEntryLinux_Type); shortcut.setKdeSubstUID(data.deskTopEntryLinux_X_KDE_SubstituteUID); shortcut.setURL(data.deskTopEntryLinux_URL); shortcut.setCreateForAll(data.createForAll); if (data.addToGroup) { shortcut.setProgramGroup(tmpgn); } else { shortcut.setProgramGroup(""); } try { // ---------------------------------------------- // save the shortcut only if it is either not on // the desktop or if it is on the desktop and // the user has signalled that it is ok to place // shortcuts on the desktop. // ---------------------------------------------- if ((data.type != Shortcut.DESKTOP) || ((data.type == Shortcut.DESKTOP) && allowDesktopShortcut .isSelected())) { // save the shortcut shortcut.save(); // add the file and directory name to the file list String fileName = shortcut.getFileName(); files.add(0, fileName); File file = new File(fileName); File base = new File(shortcut.getBasePath()); Vector intermediates = new Vector(); //String directoryName = shortcut.getDirectoryCreated (); execFiles.add(new ExecutableFile(fileName, 2, ExecutableFile.WARN, new ArrayList(), false)); files.add(fileName); while ((file = file.getParentFile()) != null) { if (file.equals(base)) break; intermediates.add(file); } if (file != null) { for (Iterator iter = intermediates.iterator(); iter.hasNext();) files.add(0, iter.next().toString()); } } } catch (Exception exception) {} } catch (Throwable exception) { } } // try { if (execFiles != null) { FileExecutor executor = new FileExecutor(execFiles); // // TODO: Hi Guys, // TODO The following commented-out line sometimes produces an uncatchable // nullpointer Exception! // TODO evaluate for what reason the files should exec. // TODO if there is a serious explanation, why to do that, // TODO the code must be more robust //evaluate executor.executeFiles( ExecutableFile.NEVER, null ); } } catch (NullPointerException nep) { nep.printStackTrace(); } catch (RuntimeException cannot) { cannot.printStackTrace(); } parent.unlockNextButton(); } | 54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/ea2c1c334b491cd6926af6502699f487604c17bc/ShortcutPanel.java/clean/src/lib/com/izforge/izpack/panels/ShortcutPanel.java |
|
if (data.subgroup.length() > 0 && (data.subgroup.charAt(0) == '/' || data.subgroup.charAt(0) == '\\')) { tmpgn = groupName + data.subgroup; } else { tmpgn = groupName + File.separator + data.subgroup; } | groupName = groupName + data.subgroup; | private void createShortcuts() { if (!create) return; ShortcutData data; String tmpgn; for (int i = 0; i < shortcuts.size(); i++) { data = (ShortcutData) shortcuts.elementAt(i); try { //The cloning guarantees that data.subgroup will not be null. //See ShortcutData.cloneString if (data.subgroup.length() > 0 && (data.subgroup.charAt(0) == '/' || data.subgroup.charAt(0) == '\\')) { tmpgn = groupName + data.subgroup; } else { tmpgn = groupName + File.separator + data.subgroup; } shortcut.setUserType(itsUserType); shortcut.setLinkName(data.name); shortcut.setLinkType(data.type); shortcut.setArguments(data.commandLine); shortcut.setDescription(data.description); shortcut.setIconLocation(data.iconFile, data.iconIndex); shortcut.setShowCommand(data.initialState); shortcut.setTargetPath(data.target); shortcut.setWorkingDirectory(data.workingDirectory); shortcut.setEncoding(data.deskTopEntryLinux_Encoding); shortcut.setMimetype(data.deskTopEntryLinux_MimeType); shortcut.setTerminal(data.deskTopEntryLinux_Terminal); shortcut.setTerminalOptions(data.deskTopEntryLinux_TerminalOptions); shortcut.setType(data.deskTopEntryLinux_Type); shortcut.setKdeSubstUID(data.deskTopEntryLinux_X_KDE_SubstituteUID); shortcut.setURL(data.deskTopEntryLinux_URL); shortcut.setCreateForAll(data.createForAll); if (data.addToGroup) { shortcut.setProgramGroup(tmpgn); } else { shortcut.setProgramGroup(""); } try { // ---------------------------------------------- // save the shortcut only if it is either not on // the desktop or if it is on the desktop and // the user has signalled that it is ok to place // shortcuts on the desktop. // ---------------------------------------------- if ((data.type != Shortcut.DESKTOP) || ((data.type == Shortcut.DESKTOP) && allowDesktopShortcut .isSelected())) { // save the shortcut shortcut.save(); // add the file and directory name to the file list String fileName = shortcut.getFileName(); files.add(0, fileName); File file = new File(fileName); File base = new File(shortcut.getBasePath()); Vector intermediates = new Vector(); //String directoryName = shortcut.getDirectoryCreated (); execFiles.add(new ExecutableFile(fileName, 2, ExecutableFile.WARN, new ArrayList(), false)); files.add(fileName); while ((file = file.getParentFile()) != null) { if (file.equals(base)) break; intermediates.add(file); } if (file != null) { for (Iterator iter = intermediates.iterator(); iter.hasNext();) files.add(0, iter.next().toString()); } } } catch (Exception exception) {} } catch (Throwable exception) { } } // try { if (execFiles != null) { FileExecutor executor = new FileExecutor(execFiles); // // TODO: Hi Guys, // TODO The following commented-out line sometimes produces an uncatchable // nullpointer Exception! // TODO evaluate for what reason the files should exec. // TODO if there is a serious explanation, why to do that, // TODO the code must be more robust //evaluate executor.executeFiles( ExecutableFile.NEVER, null ); } } catch (NullPointerException nep) { nep.printStackTrace(); } catch (RuntimeException cannot) { cannot.printStackTrace(); } parent.unlockNextButton(); } | 54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/ea2c1c334b491cd6926af6502699f487604c17bc/ShortcutPanel.java/clean/src/lib/com/izforge/izpack/panels/ShortcutPanel.java |
shortcut.setProgramGroup(tmpgn); | shortcut.setProgramGroup(groupName); | private void createShortcuts() { if (!create) return; ShortcutData data; String tmpgn; for (int i = 0; i < shortcuts.size(); i++) { data = (ShortcutData) shortcuts.elementAt(i); try { //The cloning guarantees that data.subgroup will not be null. //See ShortcutData.cloneString if (data.subgroup.length() > 0 && (data.subgroup.charAt(0) == '/' || data.subgroup.charAt(0) == '\\')) { tmpgn = groupName + data.subgroup; } else { tmpgn = groupName + File.separator + data.subgroup; } shortcut.setUserType(itsUserType); shortcut.setLinkName(data.name); shortcut.setLinkType(data.type); shortcut.setArguments(data.commandLine); shortcut.setDescription(data.description); shortcut.setIconLocation(data.iconFile, data.iconIndex); shortcut.setShowCommand(data.initialState); shortcut.setTargetPath(data.target); shortcut.setWorkingDirectory(data.workingDirectory); shortcut.setEncoding(data.deskTopEntryLinux_Encoding); shortcut.setMimetype(data.deskTopEntryLinux_MimeType); shortcut.setTerminal(data.deskTopEntryLinux_Terminal); shortcut.setTerminalOptions(data.deskTopEntryLinux_TerminalOptions); shortcut.setType(data.deskTopEntryLinux_Type); shortcut.setKdeSubstUID(data.deskTopEntryLinux_X_KDE_SubstituteUID); shortcut.setURL(data.deskTopEntryLinux_URL); shortcut.setCreateForAll(data.createForAll); if (data.addToGroup) { shortcut.setProgramGroup(tmpgn); } else { shortcut.setProgramGroup(""); } try { // ---------------------------------------------- // save the shortcut only if it is either not on // the desktop or if it is on the desktop and // the user has signalled that it is ok to place // shortcuts on the desktop. // ---------------------------------------------- if ((data.type != Shortcut.DESKTOP) || ((data.type == Shortcut.DESKTOP) && allowDesktopShortcut .isSelected())) { // save the shortcut shortcut.save(); // add the file and directory name to the file list String fileName = shortcut.getFileName(); files.add(0, fileName); File file = new File(fileName); File base = new File(shortcut.getBasePath()); Vector intermediates = new Vector(); //String directoryName = shortcut.getDirectoryCreated (); execFiles.add(new ExecutableFile(fileName, 2, ExecutableFile.WARN, new ArrayList(), false)); files.add(fileName); while ((file = file.getParentFile()) != null) { if (file.equals(base)) break; intermediates.add(file); } if (file != null) { for (Iterator iter = intermediates.iterator(); iter.hasNext();) files.add(0, iter.next().toString()); } } } catch (Exception exception) {} } catch (Throwable exception) { } } // try { if (execFiles != null) { FileExecutor executor = new FileExecutor(execFiles); // // TODO: Hi Guys, // TODO The following commented-out line sometimes produces an uncatchable // nullpointer Exception! // TODO evaluate for what reason the files should exec. // TODO if there is a serious explanation, why to do that, // TODO the code must be more robust //evaluate executor.executeFiles( ExecutableFile.NEVER, null ); } } catch (NullPointerException nep) { nep.printStackTrace(); } catch (RuntimeException cannot) { cannot.printStackTrace(); } parent.unlockNextButton(); } | 54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/ea2c1c334b491cd6926af6502699f487604c17bc/ShortcutPanel.java/clean/src/lib/com/izforge/izpack/panels/ShortcutPanel.java |
execFiles.add(new ExecutableFile(fileName, 2, ExecutableFile.WARN, new ArrayList(), false)); | execFiles.add(new ExecutableFile(fileName, ExecutableFile.UNINSTALL, ExecutableFile.IGNORE, new ArrayList(), false)); | private void createShortcuts() { if (!create) return; ShortcutData data; String tmpgn; for (int i = 0; i < shortcuts.size(); i++) { data = (ShortcutData) shortcuts.elementAt(i); try { //The cloning guarantees that data.subgroup will not be null. //See ShortcutData.cloneString if (data.subgroup.length() > 0 && (data.subgroup.charAt(0) == '/' || data.subgroup.charAt(0) == '\\')) { tmpgn = groupName + data.subgroup; } else { tmpgn = groupName + File.separator + data.subgroup; } shortcut.setUserType(itsUserType); shortcut.setLinkName(data.name); shortcut.setLinkType(data.type); shortcut.setArguments(data.commandLine); shortcut.setDescription(data.description); shortcut.setIconLocation(data.iconFile, data.iconIndex); shortcut.setShowCommand(data.initialState); shortcut.setTargetPath(data.target); shortcut.setWorkingDirectory(data.workingDirectory); shortcut.setEncoding(data.deskTopEntryLinux_Encoding); shortcut.setMimetype(data.deskTopEntryLinux_MimeType); shortcut.setTerminal(data.deskTopEntryLinux_Terminal); shortcut.setTerminalOptions(data.deskTopEntryLinux_TerminalOptions); shortcut.setType(data.deskTopEntryLinux_Type); shortcut.setKdeSubstUID(data.deskTopEntryLinux_X_KDE_SubstituteUID); shortcut.setURL(data.deskTopEntryLinux_URL); shortcut.setCreateForAll(data.createForAll); if (data.addToGroup) { shortcut.setProgramGroup(tmpgn); } else { shortcut.setProgramGroup(""); } try { // ---------------------------------------------- // save the shortcut only if it is either not on // the desktop or if it is on the desktop and // the user has signalled that it is ok to place // shortcuts on the desktop. // ---------------------------------------------- if ((data.type != Shortcut.DESKTOP) || ((data.type == Shortcut.DESKTOP) && allowDesktopShortcut .isSelected())) { // save the shortcut shortcut.save(); // add the file and directory name to the file list String fileName = shortcut.getFileName(); files.add(0, fileName); File file = new File(fileName); File base = new File(shortcut.getBasePath()); Vector intermediates = new Vector(); //String directoryName = shortcut.getDirectoryCreated (); execFiles.add(new ExecutableFile(fileName, 2, ExecutableFile.WARN, new ArrayList(), false)); files.add(fileName); while ((file = file.getParentFile()) != null) { if (file.equals(base)) break; intermediates.add(file); } if (file != null) { for (Iterator iter = intermediates.iterator(); iter.hasNext();) files.add(0, iter.next().toString()); } } } catch (Exception exception) {} } catch (Throwable exception) { } } // try { if (execFiles != null) { FileExecutor executor = new FileExecutor(execFiles); // // TODO: Hi Guys, // TODO The following commented-out line sometimes produces an uncatchable // nullpointer Exception! // TODO evaluate for what reason the files should exec. // TODO if there is a serious explanation, why to do that, // TODO the code must be more robust //evaluate executor.executeFiles( ExecutableFile.NEVER, null ); } } catch (NullPointerException nep) { nep.printStackTrace(); } catch (RuntimeException cannot) { cannot.printStackTrace(); } parent.unlockNextButton(); } | 54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/ea2c1c334b491cd6926af6502699f487604c17bc/ShortcutPanel.java/clean/src/lib/com/izforge/izpack/panels/ShortcutPanel.java |
if (file.equals(base)) break; | if (file.equals(base)) { break; } | private void createShortcuts() { if (!create) return; ShortcutData data; String tmpgn; for (int i = 0; i < shortcuts.size(); i++) { data = (ShortcutData) shortcuts.elementAt(i); try { //The cloning guarantees that data.subgroup will not be null. //See ShortcutData.cloneString if (data.subgroup.length() > 0 && (data.subgroup.charAt(0) == '/' || data.subgroup.charAt(0) == '\\')) { tmpgn = groupName + data.subgroup; } else { tmpgn = groupName + File.separator + data.subgroup; } shortcut.setUserType(itsUserType); shortcut.setLinkName(data.name); shortcut.setLinkType(data.type); shortcut.setArguments(data.commandLine); shortcut.setDescription(data.description); shortcut.setIconLocation(data.iconFile, data.iconIndex); shortcut.setShowCommand(data.initialState); shortcut.setTargetPath(data.target); shortcut.setWorkingDirectory(data.workingDirectory); shortcut.setEncoding(data.deskTopEntryLinux_Encoding); shortcut.setMimetype(data.deskTopEntryLinux_MimeType); shortcut.setTerminal(data.deskTopEntryLinux_Terminal); shortcut.setTerminalOptions(data.deskTopEntryLinux_TerminalOptions); shortcut.setType(data.deskTopEntryLinux_Type); shortcut.setKdeSubstUID(data.deskTopEntryLinux_X_KDE_SubstituteUID); shortcut.setURL(data.deskTopEntryLinux_URL); shortcut.setCreateForAll(data.createForAll); if (data.addToGroup) { shortcut.setProgramGroup(tmpgn); } else { shortcut.setProgramGroup(""); } try { // ---------------------------------------------- // save the shortcut only if it is either not on // the desktop or if it is on the desktop and // the user has signalled that it is ok to place // shortcuts on the desktop. // ---------------------------------------------- if ((data.type != Shortcut.DESKTOP) || ((data.type == Shortcut.DESKTOP) && allowDesktopShortcut .isSelected())) { // save the shortcut shortcut.save(); // add the file and directory name to the file list String fileName = shortcut.getFileName(); files.add(0, fileName); File file = new File(fileName); File base = new File(shortcut.getBasePath()); Vector intermediates = new Vector(); //String directoryName = shortcut.getDirectoryCreated (); execFiles.add(new ExecutableFile(fileName, 2, ExecutableFile.WARN, new ArrayList(), false)); files.add(fileName); while ((file = file.getParentFile()) != null) { if (file.equals(base)) break; intermediates.add(file); } if (file != null) { for (Iterator iter = intermediates.iterator(); iter.hasNext();) files.add(0, iter.next().toString()); } } } catch (Exception exception) {} } catch (Throwable exception) { } } // try { if (execFiles != null) { FileExecutor executor = new FileExecutor(execFiles); // // TODO: Hi Guys, // TODO The following commented-out line sometimes produces an uncatchable // nullpointer Exception! // TODO evaluate for what reason the files should exec. // TODO if there is a serious explanation, why to do that, // TODO the code must be more robust //evaluate executor.executeFiles( ExecutableFile.NEVER, null ); } } catch (NullPointerException nep) { nep.printStackTrace(); } catch (RuntimeException cannot) { cannot.printStackTrace(); } parent.unlockNextButton(); } | 54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/ea2c1c334b491cd6926af6502699f487604c17bc/ShortcutPanel.java/clean/src/lib/com/izforge/izpack/panels/ShortcutPanel.java |
for (Iterator iter = intermediates.iterator(); iter.hasNext();) files.add(0, iter.next().toString()); | Enumeration filesEnum = intermediates.elements(); while (filesEnum.hasMoreElements()) { files.add(0, filesEnum.nextElement().toString()); } | private void createShortcuts() { if (!create) return; ShortcutData data; String tmpgn; for (int i = 0; i < shortcuts.size(); i++) { data = (ShortcutData) shortcuts.elementAt(i); try { //The cloning guarantees that data.subgroup will not be null. //See ShortcutData.cloneString if (data.subgroup.length() > 0 && (data.subgroup.charAt(0) == '/' || data.subgroup.charAt(0) == '\\')) { tmpgn = groupName + data.subgroup; } else { tmpgn = groupName + File.separator + data.subgroup; } shortcut.setUserType(itsUserType); shortcut.setLinkName(data.name); shortcut.setLinkType(data.type); shortcut.setArguments(data.commandLine); shortcut.setDescription(data.description); shortcut.setIconLocation(data.iconFile, data.iconIndex); shortcut.setShowCommand(data.initialState); shortcut.setTargetPath(data.target); shortcut.setWorkingDirectory(data.workingDirectory); shortcut.setEncoding(data.deskTopEntryLinux_Encoding); shortcut.setMimetype(data.deskTopEntryLinux_MimeType); shortcut.setTerminal(data.deskTopEntryLinux_Terminal); shortcut.setTerminalOptions(data.deskTopEntryLinux_TerminalOptions); shortcut.setType(data.deskTopEntryLinux_Type); shortcut.setKdeSubstUID(data.deskTopEntryLinux_X_KDE_SubstituteUID); shortcut.setURL(data.deskTopEntryLinux_URL); shortcut.setCreateForAll(data.createForAll); if (data.addToGroup) { shortcut.setProgramGroup(tmpgn); } else { shortcut.setProgramGroup(""); } try { // ---------------------------------------------- // save the shortcut only if it is either not on // the desktop or if it is on the desktop and // the user has signalled that it is ok to place // shortcuts on the desktop. // ---------------------------------------------- if ((data.type != Shortcut.DESKTOP) || ((data.type == Shortcut.DESKTOP) && allowDesktopShortcut .isSelected())) { // save the shortcut shortcut.save(); // add the file and directory name to the file list String fileName = shortcut.getFileName(); files.add(0, fileName); File file = new File(fileName); File base = new File(shortcut.getBasePath()); Vector intermediates = new Vector(); //String directoryName = shortcut.getDirectoryCreated (); execFiles.add(new ExecutableFile(fileName, 2, ExecutableFile.WARN, new ArrayList(), false)); files.add(fileName); while ((file = file.getParentFile()) != null) { if (file.equals(base)) break; intermediates.add(file); } if (file != null) { for (Iterator iter = intermediates.iterator(); iter.hasNext();) files.add(0, iter.next().toString()); } } } catch (Exception exception) {} } catch (Throwable exception) { } } // try { if (execFiles != null) { FileExecutor executor = new FileExecutor(execFiles); // // TODO: Hi Guys, // TODO The following commented-out line sometimes produces an uncatchable // nullpointer Exception! // TODO evaluate for what reason the files should exec. // TODO if there is a serious explanation, why to do that, // TODO the code must be more robust //evaluate executor.executeFiles( ExecutableFile.NEVER, null ); } } catch (NullPointerException nep) { nep.printStackTrace(); } catch (RuntimeException cannot) { cannot.printStackTrace(); } parent.unlockNextButton(); } | 54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/ea2c1c334b491cd6926af6502699f487604c17bc/ShortcutPanel.java/clean/src/lib/com/izforge/izpack/panels/ShortcutPanel.java |
private void createShortcuts() { if (!create) return; ShortcutData data; String tmpgn; for (int i = 0; i < shortcuts.size(); i++) { data = (ShortcutData) shortcuts.elementAt(i); try { //The cloning guarantees that data.subgroup will not be null. //See ShortcutData.cloneString if (data.subgroup.length() > 0 && (data.subgroup.charAt(0) == '/' || data.subgroup.charAt(0) == '\\')) { tmpgn = groupName + data.subgroup; } else { tmpgn = groupName + File.separator + data.subgroup; } shortcut.setUserType(itsUserType); shortcut.setLinkName(data.name); shortcut.setLinkType(data.type); shortcut.setArguments(data.commandLine); shortcut.setDescription(data.description); shortcut.setIconLocation(data.iconFile, data.iconIndex); shortcut.setShowCommand(data.initialState); shortcut.setTargetPath(data.target); shortcut.setWorkingDirectory(data.workingDirectory); shortcut.setEncoding(data.deskTopEntryLinux_Encoding); shortcut.setMimetype(data.deskTopEntryLinux_MimeType); shortcut.setTerminal(data.deskTopEntryLinux_Terminal); shortcut.setTerminalOptions(data.deskTopEntryLinux_TerminalOptions); shortcut.setType(data.deskTopEntryLinux_Type); shortcut.setKdeSubstUID(data.deskTopEntryLinux_X_KDE_SubstituteUID); shortcut.setURL(data.deskTopEntryLinux_URL); shortcut.setCreateForAll(data.createForAll); if (data.addToGroup) { shortcut.setProgramGroup(tmpgn); } else { shortcut.setProgramGroup(""); } try { // ---------------------------------------------- // save the shortcut only if it is either not on // the desktop or if it is on the desktop and // the user has signalled that it is ok to place // shortcuts on the desktop. // ---------------------------------------------- if ((data.type != Shortcut.DESKTOP) || ((data.type == Shortcut.DESKTOP) && allowDesktopShortcut .isSelected())) { // save the shortcut shortcut.save(); // add the file and directory name to the file list String fileName = shortcut.getFileName(); files.add(0, fileName); File file = new File(fileName); File base = new File(shortcut.getBasePath()); Vector intermediates = new Vector(); //String directoryName = shortcut.getDirectoryCreated (); execFiles.add(new ExecutableFile(fileName, 2, ExecutableFile.WARN, new ArrayList(), false)); files.add(fileName); while ((file = file.getParentFile()) != null) { if (file.equals(base)) break; intermediates.add(file); } if (file != null) { for (Iterator iter = intermediates.iterator(); iter.hasNext();) files.add(0, iter.next().toString()); } } } catch (Exception exception) {} } catch (Throwable exception) { } } // try { if (execFiles != null) { FileExecutor executor = new FileExecutor(execFiles); // // TODO: Hi Guys, // TODO The following commented-out line sometimes produces an uncatchable // nullpointer Exception! // TODO evaluate for what reason the files should exec. // TODO if there is a serious explanation, why to do that, // TODO the code must be more robust //evaluate executor.executeFiles( ExecutableFile.NEVER, null ); } } catch (NullPointerException nep) { nep.printStackTrace(); } catch (RuntimeException cannot) { cannot.printStackTrace(); } parent.unlockNextButton(); } | 54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/ea2c1c334b491cd6926af6502699f487604c17bc/ShortcutPanel.java/clean/src/lib/com/izforge/izpack/panels/ShortcutPanel.java |
||
private void createShortcuts() { if (!create) return; ShortcutData data; String tmpgn; for (int i = 0; i < shortcuts.size(); i++) { data = (ShortcutData) shortcuts.elementAt(i); try { //The cloning guarantees that data.subgroup will not be null. //See ShortcutData.cloneString if (data.subgroup.length() > 0 && (data.subgroup.charAt(0) == '/' || data.subgroup.charAt(0) == '\\')) { tmpgn = groupName + data.subgroup; } else { tmpgn = groupName + File.separator + data.subgroup; } shortcut.setUserType(itsUserType); shortcut.setLinkName(data.name); shortcut.setLinkType(data.type); shortcut.setArguments(data.commandLine); shortcut.setDescription(data.description); shortcut.setIconLocation(data.iconFile, data.iconIndex); shortcut.setShowCommand(data.initialState); shortcut.setTargetPath(data.target); shortcut.setWorkingDirectory(data.workingDirectory); shortcut.setEncoding(data.deskTopEntryLinux_Encoding); shortcut.setMimetype(data.deskTopEntryLinux_MimeType); shortcut.setTerminal(data.deskTopEntryLinux_Terminal); shortcut.setTerminalOptions(data.deskTopEntryLinux_TerminalOptions); shortcut.setType(data.deskTopEntryLinux_Type); shortcut.setKdeSubstUID(data.deskTopEntryLinux_X_KDE_SubstituteUID); shortcut.setURL(data.deskTopEntryLinux_URL); shortcut.setCreateForAll(data.createForAll); if (data.addToGroup) { shortcut.setProgramGroup(tmpgn); } else { shortcut.setProgramGroup(""); } try { // ---------------------------------------------- // save the shortcut only if it is either not on // the desktop or if it is on the desktop and // the user has signalled that it is ok to place // shortcuts on the desktop. // ---------------------------------------------- if ((data.type != Shortcut.DESKTOP) || ((data.type == Shortcut.DESKTOP) && allowDesktopShortcut .isSelected())) { // save the shortcut shortcut.save(); // add the file and directory name to the file list String fileName = shortcut.getFileName(); files.add(0, fileName); File file = new File(fileName); File base = new File(shortcut.getBasePath()); Vector intermediates = new Vector(); //String directoryName = shortcut.getDirectoryCreated (); execFiles.add(new ExecutableFile(fileName, 2, ExecutableFile.WARN, new ArrayList(), false)); files.add(fileName); while ((file = file.getParentFile()) != null) { if (file.equals(base)) break; intermediates.add(file); } if (file != null) { for (Iterator iter = intermediates.iterator(); iter.hasNext();) files.add(0, iter.next().toString()); } } } catch (Exception exception) {} } catch (Throwable exception) { } } // try { if (execFiles != null) { FileExecutor executor = new FileExecutor(execFiles); // // TODO: Hi Guys, // TODO The following commented-out line sometimes produces an uncatchable // nullpointer Exception! // TODO evaluate for what reason the files should exec. // TODO if there is a serious explanation, why to do that, // TODO the code must be more robust //evaluate executor.executeFiles( ExecutableFile.NEVER, null ); } } catch (NullPointerException nep) { nep.printStackTrace(); } catch (RuntimeException cannot) { cannot.printStackTrace(); } parent.unlockNextButton(); } | 54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/ea2c1c334b491cd6926af6502699f487604c17bc/ShortcutPanel.java/clean/src/lib/com/izforge/izpack/panels/ShortcutPanel.java |
||
private void createShortcuts() { if (!create) return; ShortcutData data; String tmpgn; for (int i = 0; i < shortcuts.size(); i++) { data = (ShortcutData) shortcuts.elementAt(i); try { //The cloning guarantees that data.subgroup will not be null. //See ShortcutData.cloneString if (data.subgroup.length() > 0 && (data.subgroup.charAt(0) == '/' || data.subgroup.charAt(0) == '\\')) { tmpgn = groupName + data.subgroup; } else { tmpgn = groupName + File.separator + data.subgroup; } shortcut.setUserType(itsUserType); shortcut.setLinkName(data.name); shortcut.setLinkType(data.type); shortcut.setArguments(data.commandLine); shortcut.setDescription(data.description); shortcut.setIconLocation(data.iconFile, data.iconIndex); shortcut.setShowCommand(data.initialState); shortcut.setTargetPath(data.target); shortcut.setWorkingDirectory(data.workingDirectory); shortcut.setEncoding(data.deskTopEntryLinux_Encoding); shortcut.setMimetype(data.deskTopEntryLinux_MimeType); shortcut.setTerminal(data.deskTopEntryLinux_Terminal); shortcut.setTerminalOptions(data.deskTopEntryLinux_TerminalOptions); shortcut.setType(data.deskTopEntryLinux_Type); shortcut.setKdeSubstUID(data.deskTopEntryLinux_X_KDE_SubstituteUID); shortcut.setURL(data.deskTopEntryLinux_URL); shortcut.setCreateForAll(data.createForAll); if (data.addToGroup) { shortcut.setProgramGroup(tmpgn); } else { shortcut.setProgramGroup(""); } try { // ---------------------------------------------- // save the shortcut only if it is either not on // the desktop or if it is on the desktop and // the user has signalled that it is ok to place // shortcuts on the desktop. // ---------------------------------------------- if ((data.type != Shortcut.DESKTOP) || ((data.type == Shortcut.DESKTOP) && allowDesktopShortcut .isSelected())) { // save the shortcut shortcut.save(); // add the file and directory name to the file list String fileName = shortcut.getFileName(); files.add(0, fileName); File file = new File(fileName); File base = new File(shortcut.getBasePath()); Vector intermediates = new Vector(); //String directoryName = shortcut.getDirectoryCreated (); execFiles.add(new ExecutableFile(fileName, 2, ExecutableFile.WARN, new ArrayList(), false)); files.add(fileName); while ((file = file.getParentFile()) != null) { if (file.equals(base)) break; intermediates.add(file); } if (file != null) { for (Iterator iter = intermediates.iterator(); iter.hasNext();) files.add(0, iter.next().toString()); } } } catch (Exception exception) {} } catch (Throwable exception) { } } // try { if (execFiles != null) { FileExecutor executor = new FileExecutor(execFiles); // // TODO: Hi Guys, // TODO The following commented-out line sometimes produces an uncatchable // nullpointer Exception! // TODO evaluate for what reason the files should exec. // TODO if there is a serious explanation, why to do that, // TODO the code must be more robust //evaluate executor.executeFiles( ExecutableFile.NEVER, null ); } } catch (NullPointerException nep) { nep.printStackTrace(); } catch (RuntimeException cannot) { cannot.printStackTrace(); } parent.unlockNextButton(); } | 54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/ea2c1c334b491cd6926af6502699f487604c17bc/ShortcutPanel.java/clean/src/lib/com/izforge/izpack/panels/ShortcutPanel.java |
||
parent.unlockNextButton(); | private void createShortcuts() { if (!create) return; ShortcutData data; String tmpgn; for (int i = 0; i < shortcuts.size(); i++) { data = (ShortcutData) shortcuts.elementAt(i); try { //The cloning guarantees that data.subgroup will not be null. //See ShortcutData.cloneString if (data.subgroup.length() > 0 && (data.subgroup.charAt(0) == '/' || data.subgroup.charAt(0) == '\\')) { tmpgn = groupName + data.subgroup; } else { tmpgn = groupName + File.separator + data.subgroup; } shortcut.setUserType(itsUserType); shortcut.setLinkName(data.name); shortcut.setLinkType(data.type); shortcut.setArguments(data.commandLine); shortcut.setDescription(data.description); shortcut.setIconLocation(data.iconFile, data.iconIndex); shortcut.setShowCommand(data.initialState); shortcut.setTargetPath(data.target); shortcut.setWorkingDirectory(data.workingDirectory); shortcut.setEncoding(data.deskTopEntryLinux_Encoding); shortcut.setMimetype(data.deskTopEntryLinux_MimeType); shortcut.setTerminal(data.deskTopEntryLinux_Terminal); shortcut.setTerminalOptions(data.deskTopEntryLinux_TerminalOptions); shortcut.setType(data.deskTopEntryLinux_Type); shortcut.setKdeSubstUID(data.deskTopEntryLinux_X_KDE_SubstituteUID); shortcut.setURL(data.deskTopEntryLinux_URL); shortcut.setCreateForAll(data.createForAll); if (data.addToGroup) { shortcut.setProgramGroup(tmpgn); } else { shortcut.setProgramGroup(""); } try { // ---------------------------------------------- // save the shortcut only if it is either not on // the desktop or if it is on the desktop and // the user has signalled that it is ok to place // shortcuts on the desktop. // ---------------------------------------------- if ((data.type != Shortcut.DESKTOP) || ((data.type == Shortcut.DESKTOP) && allowDesktopShortcut .isSelected())) { // save the shortcut shortcut.save(); // add the file and directory name to the file list String fileName = shortcut.getFileName(); files.add(0, fileName); File file = new File(fileName); File base = new File(shortcut.getBasePath()); Vector intermediates = new Vector(); //String directoryName = shortcut.getDirectoryCreated (); execFiles.add(new ExecutableFile(fileName, 2, ExecutableFile.WARN, new ArrayList(), false)); files.add(fileName); while ((file = file.getParentFile()) != null) { if (file.equals(base)) break; intermediates.add(file); } if (file != null) { for (Iterator iter = intermediates.iterator(); iter.hasNext();) files.add(0, iter.next().toString()); } } } catch (Exception exception) {} } catch (Throwable exception) { } } // try { if (execFiles != null) { FileExecutor executor = new FileExecutor(execFiles); // // TODO: Hi Guys, // TODO The following commented-out line sometimes produces an uncatchable // nullpointer Exception! // TODO evaluate for what reason the files should exec. // TODO if there is a serious explanation, why to do that, // TODO the code must be more robust //evaluate executor.executeFiles( ExecutableFile.NEVER, null ); } } catch (NullPointerException nep) { nep.printStackTrace(); } catch (RuntimeException cannot) { cannot.printStackTrace(); } parent.unlockNextButton(); } | 54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/ea2c1c334b491cd6926af6502699f487604c17bc/ShortcutPanel.java/clean/src/lib/com/izforge/izpack/panels/ShortcutPanel.java |
|
private File getProgramsFolder(int userType) { String path = shortcut.getProgramsFolder(userType); return (new File(path)); //} //else //{ // TODO // 0pt. Test if KDE is installed. //boolean isKdeInstalled = UnixHelper.kdeIsInstalled(); // 1. Test if User can write into // File kdeRootShareApplinkDir = getKDERootShareApplinkDir(); // if so: return getKDERootShareApplinkDir() // else // return getKDEUsersShareApplinkDir() + //} //return(result); } | 54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/ea2c1c334b491cd6926af6502699f487604c17bc/ShortcutPanel.java/clean/src/lib/com/izforge/izpack/panels/ShortcutPanel.java |
||
private File getProgramsFolder(int userType) { String path = shortcut.getProgramsFolder(userType); return (new File(path)); //} //else //{ // TODO // 0pt. Test if KDE is installed. //boolean isKdeInstalled = UnixHelper.kdeIsInstalled(); // 1. Test if User can write into // File kdeRootShareApplinkDir = getKDERootShareApplinkDir(); // if so: return getKDERootShareApplinkDir() // else // return getKDEUsersShareApplinkDir() + //} //return(result); } | 54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/ea2c1c334b491cd6926af6502699f487604c17bc/ShortcutPanel.java/clean/src/lib/com/izforge/izpack/panels/ShortcutPanel.java |
||
private File getProgramsFolder(int userType) { String path = shortcut.getProgramsFolder(userType); return (new File(path)); //} //else //{ // TODO // 0pt. Test if KDE is installed. //boolean isKdeInstalled = UnixHelper.kdeIsInstalled(); // 1. Test if User can write into // File kdeRootShareApplinkDir = getKDERootShareApplinkDir(); // if so: return getKDERootShareApplinkDir() // else // return getKDEUsersShareApplinkDir() + //} //return(result); } | 54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/ea2c1c334b491cd6926af6502699f487604c17bc/ShortcutPanel.java/clean/src/lib/com/izforge/izpack/panels/ShortcutPanel.java |
||
public boolean isValidated() { try { groupName = programGroup.getText(); } catch (Throwable exception) { groupName = ""; } create = createShortcuts.isSelected(); createShortcuts(); // add files and directories to the uninstaller addToUninstaller(); return (true); } | 54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/ea2c1c334b491cd6926af6502699f487604c17bc/ShortcutPanel.java/clean/src/lib/com/izforge/izpack/panels/ShortcutPanel.java |
||
if (!shortcutsToCreate || !shortcut.supported() || groupName == null || simulteNotSupported) { return; } | if (!shortcutsToCreate || !shortcut.supported() || (groupName == null) || simulteNotSupported) { return; } | public void makeXMLData(XMLElement panelRoot) { // ---------------------------------------------------- // if there are no shortcuts to create, shortcuts are // not supported, or we should simulate that they are // not supported, then we have nothing to add. Just // return // ---------------------------------------------------- if (!shortcutsToCreate || !shortcut.supported() || groupName == null || simulteNotSupported) { return; } ShortcutData data; XMLElement dataElement; // ---------------------------------------------------- // add the item that defines the name of the program group // ---------------------------------------------------- dataElement = new XMLElement(AUTO_KEY_PROGRAM_GROUP); dataElement.setAttribute(AUTO_ATTRIBUTE_NAME, groupName); panelRoot.addChild(dataElement); // ---------------------------------------------------- // add the details for each of the shortcuts // ---------------------------------------------------- for (int i = 0; i < shortcuts.size(); i++) { data = (ShortcutData) shortcuts.elementAt(i); dataElement = new XMLElement(AUTO_KEY_SHORTCUT); dataElement.setAttribute(AUTO_ATTRIBUTE_NAME, data.name); dataElement.setAttribute(AUTO_ATTRIBUTE_GROUP, Boolean.valueOf(data.addToGroup) .toString()); dataElement.setAttribute(AUTO_ATTRIBUTE_TYPE, Integer.toString(data.type)); dataElement.setAttribute(AUTO_ATTRIBUTE_COMMAND, data.commandLine); dataElement.setAttribute(AUTO_ATTRIBUTE_DESCRIPTION, data.description); dataElement.setAttribute(AUTO_ATTRIBUTE_ICON, data.iconFile); dataElement.setAttribute(AUTO_ATTRIBUTE_ICON_INDEX, Integer.toString(data.iconIndex)); dataElement.setAttribute(AUTO_ATTRIBUTE_INITIAL_STATE, Integer .toString(data.initialState)); dataElement.setAttribute(AUTO_ATTRIBUTE_TARGET, data.target); dataElement.setAttribute(AUTO_ATTRIBUTE_WORKING_DIR, data.workingDirectory); // ---------------------------------------------- // add the shortcut only if it is either not on // the desktop or if it is on the desktop and // the user has signalled that it is ok to place // shortcuts on the desktop. // ---------------------------------------------- if ((data.type != Shortcut.DESKTOP) || ((data.type == Shortcut.DESKTOP) && allowDesktopShortcut.isSelected())) { panelRoot.addChild(dataElement); } } } | 54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/ea2c1c334b491cd6926af6502699f487604c17bc/ShortcutPanel.java/clean/src/lib/com/izforge/izpack/panels/ShortcutPanel.java |
dataElement.setAttribute(AUTO_ATTRIBUTE_GROUP, Boolean.valueOf(data.addToGroup) .toString()); | dataElement.setAttribute(AUTO_ATTRIBUTE_GROUP, (data.addToGroup ? Boolean.TRUE : Boolean.FALSE).toString()); | public void makeXMLData(XMLElement panelRoot) { // ---------------------------------------------------- // if there are no shortcuts to create, shortcuts are // not supported, or we should simulate that they are // not supported, then we have nothing to add. Just // return // ---------------------------------------------------- if (!shortcutsToCreate || !shortcut.supported() || groupName == null || simulteNotSupported) { return; } ShortcutData data; XMLElement dataElement; // ---------------------------------------------------- // add the item that defines the name of the program group // ---------------------------------------------------- dataElement = new XMLElement(AUTO_KEY_PROGRAM_GROUP); dataElement.setAttribute(AUTO_ATTRIBUTE_NAME, groupName); panelRoot.addChild(dataElement); // ---------------------------------------------------- // add the details for each of the shortcuts // ---------------------------------------------------- for (int i = 0; i < shortcuts.size(); i++) { data = (ShortcutData) shortcuts.elementAt(i); dataElement = new XMLElement(AUTO_KEY_SHORTCUT); dataElement.setAttribute(AUTO_ATTRIBUTE_NAME, data.name); dataElement.setAttribute(AUTO_ATTRIBUTE_GROUP, Boolean.valueOf(data.addToGroup) .toString()); dataElement.setAttribute(AUTO_ATTRIBUTE_TYPE, Integer.toString(data.type)); dataElement.setAttribute(AUTO_ATTRIBUTE_COMMAND, data.commandLine); dataElement.setAttribute(AUTO_ATTRIBUTE_DESCRIPTION, data.description); dataElement.setAttribute(AUTO_ATTRIBUTE_ICON, data.iconFile); dataElement.setAttribute(AUTO_ATTRIBUTE_ICON_INDEX, Integer.toString(data.iconIndex)); dataElement.setAttribute(AUTO_ATTRIBUTE_INITIAL_STATE, Integer .toString(data.initialState)); dataElement.setAttribute(AUTO_ATTRIBUTE_TARGET, data.target); dataElement.setAttribute(AUTO_ATTRIBUTE_WORKING_DIR, data.workingDirectory); // ---------------------------------------------- // add the shortcut only if it is either not on // the desktop or if it is on the desktop and // the user has signalled that it is ok to place // shortcuts on the desktop. // ---------------------------------------------- if ((data.type != Shortcut.DESKTOP) || ((data.type == Shortcut.DESKTOP) && allowDesktopShortcut.isSelected())) { panelRoot.addChild(dataElement); } } } | 54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/ea2c1c334b491cd6926af6502699f487604c17bc/ShortcutPanel.java/clean/src/lib/com/izforge/izpack/panels/ShortcutPanel.java |
if (firstTime) firstTime = false; else return; | try { readShortcutSpec(); } catch (Throwable exception) { System.out.println("could not read shortcut spec!"); exception.printStackTrace(); } try { shortcut = (Shortcut) (TargetFactory.getInstance() .makeObject("com.izforge.izpack.util.os.Shortcut")); shortcut.initialize(Shortcut.APPLICATIONS, "-"); } catch (Throwable exception) { System.out.println("could not create shortcut instance"); exception.printStackTrace(); } | public void panelActivate() { if (firstTime) firstTime = false; else return; analyzeShortcutSpec(); if (shortcutsToCreate && !OsVersion.IS_OSX) { if (shortcut.supported() && !simulteNotSupported) { File allUsersProgramsFolder = getProgramsFolder(Shortcut.ALL_USERS); isRootUser = allUsersProgramsFolder.canWrite(); if (isRootUser) itsUserType = Shortcut.ALL_USERS; else itsUserType = Shortcut.CURRENT_USER; buildUI( getProgramsFolder(isRootUser ? Shortcut.ALL_USERS : Shortcut.CURRENT_USER) ); } else { if (skipIfNotSupported) { parent.skipPanel(); } else { buildAlternateUI(); parent.unlockNextButton(); parent.lockPrevButton(); } } } else { parent.skipPanel (); } } | 54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/ea2c1c334b491cd6926af6502699f487604c17bc/ShortcutPanel.java/clean/src/lib/com/izforge/izpack/panels/ShortcutPanel.java |
if (shortcutsToCreate && !OsVersion.IS_OSX) | if (shortcutsToCreate) | public void panelActivate() { if (firstTime) firstTime = false; else return; analyzeShortcutSpec(); if (shortcutsToCreate && !OsVersion.IS_OSX) { if (shortcut.supported() && !simulteNotSupported) { File allUsersProgramsFolder = getProgramsFolder(Shortcut.ALL_USERS); isRootUser = allUsersProgramsFolder.canWrite(); if (isRootUser) itsUserType = Shortcut.ALL_USERS; else itsUserType = Shortcut.CURRENT_USER; buildUI( getProgramsFolder(isRootUser ? Shortcut.ALL_USERS : Shortcut.CURRENT_USER) ); } else { if (skipIfNotSupported) { parent.skipPanel(); } else { buildAlternateUI(); parent.unlockNextButton(); parent.lockPrevButton(); } } } else { parent.skipPanel (); } } | 54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/ea2c1c334b491cd6926af6502699f487604c17bc/ShortcutPanel.java/clean/src/lib/com/izforge/izpack/panels/ShortcutPanel.java |
buildUI( getProgramsFolder(isRootUser ? Shortcut.ALL_USERS : Shortcut.CURRENT_USER) ); | buildUI(getProgramsFolder(isRootUser ? Shortcut.ALL_USERS : Shortcut.CURRENT_USER)); | public void panelActivate() { if (firstTime) firstTime = false; else return; analyzeShortcutSpec(); if (shortcutsToCreate && !OsVersion.IS_OSX) { if (shortcut.supported() && !simulteNotSupported) { File allUsersProgramsFolder = getProgramsFolder(Shortcut.ALL_USERS); isRootUser = allUsersProgramsFolder.canWrite(); if (isRootUser) itsUserType = Shortcut.ALL_USERS; else itsUserType = Shortcut.CURRENT_USER; buildUI( getProgramsFolder(isRootUser ? Shortcut.ALL_USERS : Shortcut.CURRENT_USER) ); } else { if (skipIfNotSupported) { parent.skipPanel(); } else { buildAlternateUI(); parent.unlockNextButton(); parent.lockPrevButton(); } } } else { parent.skipPanel (); } } | 54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/ea2c1c334b491cd6926af6502699f487604c17bc/ShortcutPanel.java/clean/src/lib/com/izforge/izpack/panels/ShortcutPanel.java |
if (skipIfNotSupported) { parent.skipPanel(); } else { buildAlternateUI(); parent.unlockNextButton(); parent.lockPrevButton(); } | buildAlternateUI(); | public void panelActivate() { if (firstTime) firstTime = false; else return; analyzeShortcutSpec(); if (shortcutsToCreate && !OsVersion.IS_OSX) { if (shortcut.supported() && !simulteNotSupported) { File allUsersProgramsFolder = getProgramsFolder(Shortcut.ALL_USERS); isRootUser = allUsersProgramsFolder.canWrite(); if (isRootUser) itsUserType = Shortcut.ALL_USERS; else itsUserType = Shortcut.CURRENT_USER; buildUI( getProgramsFolder(isRootUser ? Shortcut.ALL_USERS : Shortcut.CURRENT_USER) ); } else { if (skipIfNotSupported) { parent.skipPanel(); } else { buildAlternateUI(); parent.unlockNextButton(); parent.lockPrevButton(); } } } else { parent.skipPanel (); } } | 54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/ea2c1c334b491cd6926af6502699f487604c17bc/ShortcutPanel.java/clean/src/lib/com/izforge/izpack/panels/ShortcutPanel.java |
parent.skipPanel (); | ; | public void panelActivate() { if (firstTime) firstTime = false; else return; analyzeShortcutSpec(); if (shortcutsToCreate && !OsVersion.IS_OSX) { if (shortcut.supported() && !simulteNotSupported) { File allUsersProgramsFolder = getProgramsFolder(Shortcut.ALL_USERS); isRootUser = allUsersProgramsFolder.canWrite(); if (isRootUser) itsUserType = Shortcut.ALL_USERS; else itsUserType = Shortcut.CURRENT_USER; buildUI( getProgramsFolder(isRootUser ? Shortcut.ALL_USERS : Shortcut.CURRENT_USER) ); } else { if (skipIfNotSupported) { parent.skipPanel(); } else { buildAlternateUI(); parent.unlockNextButton(); parent.lockPrevButton(); } } } else { parent.skipPanel (); } } | 54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/ea2c1c334b491cd6926af6502699f487604c17bc/ShortcutPanel.java/clean/src/lib/com/izforge/izpack/panels/ShortcutPanel.java |
if (input == null) { haveShortcutSpec = false; return; } | private void readShortcutSpec() throws Exception { // open an input stream InputStream input = null; try { input = parent.getResource(TargetFactory.getCurrentOSPrefix() + SPEC_FILE_NAME); } catch (ResourceNotFoundException rnfE) { input = parent.getResource(SPEC_FILE_NAME); if (input == null) { haveShortcutSpec = false; return; } } // if( input == null ) // { // haveShortcutSpec = false; // return; // } // initialize the parser StdXMLParser parser = new StdXMLParser(); parser.setBuilder(new StdXMLBuilder()); parser.setValidator(new NonValidator()); parser.setReader(new StdXMLReader(input)); // get the data spec = (XMLElement) parser.parse(); // close the stream input.close(); haveShortcutSpec = true; } | 54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/ea2c1c334b491cd6926af6502699f487604c17bc/ShortcutPanel.java/clean/src/lib/com/izforge/izpack/panels/ShortcutPanel.java |
|
if (input == null) { haveShortcutSpec = false; return; } | private void readShortcutSpec() throws Exception { // open an input stream InputStream input = null; try { input = parent.getResource(TargetFactory.getCurrentOSPrefix() + SPEC_FILE_NAME); } catch (ResourceNotFoundException rnfE) { input = parent.getResource(SPEC_FILE_NAME); if (input == null) { haveShortcutSpec = false; return; } } // if( input == null ) // { // haveShortcutSpec = false; // return; // } // initialize the parser StdXMLParser parser = new StdXMLParser(); parser.setBuilder(new StdXMLBuilder()); parser.setValidator(new NonValidator()); parser.setReader(new StdXMLReader(input)); // get the data spec = (XMLElement) parser.parse(); // close the stream input.close(); haveShortcutSpec = true; } | 54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/ea2c1c334b491cd6926af6502699f487604c17bc/ShortcutPanel.java/clean/src/lib/com/izforge/izpack/panels/ShortcutPanel.java |
|
parser.setReader(new StdXMLReader(input)); | parser.setReader(StdXMLReader.stringReader(substitutedSpec)); | private void readShortcutSpec() throws Exception { // open an input stream InputStream input = null; try { input = parent.getResource(TargetFactory.getCurrentOSPrefix() + SPEC_FILE_NAME); } catch (ResourceNotFoundException rnfE) { input = parent.getResource(SPEC_FILE_NAME); if (input == null) { haveShortcutSpec = false; return; } } // if( input == null ) // { // haveShortcutSpec = false; // return; // } // initialize the parser StdXMLParser parser = new StdXMLParser(); parser.setBuilder(new StdXMLBuilder()); parser.setValidator(new NonValidator()); parser.setReader(new StdXMLReader(input)); // get the data spec = (XMLElement) parser.parse(); // close the stream input.close(); haveShortcutSpec = true; } | 54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/ea2c1c334b491cd6926af6502699f487604c17bc/ShortcutPanel.java/clean/src/lib/com/izforge/izpack/panels/ShortcutPanel.java |
public void runAutomated(XMLElement panelRoot) { // ---------------------------------------------------- // if shortcuts are not supported, then we can not // create shortcuts, even if there was any install // data. Just return. // ---------------------------------------------------- if (!shortcut.supported()) { return; } if (!OsConstraint.oneMatchesCurrentSystem(panelRoot)) { return; } shortcuts = new Vector(); Vector shortcutElements; ShortcutData data; XMLElement dataElement; // ---------------------------------------------------- // set the name of the program group // ---------------------------------------------------- dataElement = panelRoot.getFirstChildNamed(AUTO_KEY_PROGRAM_GROUP); groupName = dataElement.getAttribute(AUTO_ATTRIBUTE_NAME); if (groupName == null) { groupName = ""; } // ---------------------------------------------------- // add the details for each of the shortcuts // ---------------------------------------------------- shortcutElements = panelRoot.getChildrenNamed(AUTO_KEY_SHORTCUT); for (int i = 0; i < shortcutElements.size(); i++) { data = new ShortcutData(); dataElement = (XMLElement) shortcutElements.elementAt(i); data.name = dataElement.getAttribute(AUTO_ATTRIBUTE_NAME); data.addToGroup = Boolean.valueOf(dataElement.getAttribute(AUTO_ATTRIBUTE_GROUP)) .booleanValue(); data.type = Integer.valueOf(dataElement.getAttribute(AUTO_ATTRIBUTE_TYPE)).intValue(); data.commandLine = dataElement.getAttribute(AUTO_ATTRIBUTE_COMMAND); data.description = dataElement.getAttribute(AUTO_ATTRIBUTE_DESCRIPTION); data.iconFile = dataElement.getAttribute(AUTO_ATTRIBUTE_ICON); data.iconIndex = Integer.valueOf(dataElement.getAttribute(AUTO_ATTRIBUTE_ICON_INDEX)) .intValue(); data.initialState = Integer.valueOf( dataElement.getAttribute(AUTO_ATTRIBUTE_INITIAL_STATE)).intValue(); data.target = dataElement.getAttribute(AUTO_ATTRIBUTE_TARGET); data.workingDirectory = dataElement.getAttribute(AUTO_ATTRIBUTE_WORKING_DIR); shortcuts.add(data); } createShortcuts(); } | 54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/ea2c1c334b491cd6926af6502699f487604c17bc/ShortcutPanel.java/clean/src/lib/com/izforge/izpack/panels/ShortcutPanel.java |
||
{ if (Unpacker.isDiscardInterrupt() && interruptCount < MAX_INTERRUPT) { interruptCount++; return; } if (!installdata.canClose) JOptionPane.showMessageDialog(null, langpack.getString("installer.quit.message"), langpack.getString("installer.warning"), JOptionPane.ERROR_MESSAGE); wipeAborted(); Housekeeper.getInstance().shutDown(0); } | { exit(); } | public void windowClosing(WindowEvent e) { if (Unpacker.isDiscardInterrupt() && interruptCount < MAX_INTERRUPT) { // But we should not interrupt. interruptCount++; return; } // We show an alert anyway if (!installdata.canClose) JOptionPane.showMessageDialog(null, langpack.getString("installer.quit.message"), langpack.getString("installer.warning"), JOptionPane.ERROR_MESSAGE); wipeAborted(); Housekeeper.getInstance().shutDown(0); } | 54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/00efe4c6c731d1255e91d5c05cf89d1e08d52364/InstallerFrame.java/clean/src/lib/com/izforge/izpack/installer/InstallerFrame.java |
this.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE); | private void buildGUI() { // Sets the frame icon setIconImage(icons.getImageIcon("JFrameIcon").getImage()); // Prepares the glass pane to block the gui interaction when needed JPanel glassPane = (JPanel) getGlassPane(); glassPane.addMouseListener(new MouseAdapter() {}); glassPane.addMouseMotionListener(new MouseMotionAdapter() {}); glassPane.addKeyListener(new KeyAdapter() {}); glassPane.addFocusListener(new FocusAdapter() {}); // We set the layout & prepare the constraint object contentPane = (JPanel) getContentPane(); contentPane.setLayout(new BorderLayout()); // layout); // We add the panels container panelsContainer = new JPanel(); panelsContainer.setBorder(BorderFactory.createEmptyBorder(10, 10, 0, 10)); panelsContainer.setLayout(new GridLayout(1, 1)); contentPane.add(panelsContainer, BorderLayout.CENTER); // We put the first panel installdata.curPanelNumber = 0; IzPanel panel_0 = (IzPanel) installdata.panels.get(0); panelsContainer.add(panel_0); // We add the navigation buttons & labels NavigationHandler navHandler = new NavigationHandler(); JPanel navPanel = new JPanel(); navPanel.setLayout(new BoxLayout(navPanel, BoxLayout.X_AXIS)); navPanel.setBorder(BorderFactory.createCompoundBorder(BorderFactory.createEmptyBorder(8, 8, 8, 8), BorderFactory.createTitledBorder(new EtchedLineBorder(), langpack .getString("installer.madewith") + " "))); navPanel.add(Box.createHorizontalGlue()); prevButton = ButtonFactory.createButton(langpack.getString("installer.prev"), icons .getImageIcon("stepback"), installdata.buttonsHColor); navPanel.add(prevButton); prevButton.addActionListener(navHandler); navPanel.add(Box.createRigidArea(new Dimension(5, 0))); nextButton = ButtonFactory.createButton(langpack.getString("installer.next"), icons .getImageIcon("stepforward"), installdata.buttonsHColor); navPanel.add(nextButton); nextButton.addActionListener(navHandler); navPanel.add(Box.createRigidArea(new Dimension(5, 0))); quitButton = ButtonFactory.createButton(langpack.getString("installer.quit"), icons .getImageIcon("stop"), installdata.buttonsHColor); navPanel.add(quitButton); quitButton.addActionListener(navHandler); contentPane.add(navPanel, BorderLayout.SOUTH); try { ResourceManager rm = ResourceManager.getInstance(); ImageIcon icon; try { icon = rm.getImageIconResource("Installer.image"); } catch (Exception e) // This is not that clean ... { icon = rm.getImageIconResource("Installer.image.0"); } if (icon != null) { JPanel imgPanel = new JPanel(); imgPanel.setLayout(new BorderLayout()); imgPanel.setBorder(BorderFactory.createEmptyBorder(10, 10, 0, 0)); iconLabel = new JLabel(icon); iconLabel.setBorder(BorderFactory.createLoweredBevelBorder()); imgPanel.add(iconLabel, BorderLayout.NORTH); contentPane.add(imgPanel, BorderLayout.WEST); } } catch (Exception e) { // ignore } loadImage(0); getRootPane().setDefaultButton(nextButton); } | 54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/00efe4c6c731d1255e91d5c05cf89d1e08d52364/InstallerFrame.java/clean/src/lib/com/izforge/izpack/installer/InstallerFrame.java |
|
paramList.add("-cp " + file.toString()); | paramList.add("-cp"); paramList.add(file.toString()); | public int executeFiles(int currentStage, AbstractUIHandler handler) { int exitStatus = 0; String[] output = new String[2]; String pathSep = System.getProperty("path.separator"); String osName = System.getProperty("os.name").toLowerCase(); //String permissions = (System.getProperty("user.name").equals("root")) ? "a+x" : "u+x"; String permissions = "a+x"; // loop through all executables Iterator efileIterator = files.iterator(); while ((exitStatus == 0) && efileIterator.hasNext()) { ExecutableFile efile = (ExecutableFile) efileIterator.next(); boolean deleteAfterwards = ! efile.keepFile; File file = new File(efile.path); Debug.trace("handeling executable file "+efile); // skip file if not for current OS (it might not have been installed at all) if (! OsConstraint.oneMatchesCurrentSystem (efile.osList)) continue; if(currentStage!=ExecutableFile.UNINSTALL) { // fix executable permission for unix systems if (pathSep.equals(":") && (!osName.startsWith("mac") || osName.endsWith("x"))) { Debug.trace("making file executable (setting executable flag)"); String[] params = {"/bin/chmod", permissions, file.toString()}; exitStatus = executeCommand(params, output); if (exitStatus != 0) { handler.emitError("file execution error", "Error executing \n"+ params[0]+" "+params[1]+" "+params[2]); continue; } } } // execute command in POSTINSTALL stage if ((exitStatus == 0) && ((currentStage == ExecutableFile.POSTINSTALL && efile.executionStage == ExecutableFile.POSTINSTALL) || (currentStage==ExecutableFile.UNINSTALL && efile.executionStage == ExecutableFile.UNINSTALL))) { List paramList = new ArrayList(); if (ExecutableFile.BIN == efile.type) paramList.add(file.toString()); else if (ExecutableFile.JAR == efile.type && null == efile.mainClass) { paramList.add(System.getProperty("java.home") + "/bin/java"); paramList.add("-jar"); paramList.add(file.toString()); } else if (ExecutableFile.JAR == efile.type && null != efile.mainClass) { paramList.add(System.getProperty("java.home") + "/bin/java"); paramList.add("-cp " + file.toString()); paramList.add(efile.mainClass); } if (null != efile.argList && !efile.argList.isEmpty()) paramList.addAll(efile.argList); String[] params = new String[paramList.size()]; for (int i = 0; i < paramList.size(); i++) params[i] = (String) paramList.get(i); exitStatus = executeCommand(params, output); // bring a dialog depending on return code and failure handling if (exitStatus != 0) { deleteAfterwards = false; String message = output[0] + "\n" + output[1]; if (message.length() == 1) message = new String("Failed to execute " + file.toString() + "."); if (efile.onFailure == ExecutableFile.ABORT) { // CHECKME: let the user decide or abort anyway? handler.emitError("file execution error", message); } else if (efile.onFailure == ExecutableFile.WARN) { // CHECKME: let the user decide or abort anyway? handler.emitWarning ("file execution error", message); exitStatus = 0; } else { if (handler.askQuestion (null, "Continue?", AbstractUIHandler.CHOICES_YES_NO) == AbstractUIHandler.ANSWER_YES) exitStatus = 0; } } } // POSTINSTALL executables will be deleted if (efile.executionStage == ExecutableFile.POSTINSTALL && deleteAfterwards) { if (file.canWrite()) file.delete(); } } return exitStatus; } | 54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/235fe79f4fe63a9166fe121246125a4dc3f23d00/FileExecutor.java/clean/src/lib/com/izforge/izpack/util/FileExecutor.java |
if (tip.equals("CustomActions.tip") || progress.equals("CustomActions.progress")) | if ("CustomActions.tip".equals(tip) || "CustomActions.progress".equals(progress)) | public void afterPacks(AutomatedInstallData idata, AbstractUIProgressHandler handler) throws Exception { if (handler instanceof ExtendedUIProgressHandler && getProgressBarCallerCount() > 0) { String progress = getMsg("CustomActions.progress"); String tip = getMsg("CustomActions.tip"); if (tip.equals("CustomActions.tip") || progress.equals("CustomActions.progress")) { Debug .trace("No messages found for custom action progress bar interactions; skiped."); return; } ((ExtendedUIProgressHandler) handler).restartAction("Configure", progress, tip, getProgressBarCallerCount()); SimpleInstallerListener.doInformProgressBar = true; } } | 54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/9619b3a25f43787dc92011111668210e06c00c71/ProgressBarInstallerListener.java/buggy/src/lib/com/izforge/izpack/event/ProgressBarInstallerListener.java |
if (em.equals("functionFailed.RegOpenKeyEx") || em.equals("functionFailed.RegQueryValueEx")) { return (false); } | if ("functionFailed.RegOpenKeyEx".equals(em) || "functionFailed.RegQueryValueEx".equals(em)) { return (false); } | public boolean valueExist(String key, String value) throws NativeLibException { try { this.getValue(currentRoot, key, value); } catch (NativeLibException ne) { String em = ne.getLibMessage(); if (em.equals("functionFailed.RegOpenKeyEx") || em.equals("functionFailed.RegQueryValueEx")) { return (false); } throw (ne); } return (true); } | 54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/9619b3a25f43787dc92011111668210e06c00c71/RegistryImpl.java/buggy/src/lib/com/coi/tools/os/win/RegistryImpl.java |
if (validateParams != null && validateParams.size() > 0 && validateParamMap == null) | if (validateParams != null && validateParams.size() > 0) | private void addRuleField(XMLElement spec) { Vector forPacks = spec.getChildrenNamed(SELECTEDPACKS); Vector forOs = spec.getChildrenNamed(OS); XMLElement element = spec.getFirstChildNamed(SPEC); String variable = spec.getAttribute(VARIABLE); RuleInputField field = null; JLabel label; String layout; String set; String separator; String format; String validator = null; String message = null; boolean hasParams = false; String paramName = null; String paramValue = null; HashMap validateParamMap = null; Vector validateParams = null; String processor = null; int resultFormat = RuleInputField.DISPLAY_FORMAT; // ---------------------------------------------------- // extract the specification details // ---------------------------------------------------- if (element != null) { label = new JLabel(getText(element)); layout = element.getAttribute(RULE_LAYOUT); set = element.getAttribute(SET); // retrieve value of variable if not specified // (does not work here because of special format for set attribute) // if (set == null) // { // set = idata.getVariable (variable); // } separator = element.getAttribute(RULE_SEPARATOR); format = element.getAttribute(RULE_RESULT_FORMAT); if (format != null) { if (format.equals(RULE_PLAIN_STRING)) { resultFormat = RuleInputField.PLAIN_STRING; } else if (format.equals(RULE_DISPLAY_FORMAT)) { resultFormat = RuleInputField.DISPLAY_FORMAT; } else if (format.equals(RULE_SPECIAL_SEPARATOR)) { resultFormat = RuleInputField.SPECIAL_SEPARATOR; } else if (format.equals(RULE_ENCRYPTED)) { resultFormat = RuleInputField.ENCRYPTED; } } } // ---------------------------------------------------- // if there is no specification element, return without // doing anything. // ---------------------------------------------------- else { return; } // ---------------------------------------------------- // get the description and add it to the list of UI // elements if it exists. // ---------------------------------------------------- element = spec.getFirstChildNamed(DESCRIPTION); addDescription(element, forPacks, forOs); // ---------------------------------------------------- // get the validator and processor if they are defined // ---------------------------------------------------- element = spec.getFirstChildNamed(VALIDATOR); if (element != null) { validator = element.getAttribute(CLASS); message = getText(element); // ---------------------------------------------------------- // check and see if we have any parameters for this validator. // If so, then add them to validateParamMap. // ---------------------------------------------------------- validateParams = element.getChildrenNamed(RULE_PARAM); if (validateParams != null && validateParams.size() > 0 && validateParamMap == null) { validateParamMap = new HashMap(); hasParams = true; } for (Iterator it = validateParams.iterator(); it.hasNext();) { element = (XMLElement) it.next(); paramName = element.getAttribute(RULE_PARAM_NAME); paramValue = element.getAttribute(RULE_PARAM_VALUE); validateParamMap.put(paramName, paramValue); } } element = spec.getFirstChildNamed(PROCESSOR); if (element != null) { processor = element.getAttribute(CLASS); } // ---------------------------------------------------- // create an instance of RuleInputField based on the // extracted specifications, then add it to the list // of UI elements. // ---------------------------------------------------- if (hasParams) { field = new RuleInputField(layout, set, separator, validator, validateParamMap, processor, resultFormat, getToolkit(), idata); } else { field = new RuleInputField(layout, set, separator, validator, processor, resultFormat, getToolkit(), idata); } TwoColumnConstraints constraints = new TwoColumnConstraints(); constraints.position = TwoColumnConstraints.WEST; uiElements .add(new Object[] { null, FIELD_LABEL, null, constraints, label, forPacks, forOs}); TwoColumnConstraints constraints2 = new TwoColumnConstraints(); constraints2.position = TwoColumnConstraints.EAST; uiElements.add(new Object[] { null, RULE_FIELD, variable, constraints2, field, forPacks, forOs, null, null, message}); } | 54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/3eee5d38a1d4b4e7c587e74f8cb9f1b6650c0d54/UserInputPanel.java/buggy/src/lib/com/izforge/izpack/panels/UserInputPanel.java |
validateParamMap = new HashMap(); hasParams = true; | for (Iterator it = validateParams.iterator(); it.hasNext();) { element = (XMLElement) it.next(); paramName = element.getAttribute(RULE_PARAM_NAME); paramValue = element.getAttribute(RULE_PARAM_VALUE); validateParamMap.put(paramName, paramValue); } | private void addRuleField(XMLElement spec) { Vector forPacks = spec.getChildrenNamed(SELECTEDPACKS); Vector forOs = spec.getChildrenNamed(OS); XMLElement element = spec.getFirstChildNamed(SPEC); String variable = spec.getAttribute(VARIABLE); RuleInputField field = null; JLabel label; String layout; String set; String separator; String format; String validator = null; String message = null; boolean hasParams = false; String paramName = null; String paramValue = null; HashMap validateParamMap = null; Vector validateParams = null; String processor = null; int resultFormat = RuleInputField.DISPLAY_FORMAT; // ---------------------------------------------------- // extract the specification details // ---------------------------------------------------- if (element != null) { label = new JLabel(getText(element)); layout = element.getAttribute(RULE_LAYOUT); set = element.getAttribute(SET); // retrieve value of variable if not specified // (does not work here because of special format for set attribute) // if (set == null) // { // set = idata.getVariable (variable); // } separator = element.getAttribute(RULE_SEPARATOR); format = element.getAttribute(RULE_RESULT_FORMAT); if (format != null) { if (format.equals(RULE_PLAIN_STRING)) { resultFormat = RuleInputField.PLAIN_STRING; } else if (format.equals(RULE_DISPLAY_FORMAT)) { resultFormat = RuleInputField.DISPLAY_FORMAT; } else if (format.equals(RULE_SPECIAL_SEPARATOR)) { resultFormat = RuleInputField.SPECIAL_SEPARATOR; } else if (format.equals(RULE_ENCRYPTED)) { resultFormat = RuleInputField.ENCRYPTED; } } } // ---------------------------------------------------- // if there is no specification element, return without // doing anything. // ---------------------------------------------------- else { return; } // ---------------------------------------------------- // get the description and add it to the list of UI // elements if it exists. // ---------------------------------------------------- element = spec.getFirstChildNamed(DESCRIPTION); addDescription(element, forPacks, forOs); // ---------------------------------------------------- // get the validator and processor if they are defined // ---------------------------------------------------- element = spec.getFirstChildNamed(VALIDATOR); if (element != null) { validator = element.getAttribute(CLASS); message = getText(element); // ---------------------------------------------------------- // check and see if we have any parameters for this validator. // If so, then add them to validateParamMap. // ---------------------------------------------------------- validateParams = element.getChildrenNamed(RULE_PARAM); if (validateParams != null && validateParams.size() > 0 && validateParamMap == null) { validateParamMap = new HashMap(); hasParams = true; } for (Iterator it = validateParams.iterator(); it.hasNext();) { element = (XMLElement) it.next(); paramName = element.getAttribute(RULE_PARAM_NAME); paramValue = element.getAttribute(RULE_PARAM_VALUE); validateParamMap.put(paramName, paramValue); } } element = spec.getFirstChildNamed(PROCESSOR); if (element != null) { processor = element.getAttribute(CLASS); } // ---------------------------------------------------- // create an instance of RuleInputField based on the // extracted specifications, then add it to the list // of UI elements. // ---------------------------------------------------- if (hasParams) { field = new RuleInputField(layout, set, separator, validator, validateParamMap, processor, resultFormat, getToolkit(), idata); } else { field = new RuleInputField(layout, set, separator, validator, processor, resultFormat, getToolkit(), idata); } TwoColumnConstraints constraints = new TwoColumnConstraints(); constraints.position = TwoColumnConstraints.WEST; uiElements .add(new Object[] { null, FIELD_LABEL, null, constraints, label, forPacks, forOs}); TwoColumnConstraints constraints2 = new TwoColumnConstraints(); constraints2.position = TwoColumnConstraints.EAST; uiElements.add(new Object[] { null, RULE_FIELD, variable, constraints2, field, forPacks, forOs, null, null, message}); } | 54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/3eee5d38a1d4b4e7c587e74f8cb9f1b6650c0d54/UserInputPanel.java/buggy/src/lib/com/izforge/izpack/panels/UserInputPanel.java |
for (Iterator it = validateParams.iterator(); it.hasNext();) { element = (XMLElement) it.next(); paramName = element.getAttribute(RULE_PARAM_NAME); paramValue = element.getAttribute(RULE_PARAM_VALUE); validateParamMap.put(paramName, paramValue); } | private void addRuleField(XMLElement spec) { Vector forPacks = spec.getChildrenNamed(SELECTEDPACKS); Vector forOs = spec.getChildrenNamed(OS); XMLElement element = spec.getFirstChildNamed(SPEC); String variable = spec.getAttribute(VARIABLE); RuleInputField field = null; JLabel label; String layout; String set; String separator; String format; String validator = null; String message = null; boolean hasParams = false; String paramName = null; String paramValue = null; HashMap validateParamMap = null; Vector validateParams = null; String processor = null; int resultFormat = RuleInputField.DISPLAY_FORMAT; // ---------------------------------------------------- // extract the specification details // ---------------------------------------------------- if (element != null) { label = new JLabel(getText(element)); layout = element.getAttribute(RULE_LAYOUT); set = element.getAttribute(SET); // retrieve value of variable if not specified // (does not work here because of special format for set attribute) // if (set == null) // { // set = idata.getVariable (variable); // } separator = element.getAttribute(RULE_SEPARATOR); format = element.getAttribute(RULE_RESULT_FORMAT); if (format != null) { if (format.equals(RULE_PLAIN_STRING)) { resultFormat = RuleInputField.PLAIN_STRING; } else if (format.equals(RULE_DISPLAY_FORMAT)) { resultFormat = RuleInputField.DISPLAY_FORMAT; } else if (format.equals(RULE_SPECIAL_SEPARATOR)) { resultFormat = RuleInputField.SPECIAL_SEPARATOR; } else if (format.equals(RULE_ENCRYPTED)) { resultFormat = RuleInputField.ENCRYPTED; } } } // ---------------------------------------------------- // if there is no specification element, return without // doing anything. // ---------------------------------------------------- else { return; } // ---------------------------------------------------- // get the description and add it to the list of UI // elements if it exists. // ---------------------------------------------------- element = spec.getFirstChildNamed(DESCRIPTION); addDescription(element, forPacks, forOs); // ---------------------------------------------------- // get the validator and processor if they are defined // ---------------------------------------------------- element = spec.getFirstChildNamed(VALIDATOR); if (element != null) { validator = element.getAttribute(CLASS); message = getText(element); // ---------------------------------------------------------- // check and see if we have any parameters for this validator. // If so, then add them to validateParamMap. // ---------------------------------------------------------- validateParams = element.getChildrenNamed(RULE_PARAM); if (validateParams != null && validateParams.size() > 0 && validateParamMap == null) { validateParamMap = new HashMap(); hasParams = true; } for (Iterator it = validateParams.iterator(); it.hasNext();) { element = (XMLElement) it.next(); paramName = element.getAttribute(RULE_PARAM_NAME); paramValue = element.getAttribute(RULE_PARAM_VALUE); validateParamMap.put(paramName, paramValue); } } element = spec.getFirstChildNamed(PROCESSOR); if (element != null) { processor = element.getAttribute(CLASS); } // ---------------------------------------------------- // create an instance of RuleInputField based on the // extracted specifications, then add it to the list // of UI elements. // ---------------------------------------------------- if (hasParams) { field = new RuleInputField(layout, set, separator, validator, validateParamMap, processor, resultFormat, getToolkit(), idata); } else { field = new RuleInputField(layout, set, separator, validator, processor, resultFormat, getToolkit(), idata); } TwoColumnConstraints constraints = new TwoColumnConstraints(); constraints.position = TwoColumnConstraints.WEST; uiElements .add(new Object[] { null, FIELD_LABEL, null, constraints, label, forPacks, forOs}); TwoColumnConstraints constraints2 = new TwoColumnConstraints(); constraints2.position = TwoColumnConstraints.EAST; uiElements.add(new Object[] { null, RULE_FIELD, variable, constraints2, field, forPacks, forOs, null, null, message}); } | 54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/3eee5d38a1d4b4e7c587e74f8cb9f1b6650c0d54/UserInputPanel.java/buggy/src/lib/com/izforge/izpack/panels/UserInputPanel.java |
|
CursorableLinkedList pool = null; synchronized(this) { pool = (CursorableLinkedList)(_poolMap.get(key)); if(null == pool) { pool = new CursorableLinkedList(); _poolMap.put(key, pool); _poolList.add(key); } } | public void returnObject(Object key, Object obj) throws Exception { // grab the pool (list) of objects associated with the given key CursorableLinkedList pool = null; synchronized(this) { pool = (CursorableLinkedList)(_poolMap.get(key)); // if it doesn't exist, create it if(null == pool) { pool = new CursorableLinkedList(); _poolMap.put(key, pool); _poolList.add(key); } } // if we need to validate this object, do so boolean success = true; // whether or not this object passed validation if((_testOnReturn && !_factory.validateObject(key, obj))) { success = false; try { _factory.destroyObject(key, obj); } catch(Exception e) { // ignored } } else { try { _factory.passivateObject(key, obj); } catch(Exception e) { success = false; } } boolean shouldDestroy = false; synchronized(this) { // subtract one from the total and keyed active counts _totalActive--; Integer active = (Integer)(_activeMap.get(key)); if(null == active) { // do nothing, either null or zero is OK } else if(active.intValue() <= 1) { _activeMap.remove(key); } else { _activeMap.put(key, new Integer(active.intValue() - 1)); } // if there's no space in the pool, flag the object // for destruction // else if we passivated succesfully, return it to the pool if(_maxIdle >= 0 && (pool.size() >= _maxIdle)) { shouldDestroy = true; } else if(success) { pool.addFirst(new ObjectTimestampPair(obj)); _totalIdle++; } notifyAll(); } if(shouldDestroy) { try { _factory.destroyObject(key, obj); } catch(Exception e) { // ignored? } } } | 50977 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50977/a96fe5bef050cd30b1714c3bdb4fbba7f5db1807/GenericKeyedObjectPool.java/clean/src/java/org/apache/commons/pool/impl/GenericKeyedObjectPool.java |
|
CursorableLinkedList pool = (CursorableLinkedList) (_poolMap.get(key)); if(null == pool) { pool = new CursorableLinkedList(); _poolMap.put(key, pool); _poolList.add(key); } | public void returnObject(Object key, Object obj) throws Exception { // grab the pool (list) of objects associated with the given key CursorableLinkedList pool = null; synchronized(this) { pool = (CursorableLinkedList)(_poolMap.get(key)); // if it doesn't exist, create it if(null == pool) { pool = new CursorableLinkedList(); _poolMap.put(key, pool); _poolList.add(key); } } // if we need to validate this object, do so boolean success = true; // whether or not this object passed validation if((_testOnReturn && !_factory.validateObject(key, obj))) { success = false; try { _factory.destroyObject(key, obj); } catch(Exception e) { // ignored } } else { try { _factory.passivateObject(key, obj); } catch(Exception e) { success = false; } } boolean shouldDestroy = false; synchronized(this) { // subtract one from the total and keyed active counts _totalActive--; Integer active = (Integer)(_activeMap.get(key)); if(null == active) { // do nothing, either null or zero is OK } else if(active.intValue() <= 1) { _activeMap.remove(key); } else { _activeMap.put(key, new Integer(active.intValue() - 1)); } // if there's no space in the pool, flag the object // for destruction // else if we passivated succesfully, return it to the pool if(_maxIdle >= 0 && (pool.size() >= _maxIdle)) { shouldDestroy = true; } else if(success) { pool.addFirst(new ObjectTimestampPair(obj)); _totalIdle++; } notifyAll(); } if(shouldDestroy) { try { _factory.destroyObject(key, obj); } catch(Exception e) { // ignored? } } } | 50977 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50977/a96fe5bef050cd30b1714c3bdb4fbba7f5db1807/GenericKeyedObjectPool.java/clean/src/java/org/apache/commons/pool/impl/GenericKeyedObjectPool.java |
|
if( tempDirFile.canWrite( ) ) { try | PrintWriter logfile; if( tempDirFile.canWrite( ) ) | private static PrintWriter createLogFile( ) { String tempDir = System.getProperty( "java.io.tmpdir" ); File tempDirFile = new File( tempDir ); try { tempDirFile.mkdirs( ); } catch( RuntimeException e1 ) { e1.printStackTrace( ); } String logfilename = LOGFILENAME; System.out.println( "creating Logfile: '" + logfilename + "' in: '" + tempDir + "'" ); File out = new File( tempDir, logfilename ); if( tempDirFile.canWrite( ) ) { try { fw = new BufferedWriter( new OutputStreamWriter( new FileOutputStream( out ), "UTF-8" ) ); logfile = setLogFile( new PrintWriter( fw ) ); } catch( Exception e ) { logfile = null; e.printStackTrace( ); } } else { logfile = null; System.err.println( "Fatal: cannot write File: '" + logfilename + "' into: " + tempDirFile ); } return logfile; } | 54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/9619b3a25f43787dc92011111668210e06c00c71/Debug.java/clean/src/lib/com/izforge/izpack/util/Debug.java |
fw = new BufferedWriter( new OutputStreamWriter( new FileOutputStream( out ), "UTF-8" ) ); logfile = setLogFile( new PrintWriter( fw ) ); | try { BufferedWriter fw = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(out), "UTF-8")); logfile = setLogFile( new PrintWriter( fw ) ); } catch( Exception e ) { logfile = null; e.printStackTrace( ); } | private static PrintWriter createLogFile( ) { String tempDir = System.getProperty( "java.io.tmpdir" ); File tempDirFile = new File( tempDir ); try { tempDirFile.mkdirs( ); } catch( RuntimeException e1 ) { e1.printStackTrace( ); } String logfilename = LOGFILENAME; System.out.println( "creating Logfile: '" + logfilename + "' in: '" + tempDir + "'" ); File out = new File( tempDir, logfilename ); if( tempDirFile.canWrite( ) ) { try { fw = new BufferedWriter( new OutputStreamWriter( new FileOutputStream( out ), "UTF-8" ) ); logfile = setLogFile( new PrintWriter( fw ) ); } catch( Exception e ) { logfile = null; e.printStackTrace( ); } } else { logfile = null; System.err.println( "Fatal: cannot write File: '" + logfilename + "' into: " + tempDirFile ); } return logfile; } | 54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/9619b3a25f43787dc92011111668210e06c00c71/Debug.java/clean/src/lib/com/izforge/izpack/util/Debug.java |
catch( Exception e ) | else | private static PrintWriter createLogFile( ) { String tempDir = System.getProperty( "java.io.tmpdir" ); File tempDirFile = new File( tempDir ); try { tempDirFile.mkdirs( ); } catch( RuntimeException e1 ) { e1.printStackTrace( ); } String logfilename = LOGFILENAME; System.out.println( "creating Logfile: '" + logfilename + "' in: '" + tempDir + "'" ); File out = new File( tempDir, logfilename ); if( tempDirFile.canWrite( ) ) { try { fw = new BufferedWriter( new OutputStreamWriter( new FileOutputStream( out ), "UTF-8" ) ); logfile = setLogFile( new PrintWriter( fw ) ); } catch( Exception e ) { logfile = null; e.printStackTrace( ); } } else { logfile = null; System.err.println( "Fatal: cannot write File: '" + logfilename + "' into: " + tempDirFile ); } return logfile; } | 54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/9619b3a25f43787dc92011111668210e06c00c71/Debug.java/clean/src/lib/com/izforge/izpack/util/Debug.java |
e.printStackTrace( ); | System.err.println( "Fatal: cannot write File: '" + logfilename + "' into: " + tempDirFile ); | private static PrintWriter createLogFile( ) { String tempDir = System.getProperty( "java.io.tmpdir" ); File tempDirFile = new File( tempDir ); try { tempDirFile.mkdirs( ); } catch( RuntimeException e1 ) { e1.printStackTrace( ); } String logfilename = LOGFILENAME; System.out.println( "creating Logfile: '" + logfilename + "' in: '" + tempDir + "'" ); File out = new File( tempDir, logfilename ); if( tempDirFile.canWrite( ) ) { try { fw = new BufferedWriter( new OutputStreamWriter( new FileOutputStream( out ), "UTF-8" ) ); logfile = setLogFile( new PrintWriter( fw ) ); } catch( Exception e ) { logfile = null; e.printStackTrace( ); } } else { logfile = null; System.err.println( "Fatal: cannot write File: '" + logfilename + "' into: " + tempDirFile ); } return logfile; } | 54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/9619b3a25f43787dc92011111668210e06c00c71/Debug.java/clean/src/lib/com/izforge/izpack/util/Debug.java |
} else { logfile = null; System.err.println( "Fatal: cannot write File: '" + logfilename + "' into: " + tempDirFile ); } | private static PrintWriter createLogFile( ) { String tempDir = System.getProperty( "java.io.tmpdir" ); File tempDirFile = new File( tempDir ); try { tempDirFile.mkdirs( ); } catch( RuntimeException e1 ) { e1.printStackTrace( ); } String logfilename = LOGFILENAME; System.out.println( "creating Logfile: '" + logfilename + "' in: '" + tempDir + "'" ); File out = new File( tempDir, logfilename ); if( tempDirFile.canWrite( ) ) { try { fw = new BufferedWriter( new OutputStreamWriter( new FileOutputStream( out ), "UTF-8" ) ); logfile = setLogFile( new PrintWriter( fw ) ); } catch( Exception e ) { logfile = null; e.printStackTrace( ); } } else { logfile = null; System.err.println( "Fatal: cannot write File: '" + logfilename + "' into: " + tempDirFile ); } return logfile; } | 54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/9619b3a25f43787dc92011111668210e06c00c71/Debug.java/clean/src/lib/com/izforge/izpack/util/Debug.java |
|
logfile = (PrintWriter) System.getProperties( ).get( IZPACK_LOGFILE ); | PrintWriter logfile = (PrintWriter) System.getProperties().get(IZPACK_LOGFILE); | public static PrintWriter getLogFile( ) { logfile = (PrintWriter) System.getProperties( ).get( IZPACK_LOGFILE ); return logfile; } | 54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/9619b3a25f43787dc92011111668210e06c00c71/Debug.java/clean/src/lib/com/izforge/izpack/util/Debug.java |
logfile = (PrintWriter) System.getProperties( ).get( IZPACK_LOGFILE ); | PrintWriter logfile = (PrintWriter) System.getProperties().get(IZPACK_LOGFILE); | public static synchronized PrintWriter setLogFile( PrintWriter aLogFile ) { System.getProperties( ).put( IZPACK_LOGFILE, aLogFile ); logfile = (PrintWriter) System.getProperties( ).get( IZPACK_LOGFILE ); if( logfile == null ) { System.err.println( "Set::logfile == null" ); } return logfile; } | 54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/9619b3a25f43787dc92011111668210e06c00c71/Debug.java/clean/src/lib/com/izforge/izpack/util/Debug.java |
InputStream in = getClass().getResourceAsStream("/jarlocation.log"); | InputStream in = Destroyer.class.getResourceAsStream("/jarlocation.log"); | private void askUninstallerRemoval() throws Exception { // Initialisations InputStream in = getClass().getResourceAsStream("/jarlocation.log"); InputStreamReader inReader = new InputStreamReader(in); BufferedReader reader = new BufferedReader(inReader); // We delete File jar = new File(reader.readLine()); File path = new File(reader.readLine()); File inst = new File(installPath); jar.deleteOnExit(); path.deleteOnExit(); inst.deleteOnExit(); } | 54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/08ecc635ba8049aeb419722893f373a4a7f99a77/Destroyer.java/buggy/src/lib/com/izforge/izpack/uninstaller/Destroyer.java |
new ObjectInputStream(getClass().getResourceAsStream("/executables")); | new ObjectInputStream(Destroyer.class.getResourceAsStream("/executables")); | private ArrayList getExecutablesList() throws Exception { ArrayList executables = new ArrayList(); ObjectInputStream in = new ObjectInputStream(getClass().getResourceAsStream("/executables")); int num = in.readInt(); for (int i = 0; i < num; i++) { ExecutableFile file = (ExecutableFile) in.readObject(); executables.add(file); } return executables; } | 54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/08ecc635ba8049aeb419722893f373a4a7f99a77/Destroyer.java/buggy/src/lib/com/izforge/izpack/uninstaller/Destroyer.java |
InputStream in = getClass().getResourceAsStream("/install.log"); | InputStream in = Destroyer.class.getResourceAsStream("/install.log"); | private ArrayList getFilesList() throws Exception { // Initialisations TreeSet files = new TreeSet(Collections.reverseOrder()); InputStream in = getClass().getResourceAsStream("/install.log"); InputStreamReader inReader = new InputStreamReader(in); BufferedReader reader = new BufferedReader(inReader); // We skip the first line (the installation path) reader.readLine(); // We read it String read = reader.readLine(); while (read != null) { files.add(new File(read)); read = reader.readLine(); } // We return it return new ArrayList(files); } | 54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/08ecc635ba8049aeb419722893f373a4a7f99a77/Destroyer.java/buggy/src/lib/com/izforge/izpack/uninstaller/Destroyer.java |
in = getClass().getResourceAsStream("/uninstallerListeners"); | in = Destroyer.class.getResourceAsStream("/uninstallerListeners"); | private List [] getListenerLists() throws Exception { ArrayList [] uninstaller = new ArrayList[] {new ArrayList(),new ArrayList()}; // Load listeners if exist InputStream in; ObjectInputStream objIn; in = getClass().getResourceAsStream("/uninstallerListeners"); if( in != null ) { objIn = new ObjectInputStream(in); List listeners = (List)objIn.readObject(); objIn.close(); Iterator iter = listeners.iterator(); while( iter != null && iter.hasNext()) { Class clazz = Class.forName(((String) iter.next())); UninstallerListener ul = (UninstallerListener) clazz.newInstance(); if( ul.isFileListener()) uninstaller[1].add( ul ); uninstaller[0].add( ul ); } } return uninstaller; } | 54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/08ecc635ba8049aeb419722893f373a4a7f99a77/Destroyer.java/buggy/src/lib/com/izforge/izpack/uninstaller/Destroyer.java |
this.tipLabel = new JLabel(parent.langpack.getString("InstallPanel.tip"), parent.icons.getImageIcon("information"), JLabel.TRAILING); | this.tipLabel = new JLabel( parent.langpack.getString("InstallPanel.tip"), parent.icons.getImageIcon("information"), JLabel.TRAILING); | public InstallPanel(InstallerFrame parent, InstallData idata) { super(parent, idata); // We initialize our layout layout = new GridBagLayout(); gbConstraints = new GridBagConstraints(); setLayout(layout); int row = 1; this.tipLabel = new JLabel(parent.langpack.getString("InstallPanel.tip"), parent.icons.getImageIcon("information"), JLabel.TRAILING); parent.buildConstraints(gbConstraints, 0, row++, 2, 1, 1.0, 0.0); gbConstraints.fill = GridBagConstraints.NONE; gbConstraints.anchor = GridBagConstraints.NORTHWEST; layout.addLayoutComponent(this.tipLabel, gbConstraints); add(this.tipLabel); this.packOpLabel = new JLabel(" ", JLabel.TRAILING); parent.buildConstraints(gbConstraints, 0, row++, 2, 1, 1.0, 0.0); gbConstraints.anchor = GridBagConstraints.SOUTHWEST; layout.addLayoutComponent(this.packOpLabel, gbConstraints); add(this.packOpLabel); this.packProgressBar = new JProgressBar(); this.packProgressBar.setStringPainted(true); this.packProgressBar.setString(parent.langpack.getString("InstallPanel.begin")); this.packProgressBar.setValue(0); parent.buildConstraints(gbConstraints, 0, row++, 2, 1, 1.0, 0.0); gbConstraints.anchor = GridBagConstraints.NORTH; gbConstraints.fill = GridBagConstraints.HORIZONTAL; layout.addLayoutComponent(this.packProgressBar, gbConstraints); add(this.packProgressBar); // make sure there is some space between the progress bars JSeparator sep = new JSeparator (); Dimension dim = new Dimension (0, 10); sep.setPreferredSize (dim); sep.setMinimumSize (dim); sep.setMaximumSize (dim); parent.buildConstraints(gbConstraints, 0, row++, 2, 1, 1.0, 0.0); layout.addLayoutComponent(sep, gbConstraints); add(sep); this.overallOpLabel = new JLabel(parent.langpack.getString ("InstallPanel.progress"), parent.icons.getImageIcon ("information"), JLabel.TRAILING); parent.buildConstraints(gbConstraints, 0, row++, 2, 1, 1.0, 0.0); gbConstraints.anchor = GridBagConstraints.NORTHWEST; gbConstraints.fill = GridBagConstraints.NONE; layout.addLayoutComponent(this.overallOpLabel, gbConstraints); add(this.overallOpLabel); this.overallProgressBar = new JProgressBar(); this.overallProgressBar.setStringPainted(true); this.overallProgressBar.setString(""); this.overallProgressBar.setValue(0); parent.buildConstraints(gbConstraints, 0, row++, 2, 1, 1.0, 0.0); gbConstraints.anchor = GridBagConstraints.NORTH; gbConstraints.fill = GridBagConstraints.HORIZONTAL; layout.addLayoutComponent(this.overallProgressBar, gbConstraints); add(this.overallProgressBar); } | 54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6e8ab3930a21f787bcd0f3cf0b9937f9d50c80c0/InstallPanel.java/clean/src/lib/com/izforge/izpack/panels/InstallPanel.java |
this.packProgressBar.setString(parent.langpack.getString("InstallPanel.begin")); | this.packProgressBar.setString( parent.langpack.getString("InstallPanel.begin")); | public InstallPanel(InstallerFrame parent, InstallData idata) { super(parent, idata); // We initialize our layout layout = new GridBagLayout(); gbConstraints = new GridBagConstraints(); setLayout(layout); int row = 1; this.tipLabel = new JLabel(parent.langpack.getString("InstallPanel.tip"), parent.icons.getImageIcon("information"), JLabel.TRAILING); parent.buildConstraints(gbConstraints, 0, row++, 2, 1, 1.0, 0.0); gbConstraints.fill = GridBagConstraints.NONE; gbConstraints.anchor = GridBagConstraints.NORTHWEST; layout.addLayoutComponent(this.tipLabel, gbConstraints); add(this.tipLabel); this.packOpLabel = new JLabel(" ", JLabel.TRAILING); parent.buildConstraints(gbConstraints, 0, row++, 2, 1, 1.0, 0.0); gbConstraints.anchor = GridBagConstraints.SOUTHWEST; layout.addLayoutComponent(this.packOpLabel, gbConstraints); add(this.packOpLabel); this.packProgressBar = new JProgressBar(); this.packProgressBar.setStringPainted(true); this.packProgressBar.setString(parent.langpack.getString("InstallPanel.begin")); this.packProgressBar.setValue(0); parent.buildConstraints(gbConstraints, 0, row++, 2, 1, 1.0, 0.0); gbConstraints.anchor = GridBagConstraints.NORTH; gbConstraints.fill = GridBagConstraints.HORIZONTAL; layout.addLayoutComponent(this.packProgressBar, gbConstraints); add(this.packProgressBar); // make sure there is some space between the progress bars JSeparator sep = new JSeparator (); Dimension dim = new Dimension (0, 10); sep.setPreferredSize (dim); sep.setMinimumSize (dim); sep.setMaximumSize (dim); parent.buildConstraints(gbConstraints, 0, row++, 2, 1, 1.0, 0.0); layout.addLayoutComponent(sep, gbConstraints); add(sep); this.overallOpLabel = new JLabel(parent.langpack.getString ("InstallPanel.progress"), parent.icons.getImageIcon ("information"), JLabel.TRAILING); parent.buildConstraints(gbConstraints, 0, row++, 2, 1, 1.0, 0.0); gbConstraints.anchor = GridBagConstraints.NORTHWEST; gbConstraints.fill = GridBagConstraints.NONE; layout.addLayoutComponent(this.overallOpLabel, gbConstraints); add(this.overallOpLabel); this.overallProgressBar = new JProgressBar(); this.overallProgressBar.setStringPainted(true); this.overallProgressBar.setString(""); this.overallProgressBar.setValue(0); parent.buildConstraints(gbConstraints, 0, row++, 2, 1, 1.0, 0.0); gbConstraints.anchor = GridBagConstraints.NORTH; gbConstraints.fill = GridBagConstraints.HORIZONTAL; layout.addLayoutComponent(this.overallProgressBar, gbConstraints); add(this.overallProgressBar); } | 54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6e8ab3930a21f787bcd0f3cf0b9937f9d50c80c0/InstallPanel.java/clean/src/lib/com/izforge/izpack/panels/InstallPanel.java |
JSeparator sep = new JSeparator (); Dimension dim = new Dimension (0, 10); sep.setPreferredSize (dim); sep.setMinimumSize (dim); sep.setMaximumSize (dim); | JSeparator sep = new JSeparator(); Dimension dim = new Dimension(0, 10); sep.setPreferredSize(dim); sep.setMinimumSize(dim); sep.setMaximumSize(dim); | public InstallPanel(InstallerFrame parent, InstallData idata) { super(parent, idata); // We initialize our layout layout = new GridBagLayout(); gbConstraints = new GridBagConstraints(); setLayout(layout); int row = 1; this.tipLabel = new JLabel(parent.langpack.getString("InstallPanel.tip"), parent.icons.getImageIcon("information"), JLabel.TRAILING); parent.buildConstraints(gbConstraints, 0, row++, 2, 1, 1.0, 0.0); gbConstraints.fill = GridBagConstraints.NONE; gbConstraints.anchor = GridBagConstraints.NORTHWEST; layout.addLayoutComponent(this.tipLabel, gbConstraints); add(this.tipLabel); this.packOpLabel = new JLabel(" ", JLabel.TRAILING); parent.buildConstraints(gbConstraints, 0, row++, 2, 1, 1.0, 0.0); gbConstraints.anchor = GridBagConstraints.SOUTHWEST; layout.addLayoutComponent(this.packOpLabel, gbConstraints); add(this.packOpLabel); this.packProgressBar = new JProgressBar(); this.packProgressBar.setStringPainted(true); this.packProgressBar.setString(parent.langpack.getString("InstallPanel.begin")); this.packProgressBar.setValue(0); parent.buildConstraints(gbConstraints, 0, row++, 2, 1, 1.0, 0.0); gbConstraints.anchor = GridBagConstraints.NORTH; gbConstraints.fill = GridBagConstraints.HORIZONTAL; layout.addLayoutComponent(this.packProgressBar, gbConstraints); add(this.packProgressBar); // make sure there is some space between the progress bars JSeparator sep = new JSeparator (); Dimension dim = new Dimension (0, 10); sep.setPreferredSize (dim); sep.setMinimumSize (dim); sep.setMaximumSize (dim); parent.buildConstraints(gbConstraints, 0, row++, 2, 1, 1.0, 0.0); layout.addLayoutComponent(sep, gbConstraints); add(sep); this.overallOpLabel = new JLabel(parent.langpack.getString ("InstallPanel.progress"), parent.icons.getImageIcon ("information"), JLabel.TRAILING); parent.buildConstraints(gbConstraints, 0, row++, 2, 1, 1.0, 0.0); gbConstraints.anchor = GridBagConstraints.NORTHWEST; gbConstraints.fill = GridBagConstraints.NONE; layout.addLayoutComponent(this.overallOpLabel, gbConstraints); add(this.overallOpLabel); this.overallProgressBar = new JProgressBar(); this.overallProgressBar.setStringPainted(true); this.overallProgressBar.setString(""); this.overallProgressBar.setValue(0); parent.buildConstraints(gbConstraints, 0, row++, 2, 1, 1.0, 0.0); gbConstraints.anchor = GridBagConstraints.NORTH; gbConstraints.fill = GridBagConstraints.HORIZONTAL; layout.addLayoutComponent(this.overallProgressBar, gbConstraints); add(this.overallProgressBar); } | 54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6e8ab3930a21f787bcd0f3cf0b9937f9d50c80c0/InstallPanel.java/clean/src/lib/com/izforge/izpack/panels/InstallPanel.java |
this.overallOpLabel = new JLabel(parent.langpack.getString ("InstallPanel.progress"), parent.icons.getImageIcon ("information"), JLabel.TRAILING); | this.overallOpLabel = new JLabel( parent.langpack.getString("InstallPanel.progress"), parent.icons.getImageIcon("information"), JLabel.TRAILING); | public InstallPanel(InstallerFrame parent, InstallData idata) { super(parent, idata); // We initialize our layout layout = new GridBagLayout(); gbConstraints = new GridBagConstraints(); setLayout(layout); int row = 1; this.tipLabel = new JLabel(parent.langpack.getString("InstallPanel.tip"), parent.icons.getImageIcon("information"), JLabel.TRAILING); parent.buildConstraints(gbConstraints, 0, row++, 2, 1, 1.0, 0.0); gbConstraints.fill = GridBagConstraints.NONE; gbConstraints.anchor = GridBagConstraints.NORTHWEST; layout.addLayoutComponent(this.tipLabel, gbConstraints); add(this.tipLabel); this.packOpLabel = new JLabel(" ", JLabel.TRAILING); parent.buildConstraints(gbConstraints, 0, row++, 2, 1, 1.0, 0.0); gbConstraints.anchor = GridBagConstraints.SOUTHWEST; layout.addLayoutComponent(this.packOpLabel, gbConstraints); add(this.packOpLabel); this.packProgressBar = new JProgressBar(); this.packProgressBar.setStringPainted(true); this.packProgressBar.setString(parent.langpack.getString("InstallPanel.begin")); this.packProgressBar.setValue(0); parent.buildConstraints(gbConstraints, 0, row++, 2, 1, 1.0, 0.0); gbConstraints.anchor = GridBagConstraints.NORTH; gbConstraints.fill = GridBagConstraints.HORIZONTAL; layout.addLayoutComponent(this.packProgressBar, gbConstraints); add(this.packProgressBar); // make sure there is some space between the progress bars JSeparator sep = new JSeparator (); Dimension dim = new Dimension (0, 10); sep.setPreferredSize (dim); sep.setMinimumSize (dim); sep.setMaximumSize (dim); parent.buildConstraints(gbConstraints, 0, row++, 2, 1, 1.0, 0.0); layout.addLayoutComponent(sep, gbConstraints); add(sep); this.overallOpLabel = new JLabel(parent.langpack.getString ("InstallPanel.progress"), parent.icons.getImageIcon ("information"), JLabel.TRAILING); parent.buildConstraints(gbConstraints, 0, row++, 2, 1, 1.0, 0.0); gbConstraints.anchor = GridBagConstraints.NORTHWEST; gbConstraints.fill = GridBagConstraints.NONE; layout.addLayoutComponent(this.overallOpLabel, gbConstraints); add(this.overallOpLabel); this.overallProgressBar = new JProgressBar(); this.overallProgressBar.setStringPainted(true); this.overallProgressBar.setString(""); this.overallProgressBar.setValue(0); parent.buildConstraints(gbConstraints, 0, row++, 2, 1, 1.0, 0.0); gbConstraints.anchor = GridBagConstraints.NORTH; gbConstraints.fill = GridBagConstraints.HORIZONTAL; layout.addLayoutComponent(this.overallProgressBar, gbConstraints); add(this.overallProgressBar); } | 54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6e8ab3930a21f787bcd0f3cf0b9937f9d50c80c0/InstallPanel.java/clean/src/lib/com/izforge/izpack/panels/InstallPanel.java |
JOptionPane.showMessageDialog(this, error.toString(), | JOptionPane.showMessageDialog( this, error.toString(), | public void errorUnpack(String error) { this.packOpLabel.setText(error); idata.installSuccess = false; JOptionPane.showMessageDialog(this, error.toString(), parent.langpack.getString("installer.error"), JOptionPane.ERROR_MESSAGE); } | 54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6e8ab3930a21f787bcd0f3cf0b9937f9d50c80c0/InstallPanel.java/clean/src/lib/com/izforge/izpack/panels/InstallPanel.java |
this.overallProgressBar.setString(Integer.toString (stepno) + " / " + Integer.toString (this.noOfPacks)); | this.overallProgressBar.setString( Integer.toString(stepno) + " / " + Integer.toString(this.noOfPacks)); | public void nextStep(String packName, int stepno, int max) { this.packProgressBar.setValue(0); this.packProgressBar.setMinimum(0); this.packProgressBar.setMaximum(max); this.packProgressBar.setString(packName); this.overallProgressBar.setValue(stepno - 1); this.overallProgressBar.setString(Integer.toString (stepno) + " / " + Integer.toString (this.noOfPacks)); } | 54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6e8ab3930a21f787bcd0f3cf0b9937f9d50c80c0/InstallPanel.java/clean/src/lib/com/izforge/izpack/panels/InstallPanel.java |
public void startAction (String name, int noOfJobs) | public void startAction(String name, int noOfJobs) | public void startAction (String name, int noOfJobs) { parent.blockGUI(); // figure out how many packs there are to install this.noOfPacks = noOfJobs; this.overallProgressBar.setMinimum (0); this.overallProgressBar.setMaximum (this.noOfPacks); this.overallProgressBar.setString ("0 / " + Integer.toString (this.noOfPacks)); } | 54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6e8ab3930a21f787bcd0f3cf0b9937f9d50c80c0/InstallPanel.java/clean/src/lib/com/izforge/izpack/panels/InstallPanel.java |
this.overallProgressBar.setMinimum (0); this.overallProgressBar.setMaximum (this.noOfPacks); this.overallProgressBar.setString ("0 / " + Integer.toString (this.noOfPacks)); | this.overallProgressBar.setMinimum(0); this.overallProgressBar.setMaximum(this.noOfPacks); this.overallProgressBar.setString( "0 / " + Integer.toString(this.noOfPacks)); | public void startAction (String name, int noOfJobs) { parent.blockGUI(); // figure out how many packs there are to install this.noOfPacks = noOfJobs; this.overallProgressBar.setMinimum (0); this.overallProgressBar.setMaximum (this.noOfPacks); this.overallProgressBar.setString ("0 / " + Integer.toString (this.noOfPacks)); } | 54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6e8ab3930a21f787bcd0f3cf0b9937f9d50c80c0/InstallPanel.java/clean/src/lib/com/izforge/izpack/panels/InstallPanel.java |
this.packProgressBar.setString(parent.langpack.getString("InstallPanel.finished")); | this.packProgressBar.setString( parent.langpack.getString("InstallPanel.finished")); | public void stopAction() { parent.releaseGUI(); parent.lockPrevButton(); this.overallProgressBar.setValue(this.overallProgressBar.getValue() + 1); this.packProgressBar.setString(parent.langpack.getString("InstallPanel.finished")); this.packProgressBar.setEnabled(false); String no_of_packs = Integer.toString (this.noOfPacks); this.overallProgressBar.setString (no_of_packs + " / " + no_of_packs); this.overallProgressBar.setEnabled (false); this.packOpLabel.setText(" "); this.packOpLabel.setEnabled(false); idata.installSuccess = true; idata.canClose = true; this.validated = true; if (idata.panels.indexOf(this) != (idata.panels.size() - 1)) parent.unlockNextButton(); } | 54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6e8ab3930a21f787bcd0f3cf0b9937f9d50c80c0/InstallPanel.java/clean/src/lib/com/izforge/izpack/panels/InstallPanel.java |
String no_of_packs = Integer.toString (this.noOfPacks); this.overallProgressBar.setString (no_of_packs + " / " + no_of_packs); this.overallProgressBar.setEnabled (false); | String no_of_packs = Integer.toString(this.noOfPacks); this.overallProgressBar.setString(no_of_packs + " / " + no_of_packs); this.overallProgressBar.setEnabled(false); | public void stopAction() { parent.releaseGUI(); parent.lockPrevButton(); this.overallProgressBar.setValue(this.overallProgressBar.getValue() + 1); this.packProgressBar.setString(parent.langpack.getString("InstallPanel.finished")); this.packProgressBar.setEnabled(false); String no_of_packs = Integer.toString (this.noOfPacks); this.overallProgressBar.setString (no_of_packs + " / " + no_of_packs); this.overallProgressBar.setEnabled (false); this.packOpLabel.setText(" "); this.packOpLabel.setEnabled(false); idata.installSuccess = true; idata.canClose = true; this.validated = true; if (idata.panels.indexOf(this) != (idata.panels.size() - 1)) parent.unlockNextButton(); } | 54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/6e8ab3930a21f787bcd0f3cf0b9937f9d50c80c0/InstallPanel.java/clean/src/lib/com/izforge/izpack/panels/InstallPanel.java |
try { keepDirFile = File.createTempFile("izpack-keepme", ".tmp"); keepDirFile.deleteOnExit(); } catch (Exception err) { err.printStackTrace(); } | public Compiler(String filename, String basedir, String kind, String output) { // Default initialisation this.filename = filename; this.basedir = basedir; this.kind = kind; this.output = output; } | 54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/91994653572a3171781f1edfa5a2651f3a9a49fb/Compiler.java/buggy/src/lib/com/izforge/izpack/compiler/Compiler.java |
|
if (files == null) return; | if (files.length == 0) { files = new File[1]; files[0] = keepDirFile; } | protected void addFile(File file, String relPath, String targetOs, boolean override, ArrayList list) throws Exception { // We check if 'file' is correct if (!file.exists()) throw new Exception(file.toString() + " does not exist"); // Recursive part if (file.isDirectory()) { File[] files = file.listFiles(); if (files == null) return; int size = files.length; String np = relPath + "/" + file.getName(); for (int i = 0; i < size; i++) addFile(files[i], np, targetOs, override, list); } else { PackSource nf = new PackSource(); nf.src = file.getAbsolutePath(); nf.targetdir = relPath; nf.os = targetOs; nf.override = override; list.add(nf); } } | 54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/91994653572a3171781f1edfa5a2651f3a9a49fb/Compiler.java/buggy/src/lib/com/izforge/izpack/compiler/Compiler.java |
String[] files = ds.getIncludedFiles(); | String[] files = ds.getIncludedFiles(); String[] dirs = ds.getIncludedDirectories(); /* Old buggy code | protected void addFileSet(String path, String[] includes, String[] excludes, String relPath, String targetOs, ArrayList list, String casesensitive) throws Exception { boolean bCasesensitive = false; File test = new File(path); if (test.isDirectory()) { if (casesensitive != null) bCasesensitive = casesensitive.equalsIgnoreCase("Yes"); DirectoryScanner ds = new DirectoryScanner(); ds.setIncludes(includes); ds.setExcludes(excludes); ds.setBasedir(new File(path)); ds.setCaseSensitive(bCasesensitive); ds.scan(); String[] files = ds.getIncludedFiles(); String newRelativePath = null; String absolutBasePath = test.getParent(); String absolutPath = test.getAbsolutePath(); String absolutFilePath = null; int copyPathFrom = absolutBasePath.length() + 1; for (int i = 0; i < files.length; i++) { File file = new File(absolutPath + File.separator + (String) files[i]); absolutFilePath = file.getParent(); newRelativePath = relPath + File.separator + absolutFilePath.substring(copyPathFrom); //FIX ME: the override for fileset is by default true, needs to be changed addFile(file, newRelativePath, targetOs, true, list); } } else throw new Exception("\"dir\" attribute of fileset is not valide :" + path); } | 54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/91994653572a3171781f1edfa5a2651f3a9a49fb/Compiler.java/buggy/src/lib/com/izforge/izpack/compiler/Compiler.java |
String absolutBasePath = test.getParent(); | String absolutBasePath = test.getParentFile().getAbsolutePath(); | protected void addFileSet(String path, String[] includes, String[] excludes, String relPath, String targetOs, ArrayList list, String casesensitive) throws Exception { boolean bCasesensitive = false; File test = new File(path); if (test.isDirectory()) { if (casesensitive != null) bCasesensitive = casesensitive.equalsIgnoreCase("Yes"); DirectoryScanner ds = new DirectoryScanner(); ds.setIncludes(includes); ds.setExcludes(excludes); ds.setBasedir(new File(path)); ds.setCaseSensitive(bCasesensitive); ds.scan(); String[] files = ds.getIncludedFiles(); String newRelativePath = null; String absolutBasePath = test.getParent(); String absolutPath = test.getAbsolutePath(); String absolutFilePath = null; int copyPathFrom = absolutBasePath.length() + 1; for (int i = 0; i < files.length; i++) { File file = new File(absolutPath + File.separator + (String) files[i]); absolutFilePath = file.getParent(); newRelativePath = relPath + File.separator + absolutFilePath.substring(copyPathFrom); //FIX ME: the override for fileset is by default true, needs to be changed addFile(file, newRelativePath, targetOs, true, list); } } else throw new Exception("\"dir\" attribute of fileset is not valide :" + path); } | 54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/91994653572a3171781f1edfa5a2651f3a9a49fb/Compiler.java/buggy/src/lib/com/izforge/izpack/compiler/Compiler.java |
absolutFilePath = file.getParent(); | absolutFilePath = file.getParentFile().getAbsolutePath(); | protected void addFileSet(String path, String[] includes, String[] excludes, String relPath, String targetOs, ArrayList list, String casesensitive) throws Exception { boolean bCasesensitive = false; File test = new File(path); if (test.isDirectory()) { if (casesensitive != null) bCasesensitive = casesensitive.equalsIgnoreCase("Yes"); DirectoryScanner ds = new DirectoryScanner(); ds.setIncludes(includes); ds.setExcludes(excludes); ds.setBasedir(new File(path)); ds.setCaseSensitive(bCasesensitive); ds.scan(); String[] files = ds.getIncludedFiles(); String newRelativePath = null; String absolutBasePath = test.getParent(); String absolutPath = test.getAbsolutePath(); String absolutFilePath = null; int copyPathFrom = absolutBasePath.length() + 1; for (int i = 0; i < files.length; i++) { File file = new File(absolutPath + File.separator + (String) files[i]); absolutFilePath = file.getParent(); newRelativePath = relPath + File.separator + absolutFilePath.substring(copyPathFrom); //FIX ME: the override for fileset is by default true, needs to be changed addFile(file, newRelativePath, targetOs, true, list); } } else throw new Exception("\"dir\" attribute of fileset is not valide :" + path); } | 54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/91994653572a3171781f1edfa5a2651f3a9a49fb/Compiler.java/buggy/src/lib/com/izforge/izpack/compiler/Compiler.java |
throw new Exception("\"dir\" attribute of fileset is not valide :" + path); | throw new Exception("\"dir\" attribute of fileset is not valid: " + path); | protected void addFileSet(String path, String[] includes, String[] excludes, String relPath, String targetOs, ArrayList list, String casesensitive) throws Exception { boolean bCasesensitive = false; File test = new File(path); if (test.isDirectory()) { if (casesensitive != null) bCasesensitive = casesensitive.equalsIgnoreCase("Yes"); DirectoryScanner ds = new DirectoryScanner(); ds.setIncludes(includes); ds.setExcludes(excludes); ds.setBasedir(new File(path)); ds.setCaseSensitive(bCasesensitive); ds.scan(); String[] files = ds.getIncludedFiles(); String newRelativePath = null; String absolutBasePath = test.getParent(); String absolutPath = test.getAbsolutePath(); String absolutFilePath = null; int copyPathFrom = absolutBasePath.length() + 1; for (int i = 0; i < files.length; i++) { File file = new File(absolutPath + File.separator + (String) files[i]); absolutFilePath = file.getParent(); newRelativePath = relPath + File.separator + absolutFilePath.substring(copyPathFrom); //FIX ME: the override for fileset is by default true, needs to be changed addFile(file, newRelativePath, targetOs, true, list); } } else throw new Exception("\"dir\" attribute of fileset is not valide :" + path); } | 54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/91994653572a3171781f1edfa5a2651f3a9a49fb/Compiler.java/buggy/src/lib/com/izforge/izpack/compiler/Compiler.java |
else { } | protected ArrayList getPacks(XMLElement data) throws Exception { // Initialisation ArrayList packs = new ArrayList(); Vector v; XMLElement root = data.getFirstChildNamed("packs"); // We process each pack markup int npacks = root.getChildrenCount(); for (int i = 0; i < npacks; i++) { XMLElement el = root.getChildAtIndex(i); // Trivial initialisations Pack pack = new Pack(); pack.number = i; pack.name = el.getAttribute("name"); pack.required = el.getAttribute("required").equalsIgnoreCase("yes"); pack.description = el.getFirstChildNamed("description").getContent(); // We get the parsables list Iterator iter = null; Vector children = el.getChildrenNamed("parsable"); if (null != children && !children.isEmpty()) { iter = children.iterator(); while (iter.hasNext()) { XMLElement p = (XMLElement) iter.next(); pack.parsables.add (new ParsableFile(p.getAttribute("targetfile"), p.getAttribute("type", "plain"), p.getAttribute("encoding", null))); } } // We get the executables list children = el.getChildrenNamed("executable"); if (null != children && !children.isEmpty()) { iter = children.iterator(); while (iter.hasNext()) { XMLElement e = (XMLElement) iter.next(); // when to execute this executable int executeOn = ExecutableFile.NEVER; String val = e.getAttribute("stage", "never"); if ("postinstall".compareToIgnoreCase(val) == 0) executeOn = ExecutableFile.POSTINSTALL; else { } // main class of this executable String executeClass = e.getAttribute("class"); // type of this executable int executeType = ExecutableFile.BIN; val = e.getAttribute("type", "bin"); if ("jar".compareToIgnoreCase(val) == 0) executeType = ExecutableFile.JAR; else { } // what to do if execution fails int onFailure = ExecutableFile.ASK; val = e.getAttribute("failure", "ask"); if ("abort".compareToIgnoreCase(val) == 0) onFailure = ExecutableFile.ABORT; else if ("warn".compareToIgnoreCase(val) == 0) onFailure = ExecutableFile.WARN; else { } // get arguments for this executable ArrayList argList = null; XMLElement args = e.getFirstChildNamed("args"); if (null != args) { argList = new ArrayList(); Iterator argIterator = args.getChildrenNamed("arg").iterator(); while (argIterator.hasNext()) { XMLElement arg = (XMLElement) argIterator.next(); argList.add(arg.getAttribute("value")); } } // get os info on this executable ArrayList osList = new ArrayList(); Iterator osIterator = e.getChildrenNamed("os").iterator(); while (osIterator.hasNext()) { XMLElement os = (XMLElement) osIterator.next(); osList.add (new com.izforge.izpack.util.Os(os.getAttribute("family", null), os.getAttribute("name", null), os.getAttribute("version", null), os.getAttribute("arch", null))); } pack.executables.add(new ExecutableFile(e.getAttribute("targetfile"), executeType, executeClass, executeOn, onFailure, argList, osList)); } } // We get the files list iter = el.getChildrenNamed("file").iterator(); while (iter.hasNext()) { XMLElement f = (XMLElement) iter.next(); String path = basedir + File.separator + f.getAttribute("src"); File file = new File(path); boolean override = true; if (f.getAttribute("override") != null) override = f.getAttribute("override").equalsIgnoreCase("true"); addFile(file, f.getAttribute("targetdir"), f.getAttribute("os"), override, pack.packFiles); } // We get the fileset list iter = el.getChildrenNamed("fileset").iterator(); while (iter.hasNext()) { XMLElement f = (XMLElement) iter.next(); String path = basedir + File.separator + f.getAttribute("dir"); String casesensitive = f.getAttribute("casesensitive"); /* * get includes and excludes */ Vector xcludesList = f.getChildrenNamed("include"); String[] includes = null; XMLElement xclude = null; if (xcludesList.size() > 0) { includes = new String[xcludesList.size()]; for (int j = 0; j < xcludesList.size(); j++) { xclude = (XMLElement) xcludesList.get(j); includes[j] = (String) xclude.getAttribute("name"); } } xcludesList = f.getChildrenNamed("exclude"); String[] excludes = null; xclude = null; if (xcludesList.size() > 0) { excludes = new String[xcludesList.size()]; for (int j = 0; j < xcludesList.size(); j++) { xclude = (XMLElement) xcludesList.get(j); excludes[j] = (String) xclude.getAttribute("name"); } } addFileSet(path, includes, excludes, f.getAttribute("targetdir"), f.getAttribute("os"), pack.packFiles, casesensitive); } // We add the pack packs.add(pack); } // We return the ArrayList return packs; } | 54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/91994653572a3171781f1edfa5a2651f3a9a49fb/Compiler.java/buggy/src/lib/com/izforge/izpack/compiler/Compiler.java |
|
else { } | protected ArrayList getPacks(XMLElement data) throws Exception { // Initialisation ArrayList packs = new ArrayList(); Vector v; XMLElement root = data.getFirstChildNamed("packs"); // We process each pack markup int npacks = root.getChildrenCount(); for (int i = 0; i < npacks; i++) { XMLElement el = root.getChildAtIndex(i); // Trivial initialisations Pack pack = new Pack(); pack.number = i; pack.name = el.getAttribute("name"); pack.required = el.getAttribute("required").equalsIgnoreCase("yes"); pack.description = el.getFirstChildNamed("description").getContent(); // We get the parsables list Iterator iter = null; Vector children = el.getChildrenNamed("parsable"); if (null != children && !children.isEmpty()) { iter = children.iterator(); while (iter.hasNext()) { XMLElement p = (XMLElement) iter.next(); pack.parsables.add (new ParsableFile(p.getAttribute("targetfile"), p.getAttribute("type", "plain"), p.getAttribute("encoding", null))); } } // We get the executables list children = el.getChildrenNamed("executable"); if (null != children && !children.isEmpty()) { iter = children.iterator(); while (iter.hasNext()) { XMLElement e = (XMLElement) iter.next(); // when to execute this executable int executeOn = ExecutableFile.NEVER; String val = e.getAttribute("stage", "never"); if ("postinstall".compareToIgnoreCase(val) == 0) executeOn = ExecutableFile.POSTINSTALL; else { } // main class of this executable String executeClass = e.getAttribute("class"); // type of this executable int executeType = ExecutableFile.BIN; val = e.getAttribute("type", "bin"); if ("jar".compareToIgnoreCase(val) == 0) executeType = ExecutableFile.JAR; else { } // what to do if execution fails int onFailure = ExecutableFile.ASK; val = e.getAttribute("failure", "ask"); if ("abort".compareToIgnoreCase(val) == 0) onFailure = ExecutableFile.ABORT; else if ("warn".compareToIgnoreCase(val) == 0) onFailure = ExecutableFile.WARN; else { } // get arguments for this executable ArrayList argList = null; XMLElement args = e.getFirstChildNamed("args"); if (null != args) { argList = new ArrayList(); Iterator argIterator = args.getChildrenNamed("arg").iterator(); while (argIterator.hasNext()) { XMLElement arg = (XMLElement) argIterator.next(); argList.add(arg.getAttribute("value")); } } // get os info on this executable ArrayList osList = new ArrayList(); Iterator osIterator = e.getChildrenNamed("os").iterator(); while (osIterator.hasNext()) { XMLElement os = (XMLElement) osIterator.next(); osList.add (new com.izforge.izpack.util.Os(os.getAttribute("family", null), os.getAttribute("name", null), os.getAttribute("version", null), os.getAttribute("arch", null))); } pack.executables.add(new ExecutableFile(e.getAttribute("targetfile"), executeType, executeClass, executeOn, onFailure, argList, osList)); } } // We get the files list iter = el.getChildrenNamed("file").iterator(); while (iter.hasNext()) { XMLElement f = (XMLElement) iter.next(); String path = basedir + File.separator + f.getAttribute("src"); File file = new File(path); boolean override = true; if (f.getAttribute("override") != null) override = f.getAttribute("override").equalsIgnoreCase("true"); addFile(file, f.getAttribute("targetdir"), f.getAttribute("os"), override, pack.packFiles); } // We get the fileset list iter = el.getChildrenNamed("fileset").iterator(); while (iter.hasNext()) { XMLElement f = (XMLElement) iter.next(); String path = basedir + File.separator + f.getAttribute("dir"); String casesensitive = f.getAttribute("casesensitive"); /* * get includes and excludes */ Vector xcludesList = f.getChildrenNamed("include"); String[] includes = null; XMLElement xclude = null; if (xcludesList.size() > 0) { includes = new String[xcludesList.size()]; for (int j = 0; j < xcludesList.size(); j++) { xclude = (XMLElement) xcludesList.get(j); includes[j] = (String) xclude.getAttribute("name"); } } xcludesList = f.getChildrenNamed("exclude"); String[] excludes = null; xclude = null; if (xcludesList.size() > 0) { excludes = new String[xcludesList.size()]; for (int j = 0; j < xcludesList.size(); j++) { xclude = (XMLElement) xcludesList.get(j); excludes[j] = (String) xclude.getAttribute("name"); } } addFileSet(path, includes, excludes, f.getAttribute("targetdir"), f.getAttribute("os"), pack.packFiles, casesensitive); } // We add the pack packs.add(pack); } // We return the ArrayList return packs; } | 54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/91994653572a3171781f1edfa5a2651f3a9a49fb/Compiler.java/buggy/src/lib/com/izforge/izpack/compiler/Compiler.java |
|
else { } | protected ArrayList getPacks(XMLElement data) throws Exception { // Initialisation ArrayList packs = new ArrayList(); Vector v; XMLElement root = data.getFirstChildNamed("packs"); // We process each pack markup int npacks = root.getChildrenCount(); for (int i = 0; i < npacks; i++) { XMLElement el = root.getChildAtIndex(i); // Trivial initialisations Pack pack = new Pack(); pack.number = i; pack.name = el.getAttribute("name"); pack.required = el.getAttribute("required").equalsIgnoreCase("yes"); pack.description = el.getFirstChildNamed("description").getContent(); // We get the parsables list Iterator iter = null; Vector children = el.getChildrenNamed("parsable"); if (null != children && !children.isEmpty()) { iter = children.iterator(); while (iter.hasNext()) { XMLElement p = (XMLElement) iter.next(); pack.parsables.add (new ParsableFile(p.getAttribute("targetfile"), p.getAttribute("type", "plain"), p.getAttribute("encoding", null))); } } // We get the executables list children = el.getChildrenNamed("executable"); if (null != children && !children.isEmpty()) { iter = children.iterator(); while (iter.hasNext()) { XMLElement e = (XMLElement) iter.next(); // when to execute this executable int executeOn = ExecutableFile.NEVER; String val = e.getAttribute("stage", "never"); if ("postinstall".compareToIgnoreCase(val) == 0) executeOn = ExecutableFile.POSTINSTALL; else { } // main class of this executable String executeClass = e.getAttribute("class"); // type of this executable int executeType = ExecutableFile.BIN; val = e.getAttribute("type", "bin"); if ("jar".compareToIgnoreCase(val) == 0) executeType = ExecutableFile.JAR; else { } // what to do if execution fails int onFailure = ExecutableFile.ASK; val = e.getAttribute("failure", "ask"); if ("abort".compareToIgnoreCase(val) == 0) onFailure = ExecutableFile.ABORT; else if ("warn".compareToIgnoreCase(val) == 0) onFailure = ExecutableFile.WARN; else { } // get arguments for this executable ArrayList argList = null; XMLElement args = e.getFirstChildNamed("args"); if (null != args) { argList = new ArrayList(); Iterator argIterator = args.getChildrenNamed("arg").iterator(); while (argIterator.hasNext()) { XMLElement arg = (XMLElement) argIterator.next(); argList.add(arg.getAttribute("value")); } } // get os info on this executable ArrayList osList = new ArrayList(); Iterator osIterator = e.getChildrenNamed("os").iterator(); while (osIterator.hasNext()) { XMLElement os = (XMLElement) osIterator.next(); osList.add (new com.izforge.izpack.util.Os(os.getAttribute("family", null), os.getAttribute("name", null), os.getAttribute("version", null), os.getAttribute("arch", null))); } pack.executables.add(new ExecutableFile(e.getAttribute("targetfile"), executeType, executeClass, executeOn, onFailure, argList, osList)); } } // We get the files list iter = el.getChildrenNamed("file").iterator(); while (iter.hasNext()) { XMLElement f = (XMLElement) iter.next(); String path = basedir + File.separator + f.getAttribute("src"); File file = new File(path); boolean override = true; if (f.getAttribute("override") != null) override = f.getAttribute("override").equalsIgnoreCase("true"); addFile(file, f.getAttribute("targetdir"), f.getAttribute("os"), override, pack.packFiles); } // We get the fileset list iter = el.getChildrenNamed("fileset").iterator(); while (iter.hasNext()) { XMLElement f = (XMLElement) iter.next(); String path = basedir + File.separator + f.getAttribute("dir"); String casesensitive = f.getAttribute("casesensitive"); /* * get includes and excludes */ Vector xcludesList = f.getChildrenNamed("include"); String[] includes = null; XMLElement xclude = null; if (xcludesList.size() > 0) { includes = new String[xcludesList.size()]; for (int j = 0; j < xcludesList.size(); j++) { xclude = (XMLElement) xcludesList.get(j); includes[j] = (String) xclude.getAttribute("name"); } } xcludesList = f.getChildrenNamed("exclude"); String[] excludes = null; xclude = null; if (xcludesList.size() > 0) { excludes = new String[xcludesList.size()]; for (int j = 0; j < xcludesList.size(); j++) { xclude = (XMLElement) xcludesList.get(j); excludes[j] = (String) xclude.getAttribute("name"); } } addFileSet(path, includes, excludes, f.getAttribute("targetdir"), f.getAttribute("os"), pack.packFiles, casesensitive); } // We add the pack packs.add(pack); } // We return the ArrayList return packs; } | 54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/91994653572a3171781f1edfa5a2651f3a9a49fb/Compiler.java/buggy/src/lib/com/izforge/izpack/compiler/Compiler.java |
|
/* * get includes and excludes */ | protected ArrayList getPacks(XMLElement data) throws Exception { // Initialisation ArrayList packs = new ArrayList(); Vector v; XMLElement root = data.getFirstChildNamed("packs"); // We process each pack markup int npacks = root.getChildrenCount(); for (int i = 0; i < npacks; i++) { XMLElement el = root.getChildAtIndex(i); // Trivial initialisations Pack pack = new Pack(); pack.number = i; pack.name = el.getAttribute("name"); pack.required = el.getAttribute("required").equalsIgnoreCase("yes"); pack.description = el.getFirstChildNamed("description").getContent(); // We get the parsables list Iterator iter = null; Vector children = el.getChildrenNamed("parsable"); if (null != children && !children.isEmpty()) { iter = children.iterator(); while (iter.hasNext()) { XMLElement p = (XMLElement) iter.next(); pack.parsables.add (new ParsableFile(p.getAttribute("targetfile"), p.getAttribute("type", "plain"), p.getAttribute("encoding", null))); } } // We get the executables list children = el.getChildrenNamed("executable"); if (null != children && !children.isEmpty()) { iter = children.iterator(); while (iter.hasNext()) { XMLElement e = (XMLElement) iter.next(); // when to execute this executable int executeOn = ExecutableFile.NEVER; String val = e.getAttribute("stage", "never"); if ("postinstall".compareToIgnoreCase(val) == 0) executeOn = ExecutableFile.POSTINSTALL; else { } // main class of this executable String executeClass = e.getAttribute("class"); // type of this executable int executeType = ExecutableFile.BIN; val = e.getAttribute("type", "bin"); if ("jar".compareToIgnoreCase(val) == 0) executeType = ExecutableFile.JAR; else { } // what to do if execution fails int onFailure = ExecutableFile.ASK; val = e.getAttribute("failure", "ask"); if ("abort".compareToIgnoreCase(val) == 0) onFailure = ExecutableFile.ABORT; else if ("warn".compareToIgnoreCase(val) == 0) onFailure = ExecutableFile.WARN; else { } // get arguments for this executable ArrayList argList = null; XMLElement args = e.getFirstChildNamed("args"); if (null != args) { argList = new ArrayList(); Iterator argIterator = args.getChildrenNamed("arg").iterator(); while (argIterator.hasNext()) { XMLElement arg = (XMLElement) argIterator.next(); argList.add(arg.getAttribute("value")); } } // get os info on this executable ArrayList osList = new ArrayList(); Iterator osIterator = e.getChildrenNamed("os").iterator(); while (osIterator.hasNext()) { XMLElement os = (XMLElement) osIterator.next(); osList.add (new com.izforge.izpack.util.Os(os.getAttribute("family", null), os.getAttribute("name", null), os.getAttribute("version", null), os.getAttribute("arch", null))); } pack.executables.add(new ExecutableFile(e.getAttribute("targetfile"), executeType, executeClass, executeOn, onFailure, argList, osList)); } } // We get the files list iter = el.getChildrenNamed("file").iterator(); while (iter.hasNext()) { XMLElement f = (XMLElement) iter.next(); String path = basedir + File.separator + f.getAttribute("src"); File file = new File(path); boolean override = true; if (f.getAttribute("override") != null) override = f.getAttribute("override").equalsIgnoreCase("true"); addFile(file, f.getAttribute("targetdir"), f.getAttribute("os"), override, pack.packFiles); } // We get the fileset list iter = el.getChildrenNamed("fileset").iterator(); while (iter.hasNext()) { XMLElement f = (XMLElement) iter.next(); String path = basedir + File.separator + f.getAttribute("dir"); String casesensitive = f.getAttribute("casesensitive"); /* * get includes and excludes */ Vector xcludesList = f.getChildrenNamed("include"); String[] includes = null; XMLElement xclude = null; if (xcludesList.size() > 0) { includes = new String[xcludesList.size()]; for (int j = 0; j < xcludesList.size(); j++) { xclude = (XMLElement) xcludesList.get(j); includes[j] = (String) xclude.getAttribute("name"); } } xcludesList = f.getChildrenNamed("exclude"); String[] excludes = null; xclude = null; if (xcludesList.size() > 0) { excludes = new String[xcludesList.size()]; for (int j = 0; j < xcludesList.size(); j++) { xclude = (XMLElement) xcludesList.get(j); excludes[j] = (String) xclude.getAttribute("name"); } } addFileSet(path, includes, excludes, f.getAttribute("targetdir"), f.getAttribute("os"), pack.packFiles, casesensitive); } // We add the pack packs.add(pack); } // We return the ArrayList return packs; } | 54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/91994653572a3171781f1edfa5a2651f3a9a49fb/Compiler.java/buggy/src/lib/com/izforge/izpack/compiler/Compiler.java |
|
RegistryHandler rh = RegistryDefaultHandler.getInstance(); if( rh != null ) idata.setVariable("UNINSTALL_NAME", rh.getUninstallName()); | public void panelActivate() { if (abortInstallation) { parent.lockNextButton(); try { if (multipleInstall()) { setUniqueUninstallKey(); abortInstallation = false; parent.unlockNextButton(); } } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } } } | 54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/dd8f6204e72b3f8bb5c20b805d833c3be8f82a3d/CheckedHelloPanel.java/buggy/src/lib/com/izforge/izpack/panels/CheckedHelloPanel.java |
|
idata.setVariable("UNINSTALL_NAME", newUninstallName); | private void setUniqueUninstallKey() throws Exception { // Let us play a little bit with the regstry again... // Now we search for an unique uninstall key. // First we need a handler. There is no overhead at a // secound call of getInstance, therefore we do not buffer // the handler in this class. RegistryHandler rh = RegistryDefaultHandler.getInstance(); int oldVal = rh.getRoot(); // Only for security... // We know, that the product is already installed, else we // would not in this method. First we get the // "default" uninstall key. String uninstallName = rh.getUninstallName(); int uninstallModifier = 1; while (true) { if (uninstallName == null) break; // Should never be... // Now we define a new uninstall name. String newUninstallName = uninstallName + "(" + Integer.toString(uninstallModifier) + ")"; // Then we "create" the reg key with it. String keyName = RegistryHandler.UNINSTALL_ROOT + newUninstallName; rh.setRoot(RegistryImpl.HKEY_LOCAL_MACHINE); if (!rh.keyExist(keyName)) { // That's the name for which we searched. // Change the uninstall name in the reg helper. rh.setUninstallName(newUninstallName); // Now let us inform the user. emitNotification(parent.langpack .getString("CheckedHelloPanel.infoOverUninstallKey") + newUninstallName); // Now a little hack if the registry spec file contains // the pack "UninstallStuff". idata.setVariable("UNINSTALL_NAME", newUninstallName); break; } uninstallModifier++; } } | 54145 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54145/dd8f6204e72b3f8bb5c20b805d833c3be8f82a3d/CheckedHelloPanel.java/buggy/src/lib/com/izforge/izpack/panels/CheckedHelloPanel.java |
|
protected void aboutToLaunch(final String message) { String msg = ResourceUtil.getFormattedString("TestRunnerViewPart.message.launching", message); //$NON-NLS-1$// setInfoMessage(msg); firePropertyChange(IWorkbenchPart.PROP_TITLE); } | 53349 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/53349/939c2626f5ef7c6550d3a506ac6dd14b7667f498/TestRunnerViewPart.java/buggy/src/main/org/testng/eclipse/ui/TestRunnerViewPart.java |
||
return new Point(maxWidth, maxHeight); | return new Point(maxWidth, maxHeight); | private SashForm createSashForm(Composite parent) { m_sashForm = new SashForm(parent, SWT.VERTICAL); ViewForm top = new ViewForm(m_sashForm, SWT.NONE); m_tabFolder = createTestRunTabs(top); m_tabFolder.setLayoutData(new Layout() { protected Point computeSize (Composite composite, int wHint, int hHint, boolean flushCache) { if (wHint != SWT.DEFAULT && hHint != SWT.DEFAULT) return new Point(wHint, hHint); Control [] children = composite.getChildren (); int count = children.length; int maxWidth = 0, maxHeight = 0; for (int i=0; i<count; i++) { Control child = children [i]; Point pt = child.computeSize (SWT.DEFAULT, SWT.DEFAULT, flushCache); maxWidth = Math.max (maxWidth, pt.x); maxHeight = Math.max (maxHeight, pt.y); } if (wHint != SWT.DEFAULT) maxWidth= wHint; if (hHint != SWT.DEFAULT) maxHeight= hHint; return new Point(maxWidth, maxHeight); } protected void layout (Composite composite, boolean flushCache) { Rectangle rect= composite.getClientArea(); Control[] children = composite.getChildren(); for (int i = 0; i < children.length; i++) { children[i].setBounds(rect); } } }); top.setContent(m_tabFolder); ViewForm bottom = new ViewForm(m_sashForm, SWT.NONE); CLabel label = new CLabel(bottom, SWT.NONE); label.setText(ResourceUtil.getString("TestRunnerViewPart.label.failure")); //$NON-NLS-1$ label.setImage(fStackViewIcon); bottom.setTopLeft(label); ToolBar failureToolBar = new ToolBar(bottom, SWT.FLAT | SWT.WRAP); bottom.setTopCenter(failureToolBar); m_failureTraceComponent = new FailureTrace(bottom, this, failureToolBar); bottom.setContent(m_failureTraceComponent.getComposite()); m_sashForm.setWeights(new int[] { 50, 50 }); return m_sashForm; } | 53349 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/53349/939c2626f5ef7c6550d3a506ac6dd14b7667f498/TestRunnerViewPart.java/buggy/src/main/org/testng/eclipse/ui/TestRunnerViewPart.java |
private SashForm createSashForm(Composite parent) { m_sashForm = new SashForm(parent, SWT.VERTICAL); ViewForm top = new ViewForm(m_sashForm, SWT.NONE); m_tabFolder = createTestRunTabs(top); m_tabFolder.setLayoutData(new Layout() { protected Point computeSize (Composite composite, int wHint, int hHint, boolean flushCache) { if (wHint != SWT.DEFAULT && hHint != SWT.DEFAULT) return new Point(wHint, hHint); Control [] children = composite.getChildren (); int count = children.length; int maxWidth = 0, maxHeight = 0; for (int i=0; i<count; i++) { Control child = children [i]; Point pt = child.computeSize (SWT.DEFAULT, SWT.DEFAULT, flushCache); maxWidth = Math.max (maxWidth, pt.x); maxHeight = Math.max (maxHeight, pt.y); } if (wHint != SWT.DEFAULT) maxWidth= wHint; if (hHint != SWT.DEFAULT) maxHeight= hHint; return new Point(maxWidth, maxHeight); } protected void layout (Composite composite, boolean flushCache) { Rectangle rect= composite.getClientArea(); Control[] children = composite.getChildren(); for (int i = 0; i < children.length; i++) { children[i].setBounds(rect); } } }); top.setContent(m_tabFolder); ViewForm bottom = new ViewForm(m_sashForm, SWT.NONE); CLabel label = new CLabel(bottom, SWT.NONE); label.setText(ResourceUtil.getString("TestRunnerViewPart.label.failure")); //$NON-NLS-1$ label.setImage(fStackViewIcon); bottom.setTopLeft(label); ToolBar failureToolBar = new ToolBar(bottom, SWT.FLAT | SWT.WRAP); bottom.setTopCenter(failureToolBar); m_failureTraceComponent = new FailureTrace(bottom, this, failureToolBar); bottom.setContent(m_failureTraceComponent.getComposite()); m_sashForm.setWeights(new int[] { 50, 50 }); return m_sashForm; } | 53349 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/53349/939c2626f5ef7c6550d3a506ac6dd14b7667f498/TestRunnerViewPart.java/buggy/src/main/org/testng/eclipse/ui/TestRunnerViewPart.java |
||
return new Point(maxWidth, maxHeight); | return new Point(maxWidth, maxHeight); | protected Point computeSize (Composite composite, int wHint, int hHint, boolean flushCache) { if (wHint != SWT.DEFAULT && hHint != SWT.DEFAULT) return new Point(wHint, hHint); Control [] children = composite.getChildren (); int count = children.length; int maxWidth = 0, maxHeight = 0; for (int i=0; i<count; i++) { Control child = children [i]; Point pt = child.computeSize (SWT.DEFAULT, SWT.DEFAULT, flushCache); maxWidth = Math.max (maxWidth, pt.x); maxHeight = Math.max (maxHeight, pt.y); } if (wHint != SWT.DEFAULT) maxWidth= wHint; if (hHint != SWT.DEFAULT) maxHeight= hHint; return new Point(maxWidth, maxHeight); } | 53349 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/53349/939c2626f5ef7c6550d3a506ac6dd14b7667f498/TestRunnerViewPart.java/buggy/src/main/org/testng/eclipse/ui/TestRunnerViewPart.java |
protected void layout (Composite composite, boolean flushCache) { Rectangle rect= composite.getClientArea(); Control[] children = composite.getChildren(); for (int i = 0; i < children.length; i++) { children[i].setBounds(rect); } } | 53349 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/53349/939c2626f5ef7c6550d3a506ac6dd14b7667f498/TestRunnerViewPart.java/buggy/src/main/org/testng/eclipse/ui/TestRunnerViewPart.java |
||
protected CTabFolder createTestRunTabs(Composite parent) { CTabFolder tabFolder = new CTabFolder(parent, SWT.TOP); tabFolder.setLayoutData(new GridData(GridData.FILL_BOTH | GridData.GRAB_VERTICAL)); loadTestRunTabs(tabFolder); tabFolder.setSelection(0); m_activeRunTab = (TestRunTab) m_tabsList.firstElement(); tabFolder.addSelectionListener(new SelectionAdapter() { public void widgetSelected(SelectionEvent event) {// ppp("widgetSelected"); testTabChanged(event); } }); return tabFolder; } | 53349 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/53349/939c2626f5ef7c6550d3a506ac6dd14b7667f498/TestRunnerViewPart.java/buggy/src/main/org/testng/eclipse/ui/TestRunnerViewPart.java |
||
public void widgetSelected(SelectionEvent event) {// ppp("widgetSelected"); testTabChanged(event); } | 53349 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/53349/939c2626f5ef7c6550d3a506ac6dd14b7667f498/TestRunnerViewPart.java/buggy/src/main/org/testng/eclipse/ui/TestRunnerViewPart.java |
||
private void handleStopped() { postSyncRunnable(new Runnable() { public void run() { if(isDisposed()) { return; } fProgressBar.stopped();// updateProgressBar(m_progressBar.getMaximum(), false); } }); stopUpdateJobs(); } | 53349 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/53349/939c2626f5ef7c6550d3a506ac6dd14b7667f498/TestRunnerViewPart.java/buggy/src/main/org/testng/eclipse/ui/TestRunnerViewPart.java |
||
public void run() { if(isDisposed()) { return; } fProgressBar.stopped();// updateProgressBar(m_progressBar.getMaximum(), false); } | 53349 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/53349/939c2626f5ef7c6550d3a506ac6dd14b7667f498/TestRunnerViewPart.java/buggy/src/main/org/testng/eclipse/ui/TestRunnerViewPart.java |
||
private void postEndTest(final String testId, final String testName) { postSyncRunnable(new Runnable() { public void run() { if(isDisposed()) { return; } m_testIsRunning = false;// updateProgressBar(m_progressBar.getSelection() + 1, false); if(hasErrors()) { fNextAction.setEnabled(true); fPrevAction.setEnabled(true); } } }); } | 53349 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/53349/939c2626f5ef7c6550d3a506ac6dd14b7667f498/TestRunnerViewPart.java/buggy/src/main/org/testng/eclipse/ui/TestRunnerViewPart.java |